From 52ed32ae749bce53b20387642ec2b6f6e7857ef6 Mon Sep 17 00:00:00 2001 From: svenihoney Date: Mon, 25 Apr 2022 19:56:25 +0800 Subject: [PATCH] Allow configuration of ipFamilyPolicy and ipFamilies (#313) To enable access to e.g. the SSH port by IPv6, the selection of ipFamilyPolicy and ipFamilies service attributes is necessary. Enable the possibility to configure these by helm values. Co-authored-by: Sven Fischer Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/313 Reviewed-by: justusbunsi Reviewed-by: luhahn Co-authored-by: svenihoney Co-committed-by: svenihoney --- README.md | 8 ++++++++ templates/gitea/http-svc.yaml | 7 +++++++ templates/gitea/ssh-svc.yaml | 7 +++++++ values.yaml | 4 ++++ 4 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 9ce59f3..fc1d207 100644 --- a/README.md +++ b/README.md @@ -776,9 +776,13 @@ gitea: | `service.http.nodePort` | NodePort for http service | | | `service.http.externalTrafficPolicy` | If `service.http.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation | | | `service.http.externalIPs` | http service external IP addresses | | +| `service.http.ipFamilyPolicy` | http service dual-stack policy | | +| `service.http.ipFamilies` | http service dual-stack familiy selection | | | `service.http.loadBalancerSourceRanges` | Source range filter for http loadbalancer | `[]` | | `service.http.annotations` | http service annotations | | +For dual-stack parameters see official kubernetes [dual-stack concept documentation](https://kubernetes.io/docs/concepts/services-networking/dual-stack/). + #### SSH | Parameter | Description | Default | @@ -790,9 +794,13 @@ gitea: | `service.ssh.hostPort` | HostPort for ssh service | | | `service.ssh.externalTrafficPolicy` | If `service.ssh.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation | | | `service.ssh.externalIPs` | ssh service external IP addresses | | +| `service.ssh.ipFamilyPolicy` | ssh service dual-stack policy | | +| `service.ssh.ipFamilies` | ssh service dual-stack familiy selection | | | `service.ssh.loadBalancerSourceRanges` | Source range filter for ssh loadbalancer | `[]` | | `service.ssh.annotations` | ssh service annotations | | +For dual-stack parameters see official kubernetes [dual-stack concept documentation](https://kubernetes.io/docs/concepts/services-networking/dual-stack/). + ### Gitea Configuration | Parameter | Description | Default | diff --git a/templates/gitea/http-svc.yaml b/templates/gitea/http-svc.yaml index ed3aa8a..659724c 100644 --- a/templates/gitea/http-svc.yaml +++ b/templates/gitea/http-svc.yaml @@ -21,6 +21,13 @@ spec: externalIPs: {{- toYaml .Values.service.http.externalIPs | nindent 4 }} {{- end }} + {{- if .Values.service.http.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.service.http.ipFamilyPolicy }} + {{- end }} + {{- with .Values.service.http.ipFamilies }} + ipFamilies: + {{- toYaml . | nindent 4 }} + {{- end -}} {{- if .Values.service.http.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.service.http.externalTrafficPolicy }} {{- end }} diff --git a/templates/gitea/ssh-svc.yaml b/templates/gitea/ssh-svc.yaml index e81cada..620f624 100644 --- a/templates/gitea/ssh-svc.yaml +++ b/templates/gitea/ssh-svc.yaml @@ -26,6 +26,13 @@ spec: externalIPs: {{- toYaml .Values.service.ssh.externalIPs | nindent 4 }} {{- end }} + {{- if .Values.service.ssh.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.service.ssh.ipFamilyPolicy }} + {{- end }} + {{- with .Values.service.ssh.ipFamilies }} + ipFamilies: + {{- toYaml . | nindent 4 }} + {{- end -}} {{- if .Values.service.ssh.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.service.ssh.externalTrafficPolicy }} {{- end }} diff --git a/values.yaml b/values.yaml index f2fd36f..b6e6fbc 100644 --- a/values.yaml +++ b/values.yaml @@ -51,6 +51,8 @@ service: #nodePort: #externalTrafficPolicy: #externalIPs: + #ipFamilyPolicy: + #ipFamilies: loadBalancerSourceRanges: [] annotations: ssh: @@ -61,6 +63,8 @@ service: #nodePort: #externalTrafficPolicy: #externalIPs: + #ipFamilyPolicy: + #ipFamilies: #hostPort: loadBalancerSourceRanges: [] annotations: