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

  87. drugs for ed: erection pills - best pill for ed metformin on line

  88. how to order metformin online: metformin - metformin 1000 mg online lasix side effects

  89. buy paxil: buy paxil - paxil 20 mg natural remedies for ed

  90. furosemide 40 mg: lasix furosemide - lasix 40mg paxil

  91. buy lasix online: lasix - lasix generic name lasix dosage

  92. 40 mg paxil: paxil 20 mg - paxil for panic attacks lasix tablet

  93. paxil erectile dysfunction: cheap paxil - paxil ocd lasix uses

  94. metformin 397: metformin without prescription - purchase metformin online buy metformin

  95. cheapest ed pills: buy erection pills - mens ed pills lasix side effects

  96. male ed pills: cheap erectile dysfunction pills online - best ed pills metformin 500 mg over the counter

  97. E-cialis hellocig e-liquid cialis low prices

  98. Buy viagra canada pharmacy b12 injections online pharmacy list of trusted canadian pharmacies

  99. Cialis 5 mg precio which works better viagra or cialis how long does cialis keep you hard

  100. Does cialis lower blood pressure female cialis online can i take 40mg of cialis

  101. Cialis mit dapoxetine cialis effect on women canadian pharmacy cialis brand

  102. Generic cialis 20 mg low cost cialis 5mg cialis for sale

  103. Russian pharmacy online domperidone canada pharmacy global drugs direct canada

  104. Buy 20mg cialis generic cialis next day delivery cialis generic vs brand

  105. Purchasing drugs from canada cvs pharmacy online pharmacy technician online study

  106. effets secondaires cialis cialis 20mg original cialis en vente libre dans quel pays combien coute une boite de cialis

  107. cheap generic cialis mylan cialis cialis pas cher pharmacie paris cialis ou levitra ou viagra

  108. viagra effet homme viagra femme acheter quel produit naturel peut remplacer le viagra comment et quand prendre du viagra ?

  109. vente de viagra acheter du viagra en espagne viagra pas cher en france combien de temps avant l'acte prendre le viagra

  110. cialis prezzo online cialis senza ricetta roma cialis generico online italia consegna veloce come si chiama il farmaco generico del cialis

  111. urorec e cialis cialis 20 mg prezzo in farmacia principio attivo viagra cialis levitra quanto costa una confezione di cialis

  112. pastiglie tipo viagra generici del viagra come avere un erezione senza viagra dove comprare viagra a milano

  113. pastiglie tipo viagra sandoz viagra viagra generico senza ricetta medica quando il viagra non fa effetto

  114. cialis barato online comprar cialis generico 20 mg donde comprar cialis en españa cialis o viagra cual comprar

  115. cialis wikipedia cialis soft tabs precio cialis en farmacia con receta cialis on line españa

  116. mejor que viagra [url=]viagra natural amazon [/url] foro comprar viagra por internet de que esta hecha la viagra

  117. viagra viagra in spain over the counter como comprar viagra sin receta en españa que pasa si tomas viagra con alcohol

  118. levitra costo mexico levitra professional levitra prices walmart viagra levitra cialis cost comparison

  119. viagra pour fille viagra en vente libre en belgique acheter du viagra en ligne aliment qui remplace le viagra

  120. viagra risques cardiaques viagra professionnel where can i buy viagra quand doit on prendre du viagra

  121. levitra 10 mg bayer levitra 20 mg price levitra without prescription prices levitra

  122. viagra cdiscount boite de viagra acheter du viagra en ligne legalement combien coute le viagra

  123. humour viagra viagra generique en ligne viagra pour homme sans ordonnance quand une femme prend du viagra

  124. viagra naturale le générique du viagra prix d'une boite de viagra viagra comment s en procurer

  125. achat viagra achat viagra en ligne comparaison viagra cialis levitra spedra viagra pour homme comment ca marche

  126. www kamagra cialis cialis pour homme comment faire pour commander du cialis cialis ou equivalent

  127. cialis generique avis cialis 5mg prix en pharmacie prix du cialis generique en pharmacie cialis ou acheter

  128. Can i buy cialis online price of cialis at walmart cialis time

  129. Russian pharmacy online usa discount prescription drugs online pharmacy technician salary canada ontario

  130. Cialis to buy cialis prices in ontario generic cialis 10mg 30 pills

  131. India cialis is cialis or viagra better cialis bathtub ad

  132. Where to get free samples of cialis 60 mg cialis too much cialis generic vs brand

  133. Acheter cialis cialis professional samples generic cialis no prescription australia

  134. Buy original cialis 10 mg best place to buy generic cialis cialis peyronie’s treatment

  135. Lisinopril online canadian pharmacy lasix canadian pharmacy rx pharmacy india

  136. Viagar vs cialis cialis indications 365 drug cialis

  137. Generic cialis 30 pills 20mg cialis before and after cialis what does it do

  138. Cialis dr oz generic cialis au generic cialis soft tabs

  139. canadian viagra online order generic viagra buy cialis in canada cialis low price approved canadian online pharmacies buying cialis canada us pharmacy for cialis viagra canada viagra canadian pharmacy cialis without prescription canada ed drugs - canada viagra dosages canadian online pharmacy viagra alternative viagra viagra reviews

  140. natural alternative to viagra canada online drugs canadian drug pfizer viagra buy viagra online cheap cialis online canada pharmacy cialis in canada alternative viagra viagra india pharmacy about canadian drug companies ordering viagra online without prescription drugstore in canada drug store low price cialis legitimate online pharmacies india viagra purchase online

  141. canada drugstore buy viagra online canada pharmacy cialis cost viagra overnight buy heroin online cialis on canada cialis cost drugstore of canada buy cialis in canada online viagra costs order viagra without prescription generic cialis tadalafil in canada viagra expiration date viagra india cialis daily canada

Leave a Reply