Initializing the Kubernetes Cluster on the master node.
Now you have all the prerequisites performed and we are ready to proceed with the configuration of our cluster. We are going to perform these steps on the master node and later on join our worker nodes to the cluster.
Just perform the kubeadm init on the master node.
kubeadm init
The Kubeadm init will perform the following operations
- preflight — perform pre-flight checks (pre checks)
- certs — Generate the certificates
- kubeconfig — Generate all the configuration necessary to establish the control plane
- kubelet-start — Write kubelet settings and Start the kubelet
- control-plane — Generete all static Pod Manifests files necessary to establish the control plane
- etcd — Generate the static Pod manifest file for local etcd
- upload-config — Upload the kubeadm and kubelete config to configMap
- upload-certs — Upload certificates to kubeadm-certs
- mark-control-plane — Mark a node as a control plane
- bootstrap-token — Generates the bootstrap tokens used to join a node to a cluster
- kubelet-finalize — Updates the settings relevant to the kubelet
- addon — Install required addons for passing conformance tests
Some of the following options can be used to customize the configuration of the Kubeadm init
— pod-network-cidr string
--service-dns-domain string Default: "cluster.local"
--service-cidr string Default: "10.96.0.0/12"
--token-ttl duration Default: 24h0m0s
So we are going to initialize our cluster using the following options
kubeadm init — pod-network-cidr=”10.244.0.0/16" — service-dns-domain=”testlab.local”
The logs for the operations are as follows. You can see the set of operation as mentioned above.