Closed gregwalters closed 8 months ago
Hi Greg,
Thank you for your PR. I would actually prefer a more general option using the dnsConfig
section in values.yaml
. Your solution overrides the default DNS configuration in a cluster (I'm aware that ndots=5 is a default value, but the administrator might have globally changed it). Therefore, by default, the helm chart should respect the cluster's default DNS configuration and not be forced to value 5.
I hope you understand what I think to do.
# Pod's DNS Configuration
# https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
# This value is useful if you need to reduce the DNS load: set "ndots" to 0 and only use FQDNs.
dnsConfig: {}
# nameservers:
# - 1.2.3.4
# searches:
# - ns1.svc.cluster-domain.example
# - my.dns.search.suffix
# options:
# - name: ndots
# value: "2"
and in your statefulset.yaml something like this:
spec:
{{- if .Values.dnsConfig }}
dnsConfig: {{- toYaml .Values.dnsConfig | nindent 8 }}
{{- end }}
Regards Pavel
Pavel,
Your solution is much cleaner 👏 . Implemented as suggested!
Hi Greg, thank you for update, please check the location of your changes, I think it should be here:
apiVersion: apps/v1
kind: StatefulSet
spec:
template:
spec:
{{- if .Values.dnsConfig }}
dnsConfig:
{{- toYaml .Values.dnsConfig | nindent 8 }}
{{- end }}
:shame:
You're right again. I had that at the wrong level. Fixed.
thank you
I have problems with Alpine / Musl's DNS resolution and need to adjust ndots for compatibility. Lots of community discussion about this out there.