From d9e01480feed61716a19e641fc88d7333be5e6f7 Mon Sep 17 00:00:00 2001 From: Guilherme Sautner Date: Mon, 16 Oct 2023 09:16:34 -0300 Subject: [PATCH] #18 Ingress/Service for WS on new Cryptpad version - Added new service port/and ingress path to support new version of Cryptpad (5.4.1 and 5.5.0). --- charts/cryptpad/Chart.yaml | 2 +- charts/cryptpad/templates/cryptpad.yaml | 7 +++++-- charts/cryptpad/templates/ingress.yaml | 14 ++++++++++---- charts/cryptpad/templates/service.yaml | 4 ++++ charts/cryptpad/values.yaml | 10 ++++++---- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/charts/cryptpad/Chart.yaml b/charts/cryptpad/Chart.yaml index 641afff..209e828 100644 --- a/charts/cryptpad/Chart.yaml +++ b/charts/cryptpad/Chart.yaml @@ -21,7 +21,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.10 +version: 0.0.11 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/cryptpad/templates/cryptpad.yaml b/charts/cryptpad/templates/cryptpad.yaml index c879f4f..3ec9f93 100644 --- a/charts/cryptpad/templates/cryptpad.yaml +++ b/charts/cryptpad/templates/cryptpad.yaml @@ -112,8 +112,11 @@ spec: value: "{{ .Values.http2Disable }}" {{- end }} ports: - - name: http - containerPort: 3000 + - name: {{ .Values.service.internalPort }} + containerPort: {{ .Values.service.containerPort }} + protocol: TCP + - name: {{ .Values.service.websocket.internalPort }} + containerPort: {{ .Values.service.websocket.containerPort }} protocol: TCP livenessProbe: httpGet: diff --git a/charts/cryptpad/templates/ingress.yaml b/charts/cryptpad/templates/ingress.yaml index 5d5dca4..dd07365 100644 --- a/charts/cryptpad/templates/ingress.yaml +++ b/charts/cryptpad/templates/ingress.yaml @@ -1,6 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "cryptpad-helm.fullname" . -}} {{- $svcPort := .Values.service.externalPort -}} +{{- $svcWsPort := .Values.service.websocket.externalPort -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -30,14 +31,19 @@ spec: - host: {{ .host | quote }} http: paths: - {{- range .paths }} - - path: {{ .path }} - pathType: {{ .pathType }} + - path: / + pathType: ImplementationSpecific backend: service: name: {{ $fullName }} port: number: {{ $svcPort }} - {{- end }} + - path: /cryptpad_websocket + pathType: ImplementationSpecific + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcWsPort }} {{- end }} {{- end }} diff --git a/charts/cryptpad/templates/service.yaml b/charts/cryptpad/templates/service.yaml index 77219fe..b8f654a 100644 --- a/charts/cryptpad/templates/service.yaml +++ b/charts/cryptpad/templates/service.yaml @@ -17,6 +17,10 @@ spec: targetPort: {{ .Values.service.internalPort }} protocol: TCP name: {{ .Values.service.name }} + - port: {{ .Values.service.websocket.externalPort }} + targetPort: {{ .Values.service.websocket.internalPort }} + protocol: TCP + name: {{ .Values.service.websocket.internalPort }} sessionAffinity: {{ .Values.service.sessionAffinity }} selector: {{- include "cryptpad-helm.selectorLabels" . | nindent 4 }} diff --git a/charts/cryptpad/values.yaml b/charts/cryptpad/values.yaml index 5b76bb9..44acf45 100644 --- a/charts/cryptpad/values.yaml +++ b/charts/cryptpad/values.yaml @@ -12,7 +12,7 @@ workloadStateful: true image: pullPolicy: IfNotPresent repository: cryptpad/cryptpad - tag: "version-5.4.0" + tag: "version-5.5.0" # repository: git.xwikisas.com:5050/xwiki-cloud-infrastructure/docker-images/cryptpad # tag: "latest" @@ -155,6 +155,11 @@ service: type: ClusterIP externalPort: 80 internalPort: http + containerPort: 3000 + websocket: + externalPort: 83 + internalPort: ws + containerPort: 3003 # Set an array of externalIPs for the service externalIPs: [] # - 10.20.30.40 @@ -172,9 +177,6 @@ ingress: # kubernetes.io/tls-acme: "true" hosts: - host: localhost - paths: - - path: / - pathType: ImplementationSpecific tls: [] # - secretName: secret-tls