I'm trying to set up a Kubernetes master on an IP other than the one assigned to the default interface. These are the changes I made to my kubeadm-config.yml
:
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
controlPlaneEndpoint: x.x.x.x
apiServer:
extraArgs:
advertise-address: x.x.x.x
certSANs:
- x.x.x.x
etcd:
local:
dataDir: /var/lib/etcd
extraArgs:
advertise-client-urls: https://x.x.x.x:2379
initial-advertise-peer-urls: https://x.x.x.x:2380
initial-cluster: my-hostname=https://x.x.x.x:2380
listen-client-urls: https://127.0.0.1:2379,https://x.x.x.x:2379
listen-peer-urls: https://x.x.x.x:2380
initial-cluster-state: new
serverCertSANs:
- x.x.x.x
peerCertSANs:
- x.x.x.x
Where x.x.x.x
is the non-default IP.
Everything seems to be set correctly, except for the liveness probe of the api-server. At /etc/kubernetes/manifests/kube-apiserver.yaml
I still see
livenessProbe:
failureThreshold: 8
httpGet:
host: y.y.y.y
path: /healthz
port: 6443
scheme: HTTPS
Where y.y.y.y
is the old IP.
Does anyone know what key I need to add to my kubeadm-config.yml
to set this right?
Sam
Reproducing your configuration, I found out that the
InitConfiguration
part ofkubeadm-config
is required for that.The following
kubeadm-config.yaml
part is supposed to instructkubeadm
to configurekube-apiserver
according to your needs:For the full details please read related GoDoc page: