Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

How to Install Kubernetes: Ubuntu 22

================================================================
Step 1 - Install Docker 
================================================================
$ sudo apt-get install ca-certificates curl gnupg lsb-release
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
$ sudo systemctl enable docker
$ sudo systemctl status docker

If Docker is not running, start it with the following command:
$ sudo systemctl start docker

================================================================
Step 2 - Install kubeadm kubelet kubectl
================================================================
$ curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
$ echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
$ sudo apt update
$ sudo apt install kubeadm kubelet kubectl
$ sudo apt-mark hold kubeadm kubelet kubectl
$ kubeadm version

================================================================
Step 3 - Prepare for Kubernetes Deployment
================================================================

# Disable all swap spaces with the swapoff command:
$ sudo swapoff -a

# Then use the sed command below to make the necessary adjustments to the /etc/fstab file:
$ sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

# Load the required containerd modules. Start by opening the containerd configuration file in a text editor, such as nano:

$ sudo vi /etc/modules-load.d/containerd.conf

# Add the following two lines to the file:
overlay
br_netfilter

# Next, use the modprobe command to add the modules:

$ sudo modprobe overlay
$ sudo modprobe br_netfilter

# Open the kubernetes.conf file to configure Kubernetes networking:
$ sudo vi /etc/sysctl.d/kubernetes.conf

# Add the following lines to the file:

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1

# Reload the configuration by typing:
$ sudo sysctl --system 

# Assign Unique Hostname for Each Server Node
$ sudo hostnamectl set-hostname master-node

================================================================
Step 4: Configure containerd
================================================================

# Open the kubelet file in a text editor.
NA

# Reload the configuration and restart the kubelet:
$ sudo systemctl daemon-reload && sudo systemctl restart kubelet

# Open the Docker daemon configuration file:

$ sudo vi /etc/docker/daemon.json

 {
      "exec-opts": ["native.cgroupdriver=systemd"],
      "log-driver": "json-file",
      "log-opts": {
      "max-size": "100m"
   },

       "storage-driver": "overlay2"
       }

# Reload the configuration and restart Docker:
$ sudo systemctl daemon-reload && sudo systemctl restart docker



### containerd
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables  = 1
net.ipv4.ip_forward                 = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF
sudo sysctl --system
sudo mkdir -p /etc/containerd


### containerd config
cat > /etc/containerd/config.toml <<EOF
disabled_plugins = []
imports = []
oom_score = 0
plugin_dir = ""
required_plugins = []
root = "/var/lib/containerd"
state = "/run/containerd"
version = 2

[plugins]

  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
    [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
      base_runtime_spec = ""
      container_annotations = []
      pod_annotations = []
      privileged_without_host_devices = false
      runtime_engine = ""
      runtime_root = ""
      runtime_type = "io.containerd.runc.v2"

      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
        BinaryName = ""
        CriuImagePath = ""
        CriuPath = ""
        CriuWorkPath = ""
        IoGid = 0
        IoUid = 0
        NoNewKeyring = false
        NoPivotRoot = false
        Root = ""
        ShimCgroup = ""
        SystemdCgroup = true
EOF


### crictl uses containerd as default
{
cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
EOF
}


### kubelet should use containerd
{
cat <<EOF | sudo tee /etc/default/kubelet
KUBELET_EXTRA_ARGS="--container-runtime-endpoint unix:///run/containerd/containerd.sock"
EOF
}



### start services
systemctl daemon-reload
systemctl enable containerd
systemctl restart containerd
systemctl enable kubelet && systemctl start kubelet

================================================================
Initialize Kubernetes on Master Node
================================================================
#Finally, initialize the cluster by typing:
$ sudo kubeadm init --control-plane-endpoint=master-node --upload-certsCode language: PHP (php)

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Kubernetes Job & CronJob Explained: API Resource, YAML Example, and Use Cases

Kubernetes Jobs and CronJobs Explained with Examples: Complete Hands-on Guide for DevOps Engineer Keywords 1. Introduction In Kubernetes, not every workload is a long-running application like a…

Read More

Kubernetes Secret Explained: Secret API Resource, YAML Example, and Use Cases

What is Kubernetes SecretsA Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Objects of…

Read More

Kubernetes ConfigMap Explained: API Resource, YAML Example, and Use Cases

Content of reverseproxy.conf Commands to execute to create configmap Example pod using configmap Validating configmap inside a pod Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps,…

Read More

Kubernetes Service Explained: API Resource, YAML Example, and Use Cases

In Kubernetes, a Service is an abstraction that defines a logical set of pods and a policy by which to access them. It provides a stable network…

Read More

Kubernetes Deployment Explained: API Resource, YAML Example, and Use Cases

Fearture of Kubernetes Deployment Note:ReplicaSets = Replication+Controller in the Deployment Kubernetes Deployement Strategy Type of deployment .spec.strategy specifies the strategy used to replace old Pods by new…

Read More

Kubernetes ReplicaSet Explained: API Resource, YAML Example, and Use Cases

Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x