diff --git a/README.md b/README.md index 9346ccd..2c2b5b4 100644 --- a/README.md +++ b/README.md @@ -1228,6 +1228,7 @@ Forgejo v9 is now EOL. ClusterIP is now emtpy instead of `None` for http and ssh service. Unsupported api versions for `Ingress` and `PodDisruptionBudget` are removed. +`Ingress` and `Service` are now using named ports. ### To v10 diff --git a/templates/gitea/http-svc.yaml b/templates/gitea/http-svc.yaml index e0f9bfa..6962930 100644 --- a/templates/gitea/http-svc.yaml +++ b/templates/gitea/http-svc.yaml @@ -49,6 +49,6 @@ spec: {{- if .Values.service.http.nodePort }} nodePort: {{ .Values.service.http.nodePort }} {{- end }} - targetPort: {{ .Values.gitea.config.server.HTTP_PORT }} + targetPort: http selector: {{- include "gitea.selectorLabels" . | nindent 4 }} diff --git a/templates/gitea/ingress.yaml b/templates/gitea/ingress.yaml index fea418e..02cb725 100644 --- a/templates/gitea/ingress.yaml +++ b/templates/gitea/ingress.yaml @@ -1,6 +1,5 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "gitea.fullname" . -}} -{{- $httpPort := .Values.service.http.port -}} apiVersion: networking.k8s.io/v1/Ingress kind: Ingress metadata: @@ -40,7 +39,7 @@ spec: service: name: {{ $fullName }}-http port: - number: {{ $httpPort }} + name: http {{- end }} {{- end }} {{- end }} diff --git a/templates/gitea/ssh-svc.yaml b/templates/gitea/ssh-svc.yaml index bbabe24..c1576da 100644 --- a/templates/gitea/ssh-svc.yaml +++ b/templates/gitea/ssh-svc.yaml @@ -47,7 +47,7 @@ spec: - name: ssh port: {{ .Values.service.ssh.port }} {{- if .Values.gitea.config.server.SSH_LISTEN_PORT }} - targetPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }} + targetPort: ssh {{- end }} protocol: TCP {{- if .Values.service.ssh.nodePort }} diff --git a/unittests/deployment/svc-configuration.yaml b/unittests/deployment/svc-configuration.yaml index ee3d6a6..f39bb1b 100644 --- a/unittests/deployment/svc-configuration.yaml +++ b/unittests/deployment/svc-configuration.yaml @@ -58,7 +58,7 @@ tests: value: 22 - equal: path: spec.ports[0].targetPort - value: 2222 + value: ssh - it: render service.ssh.loadBalancerClass if set and type is LoadBalancer template: templates/gitea/ssh-svc.yaml