Skip to content

Commit

Permalink
feat: websocket ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl committed Oct 9, 2024
1 parent 57190a8 commit 138559a
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 55 deletions.
2 changes: 1 addition & 1 deletion charts/keep/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
64 changes: 64 additions & 0 deletions charts/keep/templates/websocket-ingress.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
20 changes: 20 additions & 0 deletions charts/keep/templates/websocket-route.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
85 changes: 31 additions & 54 deletions charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 138559a

Please sign in to comment.