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 <lucas.hahn@novum-rgi.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/167
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: luhahn <luhahn@noreply.gitea.io>
Co-committed-by: luhahn <luhahn@noreply.gitea.io>
This commit is contained in:
luhahn 2021-06-08 01:53:01 +08:00 committed by techknowlogick
parent 441f0748e9
commit 178bc0ab79
3 changed files with 41 additions and 2 deletions

View File

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

View File

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

View File

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