From 178bc0ab79d477b0d956027f1ecb67af1ac49f46 Mon Sep 17 00:00:00 2001 From: luhahn Date: Tue, 8 Jun 2021 01:53:01 +0800 Subject: [PATCH] Improve http service and update Readme (#167) This PR adds some options for the http service: - loadBalancerIP - nodePort - externalTrafficPolicy - externalIPs Also updated the README and values.yml with the values. Added storageClass explanation in README and empty value in values.yml Fixes: #162 Co-authored-by: Lucas Hahn Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/167 Reviewed-by: techknowlogick Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: luhahn Co-committed-by: luhahn --- README.md | 26 ++++++++++++++++++++++++-- templates/gitea/http-svc.yaml | 13 +++++++++++++ values.yaml | 4 ++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 541e343..fb1deeb 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,17 @@ If the built in cache should not be used simply configure the cache in gitea.con Gitea will be deployed as a statefulset. By simply enabling the persistence and setting the storage class according to your cluster everything else will be taken care of. The following example will create a PVC as a part of the statefulset. This PVC will not be deleted even if you uninstall the chart. +Please note, that an empty storageClass in the persistence will result in kubernetes using your default storage class. + +If you want to use your own storageClass define it as followed: + +```yaml +persistence: + enabled: true + storageClass: myOwnStorageClass + +``` + When using Postgresql as dependency, this will also be deployed as a statefulset by default. If you want to manage your own PVC you can simply pass the PVC name to the chart. @@ -414,11 +425,22 @@ Annotations can be added to the Gitea pod. |---------------------|-----------------------------------|------------------------------| |service.http.type| Kubernetes service type for web traffic | ClusterIP | |service.http.port| Port for web traffic | 3000 | +|service.http.clusterIP| ClusterIP setting for http autosetup for statefulset is None | None | +|service.http.loadBalancerIP| LoadBalancer Ip setting | | +|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 | 3000 | +|service.http.loadBalancerSourceRanges| Source range filter for http loadbalancer | [] | +|service.http.annotations| http service annotations | | + |service.ssh.type| Kubernetes service type for ssh traffic | ClusterIP | |service.ssh.port| Port for ssh traffic | 22 | +|service.ssh.loadBalancerIP| LoadBalancer Ip setting | | +|service.ssh.nodePort| NodePort 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.annotations| Additional ssh annotations for the ssh service || +|service.ssh.externalIPs| ssh service external IP addresses | 3000 | +|service.ssh.loadBalancerSourceRanges| Source range filter for ssh loadbalancer | [] | +|service.ssh.annotations| ssh service annotations | | ### Gitea Configuration diff --git a/templates/gitea/http-svc.yaml b/templates/gitea/http-svc.yaml index 20c0de6..ed3aa8a 100644 --- a/templates/gitea/http-svc.yaml +++ b/templates/gitea/http-svc.yaml @@ -11,6 +11,19 @@ spec: {{- if and .Values.service.http.loadBalancerIP (eq .Values.service.http.type "LoadBalancer") }} loadBalancerIP: {{ .Values.service.http.loadBalancerIP }} {{- end }} + {{- if .Values.service.http.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range .Values.service.http.loadBalancerSourceRanges }} + - {{ . }} + {{- end }} + {{- end }} + {{- if .Values.service.http.externalIPs }} + externalIPs: + {{- toYaml .Values.service.http.externalIPs | nindent 4 }} + {{- end }} + {{- if .Values.service.http.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.http.externalTrafficPolicy }} + {{- end }} {{- if and .Values.service.http.clusterIP (eq .Values.service.http.type "ClusterIP") }} clusterIP: {{ .Values.service.http.clusterIP }} {{- end }} diff --git a/values.yaml b/values.yaml index e1a2526..6ea4b7e 100644 --- a/values.yaml +++ b/values.yaml @@ -33,6 +33,9 @@ service: clusterIP: None #loadBalancerIP: #nodePort: + #externalTrafficPolicy: + #externalIPs: + loadBalancerSourceRanges: [] annotations: ssh: type: ClusterIP @@ -95,6 +98,7 @@ persistence: - ReadWriteOnce labels: {} annotations: {} + # storageClass: # additional volumes to add to the Gitea statefulset. extraVolumes: