Skip to content

Commit

Permalink
Improvement in helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
rvgud committed Apr 3, 2024
1 parent dfa1197 commit d9567d3
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 32 deletions.
18 changes: 10 additions & 8 deletions charts/keep/templates/keep-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -96,4 +95,7 @@ spec:
volumes:
- name: state-volume
emptyDir: {}
{{- with .Values.backend.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/keep/templates/keep-db-pv.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 3 additions & 3 deletions charts/keep/templates/keep-db-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{- if .Values.database.enabled -}}
{{- if and .Values.database.enabled .Values.database.pvc.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "keep.fullname" . }}-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.database.storageClass }}
storageClassName: {{ .Values.database.pvc.storageClass }}
resources:
requests:
storage: 5Gi
storage: {{ .Values.database.pvc.size }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/keep/templates/keep-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
3 changes: 3 additions & 0 deletions charts/keep/templates/keep-frontend-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions charts/keep/templates/keep-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 3 additions & 8 deletions charts/keep/templates/keep-websocket-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
58 changes: 56 additions & 2 deletions charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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: []

0 comments on commit d9567d3

Please sign in to comment.