X
24Apr

How to do Installation of K8S using kubeadm?

Till now I have given blogs on k8s objects, services, namespaces, ingress etc. but where to execute and implement all those, yes, we need a k8s cluster for that, if you have it already go n execute, if not, here is the solution for you.

Execute below commands to configure the master node “(# are optional)”

  • sudo hostnamectl set-hostname master-node
  • sudo apt update
  • #clear
  • sudo apt install docker.io -y
  • sudo systemctl enable docker
  • curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add
  • sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
  • sudo apt install kubeadm -y
  • sudo swapoff -a
  • sudo kubeadm init --pod-network-cidr=10.244.0.0/16
  • mkdir -p $HOME/.kube
  • sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  • sudo chown $(id -u):$(id -g) $HOME/.kube/config
  • sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
  • kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml
  • #clear
  • kubectl get nodes
  • watch kubectl get nodes
  • kubectl get nodes -o wide
  • #history ---> for future purpose record

Execute below commands to configure on worker node

  • sudo hostnamectl set-hostname node1
  • sudo apt update
  • #clear
  • sudo apt install docker.io -y
  • sudo systemctl enable docker
  • #clear
  • curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add
  • sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
  • sudo apt install kubeadm -y
  • sudo swapoff -a
  • following command will have different options in your case, that command will comeup on the screen itself      #kubeadm join 172.31.36.112:6443 --token sop568.8zzj0emko8sa4o0s     --discovery-token-ca-cert-hash sha256:35fc8b66d2e57eb56f73247fa16bcc44220b975994ec99e61af8caa74b22788d

 

if you want configure multiple worker nodes or master nodes, execute the set of commands respectively in other nodes as well,

if you wantdon’twant toconfigure and manage the cluster, go with cloud managed especially AKS, why cloud managed and why AKS; follow the link for one ofmy previous blog

https://ecanarys.com/Blogs/ArticleID/370/Difference-Between-K8S-vs-Azure-Kubernetes-Service-AKS

 

Related

Volume Management in Kubernetes

Since pods created in k8s are ephemeral, we are able to get the data as long as pods are alive, but ...

Read More >

Quick Understanding on Stateful Sets in Kubernetes

Stateful sets are similar to deployments, they can scale up and scale down, they can perform rolling...

Read More >

HOW TO DO BACKUP AND RESTORE ENTIRE K8S CLUSTER?

If you have deployed different applications on k8s cluster using various objects like deployments, p...

Read More >

Taints and Tolerations

Taints and tolerations are used to restrict the pods to schedule them onto respective nodes. There i...

Read More >

Node Selector

Assume you have 3 nodes cluster of which two of them are having lower hardware resources and one of ...

Read More >

NODE AFFINITY

The k8s node affinity feature is to ensure pods are hosted on a particular node. As mentioned in pre...

Read More >

What is ingress and what are the components of it?

Ingress is a resource, which exposes the http and https from external sources to the services within...

Read More >

Kubernetes RBAC (Role Based Access Control)

The Kubernetes RBAC (role bases access control) system helps us in defining set of rules in controll...

Read More >

Namespaces in Kubernetes

A default namespace is created automatically when the cluster is being setup. To isolate or prevent ...

Read More >

Services and Blue-Green Deployment Strategy

In this article, we’ll briefly focus on services and blue-green deployment strategy.What is a servi...

Read More >

Share

Post a Comment

Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
  • Key Metrics to Measure DevOps Success

    DevOps words means many things to many people and all the definitions might be partly right. DevOps is all about continuously seeking feedback, understanding challenges, and improving the way the soft...
  • Bulk Export Import Test Cases to Azure DevOps Test Plans using CSV file

    As a user of Azure DevOps Test Plans or TFS Test Management for manual testing, from a long time everyone including me had a wish, that copy of test cases from excel or csv file along with test steps ...
  • Azure DevOps Overview

    Now a days Azure DevOps is very famous with IT and Operations team along with developers, so what is Azure DevOps? It is a Software as a service (SaaS) platform from Microsoft that provides features r...
  • Volume Management in Kubernetes

    Since pods created in k8s are ephemeral, we are able to get the data as long as pods are alive, but if pods are terminated data stored in it completely lost and it cannot get back, for that we need to...
Tags
Monthly Archive
Subscribe
Name

Text/HTML
Text/HTML
Contact Us
  • *
  • *