Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.69 KB

Ex-11.md

File metadata and controls

68 lines (46 loc) · 1.69 KB

Installation of Kubernetes and Deploying Kubeadm

Prerequisites

  • Docker
  • Kubernetes

Procedure

  1. Download and install Docker Desktop for Windows and MacOs from the Docker website
  2. Once Docker Desktop is installed, open it and go to the Settings menu.
  3. Click on the Kubernetes tab and enable Kubernetes.
  4. Wait for Kubernetes to download and install. This may take several minutes. Enable K8s
  5. Once Kubernetes is installed, open a command prompt and run the following command to verify that Kubernetes is running:
kubectl get nodes

Kubectl

  1. Or you can run the following command to very that Kubernetes is installed:
kubectl version
  1. To create a deployment, run the following command:
kubectl create deployment nginx --image=nginx
  1. To view the deployment, run the following command:
kubectl get deployments
  1. To view your deployment in a browser, run the following command:
kubectl expose deployment nginx --port=80 --type=LoadBalancer

10.To verify that the service is running, run the following command:

kubectl get services

Kubectl

  1. Go to localhost to view the deployment.

Kubectl

  1. To delete the deployment, run the following command:
kubectl delete deployment nginx