Kubernetes Basics in Linux
Posted on June 1, 2024 (Last modified on June 8, 2024) • 2 min read • 227 wordsLearn the basics of Kubernetes in Linux, including setting up a local Kubernetes cluster with Minikube, deploying applications, and managing pods.
Kubernetes is a powerful tool for container orchestration. This guide covers the basics of Kubernetes in Linux, including setting up a local Kubernetes cluster with Minikube, deploying applications, and managing pods.
Install Minikube on your Linux system.
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/
Start a local Kubernetes cluster with Minikube.
minikube start
Check the status of your Minikube cluster.
minikube status
Create a deployment using kubectl
.
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
Expose the deployment to create a service.
kubectl expose deployment hello-minikube --type=NodePort --port=8080
Get the URL of the service.
minikube service hello-minikube --url
Access the service using the provided URL.
List all running pods.
kubectl get pods
Describe a specific pod to get detailed information.
kubectl describe pod pod_name
Delete a pod by name.
kubectl delete pod pod_name
Kubernetes is a powerful platform for managing containerized applications. Setting up a local Kubernetes cluster with Minikube, deploying applications, and managing pods are essential skills for working with Kubernetes in Linux. Practice these basics to effectively use Kubernetes in your development and deployment workflows.