Reorganize helm charts, add lifecycle hooks

- remove namespace, since it's best practice to use the cli to add it,
  @roschaefer points out
- organize templates into directories
- migrations should be ran after the backend has started...
- should init really be ran every time??
This commit is contained in:
mattwr18 2020-01-29 20:39:47 +01:00
parent aa799e6f6b
commit a74abbb053
17 changed files with 31 additions and 30 deletions

View File

@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "0.1.0"
appVersion: "0.2.2"
description: A Helm chart for Human Connection
name: human-connection
version: 0.1.0

View File

@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-backend
namespace: human-connection
spec:
replicas: 1
minReadySeconds: 15
@ -26,7 +25,11 @@ spec:
containers:
- name: backend
image: humanconnection/nitro-backend:latest
imagePullPolicy: {{ .Values.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "{{ .Values.application.initializeCommand }}", "&&", "{{ .Values.application.migrationsCommand }}"]
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap

View File

@ -3,7 +3,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-mailserver
namespace: human-connection
spec:
replicas: 1
minReadySeconds: 15
@ -20,7 +19,7 @@ spec:
containers:
- name: mailserver
image: djfarrelly/maildev
imagePullPolicy: {{ .Values.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 80
- containerPort: 25

View File

@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-maintenance
namespace: human-connection
spec:
selector:
matchLabels:

View File

@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-neo4j
namespace: human-connection
spec:
replicas: 1
strategy:
@ -23,8 +22,8 @@ spec:
spec:
containers:
- name: neo4j
image: humanconnection/neo4j:latest
imagePullPolicy: {{ .Values.pullPolicy }}
image: humanconnection/neo4j:0.2.2
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 7687
- containerPort: 7474
@ -36,12 +35,10 @@ spec:
env:
- name: NEO4J_dbms_security_procedures_unrestricted
value: "algo.*,apoc.*"
- name: SECURE_FILE_PERMISSIONS
value: "yes"
{{- range $key, $val := .Values.neo4jConfig }}
- name: NEO4J_{{ $key }}
value: {{ $val | quote }}
{{- end}}
{{- end }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap

View File

@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-webapp
namespace: human-connection
spec:
replicas: 2
minReadySeconds: 15
@ -19,8 +18,8 @@ spec:
spec:
containers:
- name: webapp
image: humanconnection/nitro-web:latest
imagePullPolicy: {{ .Values.pullPolicy }}
image: humanconnection/nitro-web:0.2.2
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap

View File

@ -2,7 +2,6 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
namespace: human-connection
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: {{ .Values.letsencryptIssuer }}

View File

@ -2,7 +2,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-backend
namespace: human-connection
spec:
ports:
- name: graphql

View File

@ -2,7 +2,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-neo4j
namespace: human-connection
spec:
ports:
- name: bolt

View File

@ -2,7 +2,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-webapp
namespace: human-connection
spec:
ports:
- name: {{ .Release.Name }}-webapp

View File

@ -1,24 +1,32 @@
domain: develop.human-connection.org
commit: 889a7cdd24dda04a139b2b77d626e984d6db6781
pullPolicy: Always
# configs
application:
initializeCommand: "yarn prod:migrate init"
migrationsCommand: "yarn prod:migrate up"
developmentMailserverDomain: "mailserver.human-connection.org"
humanConnectionDomain: "develop.human-connection.org"
supportEmail: "devcom@human-connection.org"
image:
pullPolicy: Always
letsencryptIssuer: "letsencrypt-prod"
smtpHost: "mailserver.human-connection"
smtpPort: "25"
smtpUsername:
smtpPassword:
neo4jResourceRequestsMemory: "1G"
neo4jResourceLimitsMemory: "2G"
neo4jConfig:
apoc_import_file_enabled: "true"
dbms_memory_pagecache_size: "490M"
dbms_memory_heap_max__size: "500M"
dbms_memory_heap_initial__size: "500M"
neo4jResourceLimitsMemory: "2G"
neo4jResourceRequestsMemory: "1G"
supportEmail: "devcom@human-connection.org"
smtpHost: "mailserver.human-connection"
smtpPort: "25"
smtpUsername:
smtpPassword:
volumes:
uploads:
storage: 5Gi
neo4jData:
storage: 8Gi
# secrets
jwtSecret: "Yi8mJjdiNzhCRiZmdi9WZA=="
privateKeyPassphrase: "YTdkc2Y3OHNhZGc4N2FkODdzZmFnc2FkZzc4"

View File

@ -38,7 +38,7 @@ spec:
name: human-connection
image: humanconnection/nitro-backend:latest
imagePullPolicy: Always
name: nitro-backend
name: backend
ports:
- containerPort: 4000
protocol: TCP

View File

@ -9,4 +9,4 @@
- ReadWriteOnce
resources:
requests:
storage: 25Gi
storage: 8Gi