diff --git a/charts/keep/templates/keep-backend.yaml b/charts/keep/templates/keep-backend.yaml index edb9715..cf5d006 100644 --- a/charts/keep/templates/keep-backend.yaml +++ b/charts/keep/templates/keep-backend.yaml @@ -64,14 +64,13 @@ spec: - name: state-volume mountPath: /state readOnly: false - # livenessProbe: - # httpGet: - # path: / - # port: http - # readinessProbe: - # httpGet: - # path: / - # port: http + {{- with .Values.backend.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + + {{- if .Values.backend.healthCheck.enabled }} + {{- toYaml .Values.backend.healthCheck.probes | nindent 10 }} + {{- end }} resources: {{- toYaml .Values.backend.resources | nindent 12 }} initContainers: @@ -96,4 +95,7 @@ spec: volumes: - name: state-volume emptyDir: {} + {{- with .Values.backend.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/charts/keep/templates/keep-db-pv.yaml b/charts/keep/templates/keep-db-pv.yaml index fe22f19..151d704 100644 --- a/charts/keep/templates/keep-db-pv.yaml +++ b/charts/keep/templates/keep-db-pv.yaml @@ -1,15 +1,15 @@ -{{- if .Values.database.enabled -}} +{{- if and .Values.database.enabled .Values.database.pv.enabled -}} apiVersion: v1 kind: PersistentVolume metadata: name: {{ include "keep.fullname" . }}-pv spec: capacity: - storage: {{ .Values.database.size }} + storage: {{ .Values.database.pv.size }} accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain - storageClassName: {{ .Values.database.storageClass }} + storageClassName: {{ .Values.database.pv.storageClass }} hostPath: path: "/var/lib/mysql" {{- end }} diff --git a/charts/keep/templates/keep-db-pvc.yaml b/charts/keep/templates/keep-db-pvc.yaml index 5e37562..5f8b4a3 100644 --- a/charts/keep/templates/keep-db-pvc.yaml +++ b/charts/keep/templates/keep-db-pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.database.enabled -}} +{{- if and .Values.database.enabled .Values.database.pvc.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -6,8 +6,8 @@ metadata: spec: accessModes: - ReadWriteOnce - storageClassName: {{ .Values.database.storageClass }} + storageClassName: {{ .Values.database.pvc.storageClass }} resources: requests: - storage: 5Gi + storage: {{ .Values.database.pvc.size }} {{- end }} diff --git a/charts/keep/templates/keep-db.yaml b/charts/keep/templates/keep-db.yaml index 89a8d04..9dd4bbe 100644 --- a/charts/keep/templates/keep-db.yaml +++ b/charts/keep/templates/keep-db.yaml @@ -49,6 +49,12 @@ spec: - mountPath: /var/lib/mysql name: {{ include "keep.fullname" . }}-pv readOnly: false + {{- with .Values.database.extraVolumeMounts }} + {{- toYaml . | nindent 10 }} + {{- end }} + {{- if .Values.database.healthCheck.enabled }} + {{- toYaml .Values.database.healthCheck.probes | nindent 10 }} + {{- end }} resources: {{- toYaml .Values.database.resources | nindent 12 }} {{- with .Values.database.nodeSelector }} @@ -67,4 +73,7 @@ spec: - name: {{ include "keep.fullname" . }}-pv persistentVolumeClaim: claimName: {{ include "keep.fullname" . }}-pvc + {{- with .Values.database.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/charts/keep/templates/keep-frontend-service.yaml b/charts/keep/templates/keep-frontend-service.yaml index 6a2b2d1..7c16067 100644 --- a/charts/keep/templates/keep-frontend-service.yaml +++ b/charts/keep/templates/keep-frontend-service.yaml @@ -13,6 +13,9 @@ spec: targetPort: http protocol: TCP name: http + {{ if eq .Values.frontend.service.type "NodePort" }} + nodePort: {{ .Values.frontend.service.nodePort }} + {{- end }} selector: {{- include "keep.selectorLabels" . | nindent 4 }} keep-component: frontend diff --git a/charts/keep/templates/keep-frontend.yaml b/charts/keep/templates/keep-frontend.yaml index 4db77e3..8787de1 100644 --- a/charts/keep/templates/keep-frontend.yaml +++ b/charts/keep/templates/keep-frontend.yaml @@ -49,14 +49,9 @@ spec: - name: state-volume mountPath: /state readOnly: false - # livenessProbe: - # httpGet: - # path: / - # port: http - # readinessProbe: - # httpGet: - # path: / - # port: http + {{- if .Values.frontend.healthCheck.enabled }} + {{- toYaml .Values.frontend.healthCheck.probes | nindent 10 }} + {{- end }} resources: {{- toYaml .Values.frontend.resources | nindent 12 }} {{- with .Values.frontend.nodeSelector }} diff --git a/charts/keep/templates/keep-websocket-server.yaml b/charts/keep/templates/keep-websocket-server.yaml index bf9709b..923be3b 100644 --- a/charts/keep/templates/keep-websocket-server.yaml +++ b/charts/keep/templates/keep-websocket-server.yaml @@ -49,14 +49,9 @@ spec: - name: state-volume mountPath: /state readOnly: false - # livenessProbe: - # httpGet: - # path: / - # port: http - # readinessProbe: - # httpGet: - # path: / - # port: http + {{- if .Values.websocket.healthCheck.enabled }} + {{- toYaml .Values.websocket.healthCheck.probes | nindent 10 }} + {{- end }} resources: {{- toYaml .Values.websocket.resources | nindent 12 }} {{- with .Values.websocket.nodeSelector }} diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index c92b175..91879c1 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -76,6 +76,19 @@ backend: nodeSelector: {} tolerations: [] affinity: {} + healthCheck: + enabled: false + probes: + readinessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 8080 + extraVolumeMounts: [] + extraVolumes: [] frontend: enabled: true @@ -145,6 +158,17 @@ frontend: nodeSelector: {} tolerations: [] affinity: {} + healthCheck: + enabled: false + probes: + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http websocket: enabled: true @@ -182,12 +206,29 @@ websocket: nodeSelector: {} tolerations: [] affinity: {} + healthCheck: + enabled: false + probes: + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http database: enabled: true replicaCount: 1 - size: 5Gi - storageClass: "" + pv: + enabled: false + size: 5Gi + storageClass: "" + pvc: + enabled: true + size: 5Gi + storageClass: "" image: repository: mysql pullPolicy: IfNotPresent @@ -212,3 +253,16 @@ database: nodeSelector: {} tolerations: [] affinity: {} + healthCheck: + enabled: false + probes: + readinessProbe: + tcpSocket: + port: 3306 + initialDelaySeconds: 30 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 3306 + extraVolumeMounts: [] + extraVolumes: [] \ No newline at end of file