Cannot set kubelet healthz bind address with kubeadm

3/4/2019

I am trying to configure the kubelet's healthz bind address as follows:

kubeadm init --config <(cat <<EOF
apiVersion: kubeadm.k8s.io/v1alpha2
kind: MasterConfiguration
kubernetesVersion: stable-1.11
kubeletConfiguration:
  healthzBindAddress: 0.0.0.0
EOF
)

but I get the following

# cat /var/lib/kubelet/config.yaml  | grep healthz
healthzBindAddress: 127.0.0.1
healthzPort: 10248

Am I missing something?

# kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.7", GitCommit:"65ecaf0671341311ce6aea0edab46ee69f65d59e", GitTreeState:"clean", BuildDate:"2019-01-24T19:29:00Z", GoVersion:"go1.10.7", Compiler:"gc", Platform:"linux/amd64"}
-- dippynark
kubeadm
kubernetes

1 Answer

3/5/2019

For Kubernetes v1.13, you can get the configuration from kubeadm

kubeadm config print init-defaults --component-configs KubeProxyConfiguration,KubeletConfiguration > kubeadm-init.config

Edit the --healthz-bind-address 0.0.0.0, the IP address for the healthz server to serve on (set to 0.0.0.0 for all IPv4 interfaces and :: for all IPv6 interfaces) (default 127.0.0.1).

And upload it kubeadm config upload from-file [flags].

You can refer to the Kubernetes documentation for kubeadm config.

EDIT

In Kubernetes v1.11, option --component-configs was called --api-objects and available value were MasterConfiguration, NodeConfiguration.

This is referenced in the Kubernetes v1.11 documentation for kubeadm config.

-- Crou
Source: StackOverflow