set up customer1 kustomization
This commit is contained in:
parent
c07327a01c
commit
2c25f4ad1e
14 changed files with 66 additions and 30 deletions
18
apps/base/customer1/apigateway.yaml
Normal file
18
apps/base/customer1/apigateway.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: Gateway
|
||||
metadata:
|
||||
name: external-http-gateway
|
||||
namespace: customer1
|
||||
spec:
|
||||
gatewayClassName: gke-l7-global-external-managed # Use gke-l7-global-external-http for external, or gke-l7-rilb for internal
|
||||
listeners:
|
||||
- name: https
|
||||
protocol: HTTPS
|
||||
port: 443
|
||||
tls:
|
||||
mode: Terminate
|
||||
options:
|
||||
networking.gke.io/pre-shared-certs: n8n-sirius-sec-com
|
||||
allowedRoutes:
|
||||
namespaces:
|
||||
from: All
|
||||
21
apps/base/customer1/configmap.yaml
Normal file
21
apps/base/customer1/configmap.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: customer1-n8n-config
|
||||
namespace: customer1
|
||||
data:
|
||||
N8N_PORT: "5678"
|
||||
|
||||
WEBHOOK_URL: "n8n.sirius-sec.com"
|
||||
N8N_LISTEN_ADDRESS: "0.0.0.0"
|
||||
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: "true"
|
||||
N8N_SECURE_COOKIE: "true"
|
||||
N8N_METRICS: "true"
|
||||
QUEUE_HEALTH_CHECK_ACTIVE: "true"
|
||||
DB_TYPE: "postgresdb"
|
||||
DB_POSTGRESDB_HOST: "customer1-db-rw-customer1.svc.cluster.local"
|
||||
DB_POSTGRESDB_PORT: "5432"
|
||||
DB_POSTGRESDB_DATABASE: "app"
|
||||
DB_POSTGRESDB_USER: "sirius"
|
||||
|
||||
|
||||
68
apps/base/customer1/deployment.yaml
Normal file
68
apps/base/customer1/deployment.yaml
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: customer1-n8n
|
||||
namespace: customer1
|
||||
labels:
|
||||
app: customer1-n8n
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: customer1-n8n
|
||||
replicas: 1
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: customer1-n8n
|
||||
spec:
|
||||
# initContainers:
|
||||
# Init containers are exactly like regular containers, except:
|
||||
# - Init containers always run to completion.
|
||||
# - Each init container must complete successfully before the next one starts.
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
|
||||
containers:
|
||||
- name: customer1-n8n
|
||||
image: docker.n8n.io/n8nio/n8n:2.1.4
|
||||
imagePullPolicy: IfNotPresent
|
||||
resources:
|
||||
requests:
|
||||
memory: "500Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "500"
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
|
||||
|
||||
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: customer1-n8n-config
|
||||
- secretRef:
|
||||
name: n8n-secret
|
||||
|
||||
ports:
|
||||
- containerPort: 5678
|
||||
name: n8n-port
|
||||
volumeMounts:
|
||||
|
||||
- name: n8n-data
|
||||
mountPath: /home/node/.n8n
|
||||
|
||||
|
||||
|
||||
volumes:
|
||||
- name: n8n-data
|
||||
persistentVolumeClaim:
|
||||
claimName: n8n-data
|
||||
restartPolicy: Always
|
||||
|
||||
|
||||
16
apps/base/customer1/healthcheck.yaml
Normal file
16
apps/base/customer1/healthcheck.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: networking.gke.io/v1
|
||||
kind: HealthCheckPolicy
|
||||
metadata:
|
||||
name: n8n-healthcheck
|
||||
namespace: customer1
|
||||
spec:
|
||||
default:
|
||||
config:
|
||||
type: HTTP
|
||||
httpHealthCheck:
|
||||
port: 5678 # The port n8n is listening on
|
||||
requestPath: /healthz # Ensure this returns a 200 OK
|
||||
targetRef:
|
||||
group: ""
|
||||
kind: Service
|
||||
name: n8n-service # Must match your n8n Service name
|
||||
15
apps/base/customer1/http-route.yaml
Normal file
15
apps/base/customer1/http-route.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: n8n-route
|
||||
namespace: customer1
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: external-http-gateway
|
||||
hostnames:
|
||||
- "n8n.sirius-sec.com"
|
||||
rules:
|
||||
- backendRefs:
|
||||
- name: n8n-service # The name of your Kubernetes Service
|
||||
port: 80
|
||||
|
||||
15
apps/base/customer1/kustomization.yaml
Normal file
15
apps/base/customer1/kustomization.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta
|
||||
kind: Kustomization
|
||||
namespace: customer1
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- deployment.yaml
|
||||
- configmap.yaml
|
||||
- service.yaml
|
||||
- storage.yaml
|
||||
- http-route.yaml
|
||||
- n8n-secret.yaml
|
||||
- pg-cluster-customer1.yaml
|
||||
- service.yaml
|
||||
- storage.yaml
|
||||
|
||||
8
apps/base/customer1/n8n-secret.yaml
Normal file
8
apps/base/customer1/n8n-secret.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: v1
|
||||
data:
|
||||
DB_POSTGRESDB_PASSWORD:
|
||||
kind: Secret
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
name: n8n-secret
|
||||
namespace: customer1
|
||||
4
apps/base/customer1/namespace.yaml
Normal file
4
apps/base/customer1/namespace.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: customer1
|
||||
16
apps/base/customer1/pg-cluster-n8n.yaml
Normal file
16
apps/base/customer1/pg-cluster-n8n.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: customer1-pgdb
|
||||
spec:
|
||||
instances: 3
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:15.2
|
||||
storage:
|
||||
size: 5Gi
|
||||
bootstrap:
|
||||
initdb:
|
||||
database: app
|
||||
owner: app
|
||||
secret:
|
||||
name: customer1-db-credentials
|
||||
|
||||
15
apps/base/customer1/service.yaml
Normal file
15
apps/base/customer1/service.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: n8n-service
|
||||
namespace: customer1
|
||||
annotations:
|
||||
cloud.google.com: '{"ingress": true}'
|
||||
spec:
|
||||
selector:
|
||||
app: customer1-n8n
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 5678
|
||||
name: http
|
||||
|
||||
13
apps/base/customer1/storage.yaml
Normal file
13
apps/base/customer1/storage.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: n8n-data
|
||||
namespace: customer1
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
|
||||
Loading…
Reference in a new issue