From b9378468f3ad940608f24fff190718359f1e1838 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Wed, 5 Jun 2024 17:40:38 +0200 Subject: [PATCH] fix(matrix-authentication-service): port mapping --- matrix-authentication-service/Chart.yaml | 2 +- matrix-authentication-service/README.adoc | 11 ++++++++--- matrix-authentication-service/templates/NOTES.txt | 2 +- .../templates/deployment.yaml | 6 ++++-- matrix-authentication-service/templates/ingress.yaml | 2 +- matrix-authentication-service/templates/service.yaml | 4 ++-- .../templates/tests/test-connection.yaml | 2 +- matrix-authentication-service/values.yaml | 4 +++- 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/matrix-authentication-service/Chart.yaml b/matrix-authentication-service/Chart.yaml index 69d3cb1..84de472 100644 --- a/matrix-authentication-service/Chart.yaml +++ b/matrix-authentication-service/Chart.yaml @@ -4,7 +4,7 @@ name: matrix-authentication-service description: OAuth2.0 + OpenID Provider for Matrix Homeservers (per MSC3861) icon: https://matrix.org/images/matrix-logo.svg type: application -version: 0.0.3 +version: 0.0.4 # renovate: image=ghcr.io/matrix-org/matrix-authentication-service appVersion: "0.9.0" maintainers: diff --git a/matrix-authentication-service/README.adoc b/matrix-authentication-service/README.adoc index f341bfd..7d5742c 100644 --- a/matrix-authentication-service/README.adoc +++ b/matrix-authentication-service/README.adoc @@ -2,7 +2,7 @@ = matrix-authentication-service -image::https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square[Version: 0.0.3] +image::https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square[Version: 0.0.4] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] image::https://img.shields.io/badge/AppVersion-0.9.0-informational?style=flat-square[AppVersion: 0.9.0] == Maintainers @@ -612,9 +612,14 @@ helm uninstall matrix-authentication-service-release | `1000` | -| service.port +| service.port.http | int -| `80` +| `8080` +| + +| service.port.metrics +| int +| `9100` | | service.type diff --git a/matrix-authentication-service/templates/NOTES.txt b/matrix-authentication-service/templates/NOTES.txt index eb6d3bb..c536676 100644 --- a/matrix-authentication-service/templates/NOTES.txt +++ b/matrix-authentication-service/templates/NOTES.txt @@ -13,7 +13,7 @@ NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "matrix-authentication-service.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "matrix-authentication-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} + echo http://$SERVICE_IP:{{ .Values.service.port.http }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "matrix-authentication-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") diff --git a/matrix-authentication-service/templates/deployment.yaml b/matrix-authentication-service/templates/deployment.yaml index 7098849..20e6035 100644 --- a/matrix-authentication-service/templates/deployment.yaml +++ b/matrix-authentication-service/templates/deployment.yaml @@ -93,14 +93,16 @@ spec: value: "/etc/mas-config.yaml" ports: - name: http - containerPort: 8080 + containerPort: {{ .Values.service.port.http }} protocol: TCP - name: internal containerPort: 8081 protocol: TCP + {{- with .Values.service.port.metrics }} - name: metrics - containerPort: 9100 + containerPort: {{ . }} protocol: TCP + {{- end }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: diff --git a/matrix-authentication-service/templates/ingress.yaml b/matrix-authentication-service/templates/ingress.yaml index f8449a6..fc4c84f 100644 --- a/matrix-authentication-service/templates/ingress.yaml +++ b/matrix-authentication-service/templates/ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "matrix-authentication-service.fullname" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.service.port.http -}} {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} diff --git a/matrix-authentication-service/templates/service.yaml b/matrix-authentication-service/templates/service.yaml index fa006ca..5734b7e 100644 --- a/matrix-authentication-service/templates/service.yaml +++ b/matrix-authentication-service/templates/service.yaml @@ -11,9 +11,9 @@ spec: ports: - name: http protocol: TCP - port: {{ .Values.service.port }} + port: {{ .Values.service.port.http }} targetPort: http - {{- with .Values.config.metrics }} + {{- with .Values.service.port.metrics }} - name: metrics protocol: TCP port: {{ . }} diff --git a/matrix-authentication-service/templates/tests/test-connection.yaml b/matrix-authentication-service/templates/tests/test-connection.yaml index 97fdcb4..593372a 100644 --- a/matrix-authentication-service/templates/tests/test-connection.yaml +++ b/matrix-authentication-service/templates/tests/test-connection.yaml @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "matrix-authentication-service.fullname" . }}:{{ .Values.service.port }}'] + args: ['{{ include "matrix-authentication-service.fullname" . }}:{{ .Values.service.port.http }}'] restartPolicy: Never diff --git a/matrix-authentication-service/values.yaml b/matrix-authentication-service/values.yaml index 5e4a19c..1924585 100644 --- a/matrix-authentication-service/values.yaml +++ b/matrix-authentication-service/values.yaml @@ -146,7 +146,9 @@ securityContext: service: type: ClusterIP - port: 80 + port: + http: 8080 + metrics: 9100 ingress: enabled: false