Merge pull request #13 from MealCraft/feature/moredeployments
added n8n
This commit is contained in:
commit
3b3f135201
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:
|
env:
|
||||||
IMAGE_NAME: "docker.io/kimjunte/n8n"
|
IMAGE: "docker.io/n8nio/n8n:latest"
|
||||||
MANIFEST_PATH: "k8s/n8n.yml"
|
MANIFEST_PATH: "k8s/n8n.yml"
|
||||||
|
|
||||||
jobs:
|
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:
|
deploy:
|
||||||
runs-on: mealcraft-runners
|
runs-on: mealcraft-runners
|
||||||
needs: build-and-push
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
|
|
@ -74,8 +47,6 @@ jobs:
|
||||||
kubectl config use-context runner-context
|
kubectl config use-context runner-context
|
||||||
|
|
||||||
- name: Deploy n8n to Kubernetes
|
- name: Deploy n8n to Kubernetes
|
||||||
env:
|
|
||||||
IMAGE: "${{ env.IMAGE_NAME }}:${{ github.ref_name }}"
|
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying n8n with IMAGE=$IMAGE"
|
echo "Deploying n8n with IMAGE=$IMAGE"
|
||||||
export IMAGE
|
export IMAGE
|
||||||
|
|
|
||||||
36
n8n/n8n.yml
36
n8n/n8n.yml
|
|
@ -4,13 +4,14 @@ metadata:
|
||||||
name: n8n
|
name: n8n
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
|
selector:
|
||||||
|
app: n8n
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
name: web
|
name: web
|
||||||
port: 5678
|
port: 5678
|
||||||
targetPort: 5678
|
targetPort: 5678
|
||||||
selector:
|
|
||||||
app: n8n
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|
@ -55,6 +56,7 @@ spec:
|
||||||
- name: n8n-data
|
- name: n8n-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: n8n-pvc
|
claimName: n8n-pvc
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
|
|
@ -63,11 +65,13 @@ metadata:
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteMany
|
||||||
|
storageClassName: n8n-local-storage
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 5Gi
|
storage: 5Gi
|
||||||
storageClassName: microk8s-hostpath
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
|
|
@ -87,3 +91,27 @@ spec:
|
||||||
certResolver: myresolver
|
certResolver: myresolver
|
||||||
domains:
|
domains:
|
||||||
- main: n8n.juntekim.com
|
- 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