feat!: ports are now referenced by name

- Closes #919
This commit is contained in:
Michael Kriese 2025-01-16 11:15:16 +01:00
parent 4bfbb48dd3
commit b3d1068082
No known key found for this signature in database
GPG key ID: F8D7748549A5986A
5 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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