Open Issen007 opened 2 years ago
To just confirm that the init container get the ndots:5
setting
kubectl exec -it jenkins-0 -c init -- cat /etc/resolv.conf
search jenkins.svc.cluster.local svc.cluster.local cluster.local isstech.local lan
nameserver 10.43.0.10
options ndots:5
To just update this case a little bit. I think we can rename this to enhancement or add tag enhancement to this case.
btw, I'm deploying the helm chart version jenkins-3.9.1
.
But I have found a "workaround".
Deploying Jenkins using helm as normal.
Dumping out Statefulset to a yaml file kubectl get statefulset jenkins -o yaml > <somefile>.yaml
Adding following line just behind dnsPolicy
dnsPolicy: ClusterFirst
dnsConfig:
options:
- name: ndots
value: "1"
Now do I delete the Crashed Container.
kubectl delete pod <jenkins podname>
Now it is working as expected.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.
To just update this case a little bit. I think we can rename this to enhancement or add tag enhancement to this case. btw, I'm deploying the helm chart version
jenkins-3.9.1
.But I have found a "workaround". Deploying Jenkins using helm as normal. Dumping out Statefulset to a yaml file
kubectl get statefulset jenkins -o yaml > <somefile>.yaml
Adding following line just behind
dnsPolicy
dnsPolicy: ClusterFirst dnsConfig: options: - name: ndots value: "1"
Now do I delete the Crashed Container.
kubectl delete pod <jenkins podname>
Now it is working as expected.
To automate this, you can simply create patch.yaml
template:
spec:
dnsConfig:
options:
- name: ndots
value: "1"
and then run 'helm install jenkins jenkins/jenkins -f values.yaml -n jenkins && kubectl patch statefulset jenkins --patch-file patch.yaml && kubectl rollout restart statefulset jenkins && kubectl delete pod jenkins-0'
Describe the bug When I deploy Jenkins via Helm on a Rancher Kubernetes cluster or a cluster who have a CoreDNS installed, I got following issue when the init containers start.
This ends up that the init container can't resolve the
updates.jenkins.io
because the/etc/resolv.conf
probably haveoptions ndots:5
part of the installation that kubernetes added to the deployment. We can also see this in the CoreDNS Logs.Version of Helm and Kubernetes: Helm Version:
Kubernetes Version:
Which version of the chart: latest, running following command
helm install jenkins jenkins/jenkins -f config/values.yaml
What happened: Installation failed.
What you expected to happen: I want to be able to modify
dnsConfig
via value.yamlHow to reproduce it (as minimally and precisely as possible): Deploy a k3s cluster and try to deploy jenkins.
Only change I did for value.yaml.
Anything else we need to know: Great blog about this can you find on https://pracucci.com/kubernetes-dns-resolution-ndots-options-and-why-it-may-affect-application-performances.html