Installing the Components of a Kubernetes Cluster

Installing the Components of a Kubernetes Cluster

In this post, we build a test cluster from scratch in order to check the installed components of the cluster and execute some deployments.


  • Operating System Ubuntu 18.04.4
  • One  Master Node
  • <N> Worker Node
  • Internet connection to pull binaries  and  repositories
  • Sudo access for user


  1. Install the container runtime, as well as kubeadm, kubectl, and kubelet
  2. Initialize the cluster
  3. Add CNI Flannel
  4. Add Nodes to cluster

Kubernetes Components

Control Plane  Components:

Control plane components typically run on Master node and make global decisions like scheduling pod, detecting, and responding cluster events, etc.

  • kube-apiserver: Expose the Kubernetes API.
  • etcd: Consistent and highly-available key-value store used as Kubernetes’ backing store for all cluster data.
  • kube-scheduler: Watch newly created pods and schedule them on a suitable node.
  • kube-controller-manager: 
    • Node controller
    • Replication controller
    • Endpoints controller
    • Service Account & Token controllers
  • cloud-controller-manager: Cloud-specific control logic.

Node  Components:

Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment.

  • kubelet: An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod.
  • kube-proxy: Network proxy that runs each node.
  • container-runtime: Responsible for the running containers.


Step 1: Add docker and kubernetes repositories for  Master and  Worker nodes

You should run the following command sets on all three nodes to get gpg keys and add repositories.

#curl -fsSL | sudo apt-key add -
#sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

#curl -s | sudo apt-key add -

#cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb kubernetes-xenial main

#sudo apt-get update


Step 2: Install docker, kubelet, kubeadm and  kubectl for  Master and  Worker nodes

Perform these steps for all nodes in the cluster. If you need to install specific version of any component you can change it as you wish. Also, it's possible to check the latest version with "apt list" command. 

#apt list  docker-ce
#sudo apt-get install -y docker-ce=5:19.03.8~3-0~ubuntu-bionic kubelet=1.18.2-00 kubeadm=1.18.2-00 kubectl=1.18.2-00


Step 3: Initialize Cluster

Run the following command in the master node to initialize the Kubernetes cluster. You should disable swap before running this step. "" is  private ip address  of  master server.

#sudo kubeadm init --apiserver-advertise-address --pod-network-cidr=
Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join --token 1aa23n.cv2v8moy1eplc67e \
    --discovery-token-ca-cert-hash sha256:223ef1bf2d71a8bae2f0a05f02ec165efd4601aa4627dfd4dbaaf2a7dabbf887

Swap Error: 

#sudo kubeadm init --apiserver-advertise-address --pod-network-cidr=
W0506 22:33:57.562106    7930 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups []
[init] Using Kubernetes version: v1.18.2
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

Step 4: Setup Default  Configuration on Master node

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Step 5: Install Flannel for the Pod Network (On Master Node)

#kubectl apply -f
# kubectl  get  pods -n kube-system
NAME                               READY   STATUS    RESTARTS   AGE
coredns-66bff467f8-26wzg           0/1     Pending   0          16m
coredns-66bff467f8-8xcph           0/1     Pending   0          16m
etcd-master01                      1/1     Running   0          16m
kube-apiserver-master01            1/1     Running   0          16m
kube-controller-manager-master01   1/1     Running   0          16m
kube-flannel-ds-amd64-vhmmv        1/1     Running   0          20s
kube-proxy-882x2                   1/1     Running   0          16m
kube-scheduler-master01            1/1     Running   0          16m

Step 6: Join Worker nodes  to the cluster

root@worker01:~# kubeadm join --token 1aa23n.cv2v8moy1eplc67e  --discovery-token-ca-cert-hash sha256:223ef1bf2d71a8bae2f0a05f02ec165efd4601aa4627dfd4dbaaf2a7dabbf887
W0506 23:19:11.241333   19433 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.18" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.


Components and Cluster Status

Check components  status:

root@master01:~# kubectl get cs
NAME                 STATUS    MESSAGE             ERROR
scheduler            Healthy   ok
controller-manager   Healthy   ok
etcd-0               Healthy   {"health":"true"}


Check cluster information:

root@master01:~# kubectl  cluster-info
Kubernetes master is running at
KubeDNS is running at

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
root@master01:~# # kubectl version --short
Client Version: v1.18.2
Server Version: v1.18.2

Check node information:

root@master01:~# kubectl  get  nodes  -o wide
master01   Ready    master   34m   v1.18.2   <none>        Ubuntu 18.04.4 LTS   5.3.0-28-generic   docker://19.3.8
worker01   Ready    <none>   32m   v1.18.2   <none>        Ubuntu 18.04.4 LTS   5.3.0-28-generic   docker://19.3.8

Check controller-manager version:

root@master01:~# kubectl  get  pod kube-controller-manager-master01 -o yaml -n kube-system|grep image:
            f:image: {}

Check kubeadm version:

root@master01:~# kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:54:15Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

Run a deployment check if the application is running  on pod:

root@master01:~# kubectl  create deployment  nginx --image=nginx
deployment.apps/nginx created
root@master01:~# kubectl  get pods
NAME                    READY   STATUS              RESTARTS   AGE
nginx-f89759699-2cxgc   0/1     ContainerCreating   0          6s

root@master01:~# kubectl  port-forward nginx-f89759699-2cxgc 8081:80 &
[1] 29150
root@master01:~# Forwarding from -> 80
Forwarding from [::1]:8081 -> 80

root@master01:~# curl -s  -v



I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me

Related Post


  1. generac viagra order viagra with pay pal buy generic viagra canada - viagra in hamburg ’

  2. viagra paypal buy viagra onoine viagra australia - viagra professional sublingual ’

  3. viagra pill viagra side effect or addiction where i can get viagra in sydney

  4. pharmacies in canada pharmacies shipping to usa Cialis Professional

  5. compare prescription prices pharmacies drug costs

  6. buy prescription drugs without doctor canadian rx pharmacy online rx price comparison

  7. online medicine shopping aarp recommended canadian pharmacies canada pharmacy online orders

  8. how much do viagra cost canada pharmaceuticals online viagra online australia

  9. northwest pharmacy/com prescription less viagra north west pharmacy canada

  10. starting cash loans business south africa 1st stop payday loans existing customer payday loans clayton ga

  11. cialis levitra viagra review alternating cialis and viagra

  12. ace check cashing loan reviews payday 2 cash hilesi list of payday loan lenders uk no credit check

  13. sunny cash loan review payday loans rifle co cash advance lynn haven fl

  14. fast cash loans malaysia cash advance rhode island payday loan max interest

  15. is cialis time release vente cialis en ligne cialis 20 prix en pharmacie

  16. sildenafil 110 mg capsule viagra 100 buy online

  17. online viagra prescription viagra with alcohol

  18. Does your site have a contact page? I'm having a tough time locating it but, I'd like to shoot you an e-mail. I've got some recommendations foor your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it grow over time. Wilhelmina Monty

  19. generic cialis mastercard dgeneric cialis

  20. heartguard ivermectin ivermectin coronavirus 1.87 ivermectin paste for dogs what parasites does ivermectin kill

  21. ventolin prescription albuterol price uk is ventolin same as albuterol how to take albuterol inhaler

  22. soolantra ivermectin price of stromectol how to give ivermectin to dogs what parasit is resistant to ivermectin

  23. maculopapular rash amoxicillin where to buy amoxicillin pharmacy can i take amoxicillin with ibuprofen how many days to take amoxicillin 500mg

  24. ventolin jarabe albuterol cost in mexico ventolin inhaler for sale online what is albuterol sulfate

  25. furosemide water pill furosemide 20 mg price furosemide 20 mg pill identification how to adjust dosage of furosemide for dogs

  26. amoxicillin with alcohol amoxicillin 500 mg capsules can a dog take amoxicillin what to do if you miss a dose of amoxicillin

  27. lasix and breastfeeding furosemide price furosemide for high blood pressure what should you eat when taking furosemide?

  28. zithromax and alcohol zithromax 250 cost can zithromax treat a uti what is the medicine azithromycin used for

  29. zithromax 500mg buy azithromycin 1000mg what is zithromax z pak how long does azithromycin take

  30. online clomid cheap clomid tablets uk how much does clomid cost how much clomid should a man take

  31. doxycycline cystic acne buy vibramycin what is doxycycline hyc 100mg used for how long to have lyme to take doxycycline

  32. prednisolone ointment prednisolone prednisone prednisolone suppositories for ulcerative colitis what is the difference prednisolone sodium phosphate vs prednisolone acetate

  33. buying doxycycline online doxycycline 100 mg cap doxycycline treatment for lyme disease how long does it take doxycycline to leave your system

  34. androxal vs clomid where can you buy clomid clomiphene citrate (clomid) when do i start taking clomid

  35. steroids prednisolone generic prednisolone otc can prednisolone reduce pain in dogs how long before prednisolone 5mg works in dogs

  36. - dissertation phd dissertation statistics help cheap dissertation help dissertation abstract

  37. priligy in canada generic priligy australia onde posso encontrar remedio priligy em usa what does dapoxetine look like

  38. - thesis search doctoral thesis help thesis writing service thesis help online

  39. - thesis help free thesis topics in education thesis publishing phd online

  40. - best online essay writer cheap essays to buy can i get someone to write my essay essay writer reviews

  41. - proquest thesis search thesis paper writing thesis editing service college thesis

  42. dangers of propecia generic propecia from canada how many years is propecia effective where can i get propecia no prescription

  43. prednisolone dexamethasone difference 100mg prednisolone hitech prednisolone buy online canada how does prednisolone help with mast cell cancer

  44. neurontin muscle pain cost of gabapentin 400 mg can you die from neurontin how to get high on gabapentin

  45. how metformin works buy metformin 500 mg uk metformin over the counter walmart how much b12 should i take with metformin

  46. xanax and paxil buy paroxetine australia side effects of getting off paxil what are the effects of taking paxil and mobic

  47. - thesis proposal help thesis defense advice

  48. plaquenil and sulfa plaquenil price what is plaquenil 200 mg used for who make plaquenil

  49. generic viagra pills: viagra pills pills for erectile dysfunction erectile dysfunction pills

  50. male erectile pills: kamagra pills viagra pills ed pills

  51. cialis pills online: best erectile dysfunction pills review male erectile pills erectile pills canada

  52. viagra otc buy viagra online without prescription no prescription viagra buy viagra without prescription

  53. viagra doses 200 mg buying viagra online without prescription viagra without a doctor prescription usa buy viagra online without prescription

  54. buy viagra online viagra no prescription buying viagra online without prescription viagra prescription

  55. viagra generic viagra without a doctor prescription usa viagra without a doctor prescription usa viagra without a doctor prescription

  56. viagra canada no prescription viagra viagra without a doctor prescription usa viagra without prescription

  57. how to get viagra without a doctor viagra prescription no prescription viagra buy viagra online without prescription

  58. over the counter viagra cvs viagra without a doctor prescription viagra without a doctor prescription canada viagra no prescription

  59. viagra for sale viagra without prescription viagra prescription buy viagra online without prescription

  60. viagra without a doctor prescription buy viagra without prescription buy viagra online without prescription no prescription viagra

  61. viagra price comparison viagra without a doctor prescription no prescription viagra viagra without prescription

  62. buy generic 100mg viagra online no prescription viagra buy viagra without prescription buy viagra online without prescription

  63. amoxicillin 500mg price in canada

  64. amoxicillin 500mg prescription

  65. clomid canada

  66. buy doxycycline without prescription

  67. online clomid

  68. price of amoxicillin without insurance

  69. doxycycline order online

  70. can you buy amoxicillin uk

  71. can i buy diflucan from canada

  72. doxycycline medication

  73. amoxicillin 500mg price

  74. clomid for men

  75. clomid generic name purchase clomid online and clomid pills and clomid alcohol and buy clomid online and clomiphene generic

  76. buy clomid online no prescription generic for clomid and cheap clomid and clomid 2020 and order clomid and clomid purchase online

  77. clomiphene for sale clomid medication and clomid online and clomid buy and clomid price and clomid purchase

  78. clomid tablet clomid for sale and purchase clomid and clomid buy and buy clomid online without prescription and buy clomid online;u=103475

  79. clomid without prescription buy cheap clomid and buy clomid 50mg and cost of clomid and clomid online cheap and order clomid§ion=13&url=

  80. clomid 100mg clomid order online and cheap clomid and cost of clomid and clomid tablet and generic for clomid

  81. clomid online clomiphene tablets and clomid for sale and order clomiphene and price of clomid and buy clomid online without prescription

  82. no prescription clomid clomiphene tablets and buy cheap clomid and clomid alcohol and clomid tablets and cheap clomid

  83. how to get metformin without prescription: metformin 125 mg - metformin 1000 mg from canada ed pills that really work

  84. lasix 20 mg: lasix - lasix 100mg lasix for sale

  85. real metformin mexico: metformin prices canada - metformin 250 mg price in india lasix for sale

  86. lasix generic name: lasix generic - lasix 100mg ed medications

Leave a Reply