From d9567d3fbb84f8fdd60477bd990d36c97d211408 Mon Sep 17 00:00:00 2001 From: Ravindra Date: Wed, 3 Apr 2024 13:13:58 +0400 Subject: [PATCH 1/4] Improvement in helm chart --- charts/keep/templates/keep-backend.yaml | 18 +++--- charts/keep/templates/keep-db-pv.yaml | 6 +- charts/keep/templates/keep-db-pvc.yaml | 6 +- charts/keep/templates/keep-db.yaml | 9 +++ .../keep/templates/keep-frontend-service.yaml | 3 + charts/keep/templates/keep-frontend.yaml | 11 +--- .../keep/templates/keep-websocket-server.yaml | 11 +--- charts/keep/values.yaml | 58 ++++++++++++++++++- 8 files changed, 90 insertions(+), 32 deletions(-) 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 From a129b7d1256823a35628ede626ea2734573761b1 Mon Sep 17 00:00:00 2001 From: Ravindra Date: Wed, 3 Apr 2024 16:20:46 +0400 Subject: [PATCH 2/4] Updated chart version and pv default true --- charts/keep/Chart.yaml | 2 +- charts/keep/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/keep/Chart.yaml b/charts/keep/Chart.yaml index 1bf14b0..f395fb1 100644 --- a/charts/keep/Chart.yaml +++ b/charts/keep/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: keep -version: 0.0.4 +version: 0.0.5 description: Keep Helm Chart type: application icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75 diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index 91879c1..d1e0b4c 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -222,7 +222,7 @@ database: enabled: true replicaCount: 1 pv: - enabled: false + enabled: true size: 5Gi storageClass: "" pvc: From d8bbe8e4f550d0e52bd6e27f035394e123fe54b0 Mon Sep 17 00:00:00 2001 From: pehlicd <65170388+pehlicd@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:42:47 +0200 Subject: [PATCH 3/4] feat: update docs and fix trailing spaces --- charts/keep/README.md | 34 +++++++++++++++++++++++++++++++--- charts/keep/values.yaml | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/charts/keep/README.md b/charts/keep/README.md index 9bacc45..e7356d4 100644 --- a/charts/keep/README.md +++ b/charts/keep/README.md @@ -1,6 +1,6 @@ # keep -![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square) +![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square) Keep Helm Chart @@ -48,6 +48,13 @@ Keep Helm Chart | backend.env[7].value | string | `"keep-websocket"` | | | backend.env[8].name | string | `"PUSHER_PORT"` | | | backend.env[8].value | int | `6001` | | +| backend.extraVolumeMounts | list | `[]` | | +| backend.extraVolumes | list | `[]` | | +| backend.healthCheck.enabled | bool | `false` | | +| backend.healthCheck.probes.livenessProbe.tcpSocket.port | int | `8080` | | +| backend.healthCheck.probes.readinessProbe.initialDelaySeconds | int | `30` | | +| backend.healthCheck.probes.readinessProbe.periodSeconds | int | `10` | | +| backend.healthCheck.probes.readinessProbe.tcpSocket.port | int | `8080` | | | backend.image.pullPolicy | string | `"Always"` | | | backend.image.repository | string | `"us-central1-docker.pkg.dev/keephq/keep/keep-api"` | | | backend.image.tag | string | `"latest"` | | @@ -85,6 +92,13 @@ Keep Helm Chart | database.env[1].value | string | `"keep"` | | | database.env[2].name | string | `"MYSQL_PASSWORD"` | | | database.env[2].value | string | `nil` | | +| database.extraVolumeMounts | list | `[]` | | +| database.extraVolumes | list | `[]` | | +| database.healthCheck.enabled | bool | `false` | | +| database.healthCheck.probes.livenessProbe.tcpSocket.port | int | `3306` | | +| database.healthCheck.probes.readinessProbe.initialDelaySeconds | int | `30` | | +| database.healthCheck.probes.readinessProbe.periodSeconds | int | `10` | | +| database.healthCheck.probes.readinessProbe.tcpSocket.port | int | `3306` | | | database.image.pullPolicy | string | `"IfNotPresent"` | | | database.image.repository | string | `"mysql"` | | | database.image.tag | string | `"latest"` | | @@ -92,13 +106,17 @@ Keep Helm Chart | database.nodeSelector | object | `{}` | | | database.podAnnotations | object | `{}` | | | database.podSecurityContext | object | `{}` | | +| database.pv.enabled | bool | `true` | | +| database.pv.size | string | `"5Gi"` | | +| database.pv.storageClass | string | `""` | | +| database.pvc.enabled | bool | `true` | | +| database.pvc.size | string | `"5Gi"` | | +| database.pvc.storageClass | string | `""` | | | database.replicaCount | int | `1` | | | database.resources | object | `{}` | | | database.securityContext | object | `{}` | | | database.service.port | int | `3306` | | | database.service.type | string | `"ClusterIP"` | | -| database.size | string | `"5Gi"` | | -| database.storageClass | string | `""` | | | database.tolerations | list | `[]` | | | frontend.affinity | object | `{}` | | | frontend.autoscaling.enabled | bool | `false` | | @@ -130,6 +148,11 @@ Keep Helm Chart | frontend.env[8].value | string | `"0.0.0.0"` | | | frontend.env[9].name | string | `"PUSHER_HOST"` | | | frontend.env[9].value | string | `"keep-websocket.default.svc.cluster.local"` | | +| frontend.healthCheck.enabled | bool | `false` | | +| frontend.healthCheck.probes.livenessProbe.httpGet.path | string | `"/"` | | +| frontend.healthCheck.probes.livenessProbe.httpGet.port | string | `"http"` | | +| frontend.healthCheck.probes.readinessProbe.httpGet.path | string | `"/"` | | +| frontend.healthCheck.probes.readinessProbe.httpGet.port | string | `"http"` | | | frontend.image.pullPolicy | string | `"Always"` | | | frontend.image.repository | string | `"us-central1-docker.pkg.dev/keephq/keep/keep-ui"` | | | frontend.image.tag | string | `"latest"` | | @@ -178,6 +201,11 @@ Keep Helm Chart | websocket.env[2].value | string | `"keepappkey"` | | | websocket.env[3].name | string | `"SOKETI_DEFAULT_APP_SECRET"` | | | websocket.env[3].value | string | `"keepappsecret"` | | +| websocket.healthCheck.enabled | bool | `false` | | +| websocket.healthCheck.probes.livenessProbe.httpGet.path | string | `"/"` | | +| websocket.healthCheck.probes.livenessProbe.httpGet.port | string | `"http"` | | +| websocket.healthCheck.probes.readinessProbe.httpGet.path | string | `"/"` | | +| websocket.healthCheck.probes.readinessProbe.httpGet.port | string | `"http"` | | | websocket.image.pullPolicy | string | `"Always"` | | | websocket.image.repository | string | `"quay.io/soketi/soketi:1.4-16-debian"` | | | websocket.image.tag | string | `"latest"` | | diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index d1e0b4c..cf92f1a 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -265,4 +265,4 @@ database: tcpSocket: port: 3306 extraVolumeMounts: [] - extraVolumes: [] \ No newline at end of file + extraVolumes: [] From 5d3870da00f315c408289629c8e0cf05073ab293 Mon Sep 17 00:00:00 2001 From: pehlicd <65170388+pehlicd@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:00:31 +0200 Subject: [PATCH 4/4] fix: fix lint --- charts/keep/values.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index cf92f1a..478513f 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -209,14 +209,14 @@ websocket: healthCheck: enabled: false probes: - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http database: enabled: true