From 6896c7caaeb236312dd4976dc0e12f148e842158 Mon Sep 17 00:00:00 2001 From: a-zen Date: Fri, 25 Feb 2022 17:18:57 +0800 Subject: [PATCH] added hostPort support for ssh (#276) This fixes my feature request (#275) to support hostPort to expose the ssh port. Co-authored-by: alex Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/276 Reviewed-by: luhahn Reviewed-by: justusbunsi Co-authored-by: a-zen Co-committed-by: a-zen --- README.md | 1 + templates/gitea/statefulset.yaml | 3 +++ values.yaml | 1 + 3 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 303679b..a6be3c2 100644 --- a/README.md +++ b/README.md @@ -752,6 +752,7 @@ gitea: | `service.ssh.port` | Port for ssh traffic | `22` | | `service.ssh.loadBalancerIP` | LoadBalancer Ip setting | | | `service.ssh.nodePort` | NodePort for ssh service | | +| `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.loadBalancerSourceRanges` | Source range filter for ssh loadbalancer | `[]` | diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index b0385b4..d96ad34 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -228,6 +228,9 @@ spec: ports: - name: ssh containerPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }} + {{- if .Values.service.ssh.hostPort }} + hostPort: {{ .Values.service.ssh.hostPort }} + {{- end }} - name: http containerPort: {{ .Values.gitea.config.server.HTTP_PORT }} {{- if .Values.gitea.config.server.ENABLE_PPROF }} diff --git a/values.yaml b/values.yaml index 81adcf3..a4487d6 100644 --- a/values.yaml +++ b/values.yaml @@ -60,6 +60,7 @@ service: #nodePort: #externalTrafficPolicy: #externalIPs: + #hostPort: loadBalancerSourceRanges: [] annotations: