I need to create failover k8s cluster of 2 masters and 3 worker nodes with stacked control plane and etcd nodes, and calico as network plugin. There is virtual ip and haproxy balancer on masters. Kubernetes version is 1.15.1.
I used to deploy single-master k8s clusters before, passing --pod-network-cidr
, --apiserver-advertise-address
and other params as CLI args to kubeadm init
- that wokred fine.
Now according to the official manual (https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/) I have to use --config
and yaml config file as there is not enough CLI keys to do what I need. The manual shows pretty simple config sample, which is not enough for me. As it is impossible to mix --config
with arguments, yaml config was expanded to this:
apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: "10.30.7.65"
bindPort: 6443
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
controlPlaneEndpoint: "10.30.7.90:7443" # This is virtual ip of balancer
api:
advertiseAddress: 10.30.7.65
networking:
podSubnet: 10.244.0.0/16
serviceSubnet: 10.96.0.0/12
nodeName: srv1.demo2.prolabs.ai
kubernetesVersion: v1.15.1
apiServerCertSANs:
- "10.30.7.65"
- "10.30.7.66"
- "10.30.7.67"
- "10.30.7.90"
- "127.0.0.1"
token: "jw5mnd.26a22s2kg9mewtjv"
tokenTTL: "0"
After running kubeadm init --config=k8s.yaml --upload-certs
I see that none of networking settings were applied: controllers pods are in the 192.168.0.0/16 subnet, calico and etcd pods are bound to the server's external ip.
So, what's the problem? How do I init the multimaster cluster using certain subnets, certain api url and certain interfaces of hardware nodes?