added n8n
This commit is contained in:
parent
3d45fa32a0
commit
0de93c43eb
2 changed files with 33 additions and 34 deletions
31
.github/workflows/n8n.yml
vendored
31
.github/workflows/n8n.yml
vendored
|
|
@ -8,39 +8,12 @@ on:
|
|||
- "*"
|
||||
|
||||
env:
|
||||
IMAGE_NAME: "docker.io/kimjunte/n8n"
|
||||
IMAGE: "docker.io/n8nio/n8n:latest"
|
||||
MANIFEST_PATH: "k8s/n8n.yml"
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Inject slug variables
|
||||
uses: rlespinasse/github-slug-action@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Build n8n image
|
||||
run: |
|
||||
docker build \
|
||||
-t $IMAGE_NAME:$GITHUB_REF_SLUG \
|
||||
n8n/ # <--- update if your Dockerfile lives somewhere else
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push $IMAGE_NAME:$GITHUB_REF_SLUG
|
||||
|
||||
deploy:
|
||||
runs-on: mealcraft-runners
|
||||
needs: build-and-push
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
|
|
@ -74,8 +47,6 @@ jobs:
|
|||
kubectl config use-context runner-context
|
||||
|
||||
- name: Deploy n8n to Kubernetes
|
||||
env:
|
||||
IMAGE: "${{ env.IMAGE_NAME }}:${{ github.ref_name }}"
|
||||
run: |
|
||||
echo "Deploying n8n with IMAGE=$IMAGE"
|
||||
export IMAGE
|
||||
|
|
|
|||
36
n8n/n8n.yml
36
n8n/n8n.yml
|
|
@ -4,13 +4,14 @@ metadata:
|
|||
name: n8n
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: n8n
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: web
|
||||
port: 5678
|
||||
targetPort: 5678
|
||||
selector:
|
||||
app: n8n
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
|
@ -55,6 +56,7 @@ spec:
|
|||
- name: n8n-data
|
||||
persistentVolumeClaim:
|
||||
claimName: n8n-pvc
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
|
|
@ -63,11 +65,13 @@ metadata:
|
|||
namespace: default
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
- ReadWriteMany
|
||||
storageClassName: n8n-local-storage
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
storageClassName: microk8s-hostpath
|
||||
|
||||
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
|
|
@ -87,3 +91,27 @@ spec:
|
|||
certResolver: myresolver
|
||||
domains:
|
||||
- main: n8n.juntekim.com
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: n8n-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
volumeMode: Filesystem
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: n8n-local-storage
|
||||
local:
|
||||
path: /home/kimjunte/k8s_storage/n8n
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- mist
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue