fix(matrix-authentication-service): port mapping

This commit is contained in:
WrenIX 2024-06-05 17:40:38 +02:00
parent 5cb8591591
commit b9378468f3
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
8 changed files with 21 additions and 12 deletions

View file

@ -4,7 +4,7 @@ name: matrix-authentication-service
description: OAuth2.0 + OpenID Provider for Matrix Homeservers (per MSC3861) description: OAuth2.0 + OpenID Provider for Matrix Homeservers (per MSC3861)
icon: https://matrix.org/images/matrix-logo.svg icon: https://matrix.org/images/matrix-logo.svg
type: application type: application
version: 0.0.3 version: 0.0.4
# renovate: image=ghcr.io/matrix-org/matrix-authentication-service # renovate: image=ghcr.io/matrix-org/matrix-authentication-service
appVersion: "0.9.0" appVersion: "0.9.0"
maintainers: maintainers:

View file

@ -2,7 +2,7 @@
= matrix-authentication-service = 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/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] image::https://img.shields.io/badge/AppVersion-0.9.0-informational?style=flat-square[AppVersion: 0.9.0]
== Maintainers == Maintainers
@ -612,9 +612,14 @@ helm uninstall matrix-authentication-service-release
| `1000` | `1000`
| |
| service.port | service.port.http
| int | int
| `80` | `8080`
|
| service.port.metrics
| int
| `9100`
| |
| service.type | service.type

View file

@ -13,7 +13,7 @@
NOTE: It may take a few minutes for the LoadBalancer IP to be available. 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" . }}' 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 }}"}}") 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 }} {{- 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 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}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")

View file

@ -93,14 +93,16 @@ spec:
value: "/etc/mas-config.yaml" value: "/etc/mas-config.yaml"
ports: ports:
- name: http - name: http
containerPort: 8080 containerPort: {{ .Values.service.port.http }}
protocol: TCP protocol: TCP
- name: internal - name: internal
containerPort: 8081 containerPort: 8081
protocol: TCP protocol: TCP
{{- with .Values.service.port.metrics }}
- name: metrics - name: metrics
containerPort: 9100 containerPort: {{ . }}
protocol: TCP protocol: TCP
{{- end }}
livenessProbe: livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }} {{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe: readinessProbe:

View file

@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "matrix-authentication-service.fullname" . -}} {{- $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 and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}

View file

@ -11,9 +11,9 @@ spec:
ports: ports:
- name: http - name: http
protocol: TCP protocol: TCP
port: {{ .Values.service.port }} port: {{ .Values.service.port.http }}
targetPort: http targetPort: http
{{- with .Values.config.metrics }} {{- with .Values.service.port.metrics }}
- name: metrics - name: metrics
protocol: TCP protocol: TCP
port: {{ . }} port: {{ . }}

View file

@ -11,5 +11,5 @@ spec:
- name: wget - name: wget
image: busybox image: busybox
command: ['wget'] command: ['wget']
args: ['{{ include "matrix-authentication-service.fullname" . }}:{{ .Values.service.port }}'] args: ['{{ include "matrix-authentication-service.fullname" . }}:{{ .Values.service.port.http }}']
restartPolicy: Never restartPolicy: Never

View file

@ -146,7 +146,9 @@ securityContext:
service: service:
type: ClusterIP type: ClusterIP
port: 80 port:
http: 8080
metrics: 9100
ingress: ingress:
enabled: false enabled: false