From 138559a3ac31eccc11e8399f83c4ddb7e993b04a Mon Sep 17 00:00:00 2001 From: shahargl Date: Wed, 9 Oct 2024 16:15:56 +0300 Subject: [PATCH 1/4] feat: websocket ingress --- charts/keep/Chart.yaml | 2 +- charts/keep/templates/websocket-ingress.yaml | 64 +++++++++++++++ charts/keep/templates/websocket-route.yaml | 20 +++++ charts/keep/values.yaml | 85 +++++++------------- 4 files changed, 116 insertions(+), 55 deletions(-) create mode 100644 charts/keep/templates/websocket-ingress.yaml create mode 100644 charts/keep/templates/websocket-route.yaml diff --git a/charts/keep/Chart.yaml b/charts/keep/Chart.yaml index f047549..0d715cc 100644 --- a/charts/keep/Chart.yaml +++ b/charts/keep/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: keep -version: 0.1.18 +version: 0.1.19 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/templates/websocket-ingress.yaml b/charts/keep/templates/websocket-ingress.yaml new file mode 100644 index 0000000..acdba7c --- /dev/null +++ b/charts/keep/templates/websocket-ingress.yaml @@ -0,0 +1,64 @@ +{{- if and .Values.websocket.enabled .Values.websocket.ingress.enabled -}} +{{- $fullName := include "keep.fullname" . -}} +{{- $svcPort := .Values.websocket.service.port -}} +{{- if and .Values.websocket.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.websocket.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.websocket.ingress.annotations "kubernetes.io/ingress.class" .Values.websocket.ingress.className }} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }}-websocket + labels: + {{- include "keep.labels" . | nindent 4 }} + {{- with .Values.websocket.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.websocket.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.websocket.ingress.className }} + {{- end }} + {{- if .Values.websocket.ingress.tls }} + tls: + {{- range .Values.websocket.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.websocket.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }}-websocket + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }}-websocket + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.websocket.extraIngress -}} + {{ toYaml .Values.websocket.extraIngress | nindent 2 }} + {{- end }} +{{- end }} diff --git a/charts/keep/templates/websocket-route.yaml b/charts/keep/templates/websocket-route.yaml new file mode 100644 index 0000000..f010132 --- /dev/null +++ b/charts/keep/templates/websocket-route.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.websocket.enabled .Values.websocket.route.enabled -}} +{{- $fullName := include "keep.fullname" . -}} +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: {{ $fullName }}-websocket + labels: + {{- include "keep.labels" . | nindent 4 }} +spec: + host: {{ .Values.websocket.route.host }} + to: + kind: Service + name: {{ $fullName }}-websocket + weight: 100 + port: + targetPort: {{ .Values.websocket.service.port }} + wildcardPolicy: {{ .Values.websocket.route.wildcardPolicy }} + tls: + {{ toYaml .Values.websocket.route.tls | indent 4 }} +{{- end }} diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index 52f086d..3d4bf48 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -176,13 +176,17 @@ websocket: enabled: true env: - name: SOKETI_USER_AUTHENTICATION_TIMEOUT - value: 3000 + value: "3000" - name: SOKETI_DEFAULT_APP_ID - value: 1 + value: "1" - name: SOKETI_DEFAULT_APP_KEY value: keepappkey - name: SOKETI_DEFAULT_APP_SECRET value: keepappsecret + - name: HOSTNAME + value: "0.0.0.0" + - name: PORT + value: "6001" replicaCount: 1 image: repository: quay.io/soketi/soketi @@ -199,6 +203,26 @@ websocket: service: type: ClusterIP port: 6001 + ingress: + enabled: true + className: "" + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/enable-websocket: "true" + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + hosts: + - host: websocket.example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + route: + enabled: false + host: websocket.example.local + path: / + tls: [] + wildcardPolicy: None resources: {} autoscaling: enabled: false @@ -213,59 +237,12 @@ websocket: enabled: false probes: livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - -database: - enabled: true - replicaCount: 1 - pv: - enabled: true - size: 5Gi - storageClass: "" - pvc: - enabled: true - size: 5Gi - storageClass: "" - image: - repository: mysql - pullPolicy: IfNotPresent - tag: "latest" - env: - - name: MYSQL_ALLOW_EMPTY_PASSWORD - value: yes - - name: MYSQL_DATABASE - value: keep - - name: MYSQL_PASSWORD - value: null - imagePullSecrets: [] - podAnnotations: {} - podSecurityContext: {} - securityContext: {} - service: - type: ClusterIP - port: 3306 - resources: {} - autoscaling: - enabled: false - nodeSelector: {} - tolerations: [] - affinity: {} - healthCheck: - enabled: false - probes: - readinessProbe: tcpSocket: - port: 3306 + port: 6001 initialDelaySeconds: 30 periodSeconds: 10 - livenessProbe: + readinessProbe: tcpSocket: - port: 3306 - extraVolumeMounts: [] - extraVolumes: [] + port: 6001 + initialDelaySeconds: 30 + periodSeconds: 10 From a9649d97920c35727ec5ae581a0034c625a9c054 Mon Sep 17 00:00:00 2001 From: shahargl Date: Wed, 9 Oct 2024 16:17:17 +0300 Subject: [PATCH 2/4] feat: remove redundant --- charts/keep/values.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index 3d4bf48..38c56ce 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -176,17 +176,13 @@ websocket: enabled: true env: - name: SOKETI_USER_AUTHENTICATION_TIMEOUT - value: "3000" + value: 3000 - name: SOKETI_DEFAULT_APP_ID - value: "1" + value: 1 - name: SOKETI_DEFAULT_APP_KEY value: keepappkey - name: SOKETI_DEFAULT_APP_SECRET value: keepappsecret - - name: HOSTNAME - value: "0.0.0.0" - - name: PORT - value: "6001" replicaCount: 1 image: repository: quay.io/soketi/soketi From cc412323a5d2288456d6695a150028f6538e8f69 Mon Sep 17 00:00:00 2001 From: shahargl Date: Wed, 9 Oct 2024 16:20:22 +0300 Subject: [PATCH 3/4] feat: return db --- charts/keep/values.yaml | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index 38c56ce..dedee8a 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -242,3 +242,52 @@ websocket: port: 6001 initialDelaySeconds: 30 periodSeconds: 10 + +database: + enabled: true + replicaCount: 1 + pv: + enabled: true + size: 5Gi + storageClass: "" + pvc: + enabled: true + size: 5Gi + storageClass: "" + image: + repository: mysql + pullPolicy: IfNotPresent + tag: "latest" + env: + - name: MYSQL_ALLOW_EMPTY_PASSWORD + value: yes + - name: MYSQL_DATABASE + value: keep + - name: MYSQL_PASSWORD + value: null + imagePullSecrets: [] + podAnnotations: {} + podSecurityContext: {} + securityContext: {} + service: + type: ClusterIP + port: 3306 + resources: {} + autoscaling: + enabled: false + 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 49457bcbf08734be9a98c599bc9ff770ad9b3889 Mon Sep 17 00:00:00 2001 From: shahargl Date: Wed, 9 Oct 2024 16:23:26 +0300 Subject: [PATCH 4/4] feat: return db --- charts/keep/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index dedee8a..d11e5df 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -290,4 +290,4 @@ database: tcpSocket: port: 3306 extraVolumeMounts: [] - extraVolumes: [] \ No newline at end of file + extraVolumes: []