kubernetes: kubelet config file, resolverConfig option not used
What happened:
When using kubelet config file, resolverConfig option is not used by kubelet.
What you expected to happen:
kubelet config option resolverConfig is used to set resolver configuration file by kubelet.
How to reproduce it (as minimally and precisely as possible):
kubelet config file:
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
[...]
resolverConfig: /var/lib/kubelet-config/resolv.conf
During kubelet start, default /etc/resolv.conf is used:
Jun 26 13:02:53 dev-k8s-worker-r3 kubelet[30137]: I0626 13:02:53.550870 30137 flags.go:33] FLAG: --resolv-conf="/etc/resolv.conf"
I confirmed it examining resolv.conf inside container, content is taken from node /etc/resolv.conf instead of /var/lib/kubelet-config/resolv.conf.
On the other hand when using deprecated kubelet parameter --resolv-conf=/var/lib/kubelet-config/resolv.conf everything works fine, kubelet is using proper path:
Jun 26 13:06:49 dev-k8s-worker-r3 kubelet[6501]: I0626 13:06:49.235306 6501 flags.go:33] FLAG: --resolv-conf="/var/lib/kubelet-config/resolv.conf"
Environment:
- Kubernetes version (use
kubectl version):
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
- Cloud provider or hardware configuration: bare-metal
- OS (e.g:
cat /etc/os-release): Ubuntu 18.04.1 - Kernel (e.g.
uname -a):
Linux dev-k8s-deployer-r1 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 25 (17 by maintainers)
mergeKubeletConfigurations is buggy… it is JSON-marshaling the internal config (which is not right), then merging with versioned JSON from drop-in files, then decoding that back into the internal config.
All serialized merging has to happen in the same versioned config, to/from versioned config API types, not internal ones.