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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Kubernetes Secret Explained: 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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing…

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 Job & CronJob Explained: API Resource, YAML Example, and Use Cases

Cronjob Example 1 job Example Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at…

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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at…

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