"Effortless Kubernetes Setup: Install with Ease Using a Shell Script"

0



Kubernetes, often known as K8s, is a container orchestration platform that automates the deployment, scaling, and administration of containerized applications. It gives you a scalable and robust architecture for executing applications in distributed contexts like cloud infrastructure or on-premises clusters.


 #!/bin/bash

sudo apt-get update -y

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

sudo install minikube-linux-amd64 /usr/local/bin/minikube

# installing docker on ubuntu

sudo apt-get update

sudo apt-get install ca-certificates curl gnupg

# Add Docker’s official GPG key

sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Use the following command to set up the repository:

echo \

  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \

  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \

  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# update the repo

sudo apt-get update

# Install Docker Engine, containerd

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

# to run simple docker container

sudo docker run hello-world

# Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker'

sudo usermod -aG docker $USER && newgrp docker

# it will automaticall create a control plane 

minikube start

# to install kubectl 

sudo snap install kubectl --classic



Tags

Post a Comment

0Comments
Post a Comment (0)