From db242ac7f69859d9e41328ad702d1615127e11af Mon Sep 17 00:00:00 2001 From: WrenIX Date: Sun, 19 Jan 2025 23:55:11 +0100 Subject: [PATCH] fix(autopush): add router of autoconnect to service --- autopush/Chart.yaml | 2 +- autopush/README.md | 7 ++++--- autopush/templates/autoconnect/deployment.yaml | 2 +- autopush/templates/autoconnect/service.yaml | 6 +++++- autopush/templates/secret.yaml | 1 + autopush/values.yaml | 4 +++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/autopush/Chart.yaml b/autopush/Chart.yaml index 828f7a1..0d77753 100644 --- a/autopush/Chart.yaml +++ b/autopush/Chart.yaml @@ -3,7 +3,7 @@ name: autopush description: A Helm chart for Kubernetes icon: type: application -version: 0.0.7 +version: 0.0.8 # renovate: image=docker.io/mozilla-services/autopush-rs appVersion: "1.72.2" maintainers: diff --git a/autopush/README.md b/autopush/README.md index 6100cf5..8c6eb95 100644 --- a/autopush/README.md +++ b/autopush/README.md @@ -7,7 +7,7 @@ description: "A Helm chart for Kubernetes" # autopush -![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.72.2](https://img.shields.io/badge/AppVersion-1.72.2-informational?style=flat-square) +![Version: 0.0.8](https://img.shields.io/badge/Version-0.0.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.72.2](https://img.shields.io/badge/AppVersion-1.72.2-informational?style=flat-square) A Helm chart for Kubernetes @@ -78,7 +78,8 @@ helm uninstall autopush-release | autoconnect.replicaCount | int | `1` | This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ | | autoconnect.resources | object | `{}` | We usually recommend not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, uncomment the following lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi | | autoconnect.securityContext | object | `{}` | securityContext capabilities: drop: - ALL readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 | -| autoconnect.service.port | int | `80` | | +| autoconnect.service.ports.http | int | `80` | | +| autoconnect.service.ports.router | int | `8081` | | | autoconnect.service.type | string | `"ClusterIP"` | | | autoconnect.tolerations | list | `[]` | | | autoconnect.volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. - name: foo mountPath: "/etc/foo" readOnly: true | @@ -137,8 +138,8 @@ helm uninstall autopush-release | prometheus.volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. - name: foo mountPath: "/etc/foo" readOnly: true | | redis.architecture | string | `"standalone"` | | | redis.auth.enabled | bool | `true` | | -| redis.auth.existingSecret | string | `""` | name of an existing secret with Redis credentials (instead of auth.password), must be created ahead of time | | redis.auth.existingSecret | string | `nil` | Or use existing secret with "redis-password" key instead of static password | +| redis.auth.existingSecret | string | `""` | name of an existing secret with Redis credentials (instead of auth.password), must be created ahead of time | | redis.auth.existingSecretPasswordKey | string | `""` | Password key to be retrieved from existing secret | | redis.auth.password | string | `"autopush"` | XXX Change me! | | redis.dbid | int | `0` | Database ID for non-default database | diff --git a/autopush/templates/autoconnect/deployment.yaml b/autopush/templates/autoconnect/deployment.yaml index 0f1f3bb..de027ec 100644 --- a/autopush/templates/autoconnect/deployment.yaml +++ b/autopush/templates/autoconnect/deployment.yaml @@ -59,7 +59,7 @@ spec: containerPort: 8080 protocol: TCP - name: router - containerPort: 8081 + containerPort: {{ .service.ports.router }} protocol: TCP livenessProbe: {{- toYaml .livenessProbe | nindent 12 }} diff --git a/autopush/templates/autoconnect/service.yaml b/autopush/templates/autoconnect/service.yaml index 2a54f55..5f12030 100644 --- a/autopush/templates/autoconnect/service.yaml +++ b/autopush/templates/autoconnect/service.yaml @@ -10,10 +10,14 @@ spec: {{- include "autopush.selectorLabels" . | nindent 4 }} app.kubernetes.io/component: autoconnect ports: - - port: {{ .Values.autoconnect.service.port }} + - port: {{ .Values.autoconnect.service.ports.http }} targetPort: http protocol: TCP name: http + - port: {{ .Values.autoconnect.service.ports.router }} + targetPort: router + protocol: TCP + name: router {{- if .Values.prometheus.enabled }} - port: 9100 targetPort: metrics diff --git a/autopush/templates/secret.yaml b/autopush/templates/secret.yaml index 54d5f0f..bb84a35 100644 --- a/autopush/templates/secret.yaml +++ b/autopush/templates/secret.yaml @@ -33,6 +33,7 @@ data: {{- end }} AUTOCONNECT__ENDPOINT_HOSTNAME: {{ printf "updates.%s" .Values.ingress.host | b64enc }} AUTOCONNECT__ROUTER_HOSTNAME: {{ printf "%s-autoconnect" (include "autopush.fullname" .) | b64enc }} + AUTOCONNECT__ROUTER_PORT: {{ toYaml .Values.autoconnect.service.ports.router | b64enc }} {{- if .Values.prometheus.enabled }} AUTOCONNECT__STATSD_HOST: {{ "127.0.0.1" | b64enc}} AUTOCONNECT__STATSD_PORT: {{ "9125" | b64enc }} diff --git a/autopush/values.yaml b/autopush/values.yaml index 2a51115..bb4504b 100644 --- a/autopush/values.yaml +++ b/autopush/values.yaml @@ -164,7 +164,9 @@ autoconnect: # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types type: ClusterIP # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports - port: 80 + ports: + http: 80 + router: 8081 # -- We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little