From bc16cc81348aaa6fd3b70cddf7c240abb826f90a Mon Sep 17 00:00:00 2001 From: dek Date: Mon, 27 Jun 2022 14:35:55 +0800 Subject: [PATCH] add dnsConfig value support (#329) Description of the change Add support for a new value: dnsConfig, to be passed to the statefulset pod template configuration. Default is {}, and does not change anything from current default pod configuration. Benefits Ability to fix some issues encountered with Alpine-based docker images, which may break DNS resolving on some clusters. In particular, this allows to lower the ndots value, which fixes DNS resolving of FQDNs. dnsConfig: options: - name: ndots value: "1" Also, with this setting, one can set other parameters to finely tune DNS configuration for Gitea pods, if needed: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config Possible drawbacks None. Additional information Some relevant links about the issue this setting allows to fix: https://stackoverflow.com/questions/65181012/does-alpine-have-known-dns-issue-within-kubernetes https://gitlab.alpinelinux.org/alpine/aports/-/issues/9017 Checklist Parameters are documented in the values.yaml and added to the README.md using readme-generator-for-helm Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/329 Reviewed-by: justusbunsi Reviewed-by: luhahn Co-authored-by: dek Co-committed-by: dek --- README.md | 1 + templates/gitea/statefulset.yaml | 4 ++++ values.yaml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 0530574..f476e73 100644 --- a/README.md +++ b/README.md @@ -807,6 +807,7 @@ gitea: | `nodeSelector` | NodeSelector for the statefulset | `{}` | | `tolerations` | Tolerations for the statefulset | `[]` | | `affinity` | Affinity for the statefulset | `{}` | +| `dnsConfig` | dnsConfig for the statefulset | `{}` | | `statefulset.env` | Additional environment variables to pass to containers | `[]` | | `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` | | `statefulset.labels` | Labels for the statefulset | `{}` | diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index 742abd8..bb2b42c 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -287,6 +287,10 @@ spec: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.dnsConfig }} + dnsConfig: + {{- toYaml .Values.dnsConfig | nindent 8 }} {{- end }} volumes: - name: init diff --git a/values.yaml b/values.yaml index 92fcd5b..3589506 100644 --- a/values.yaml +++ b/values.yaml @@ -180,6 +180,9 @@ tolerations: [] ## @param affinity Affinity for the statefulset affinity: {} +## @param dnsConfig dnsConfig for the statefulset +dnsConfig: {} + ## @param statefulset.env Additional environment variables to pass to containers ## @param statefulset.terminationGracePeriodSeconds How long to wait until forcefully kill the pod ## @param statefulset.labels Labels for the statefulset