Day 31: Launching Your First Kubernetes Cluster with Nginx Running
Akshay Ghalme
DevOps Engineer Helping Organisations with DevOps Solutions | AWS | Jenkins | CI/CD | Docker | Ansible | terraform | Kubernetes
Today, we’re diving into Kubernetes hands-on practice by setting up a local Kubernetes cluster using Minikube and creating a simple Nginx pod. If you're new to Kubernetes, this is a perfect way to get started.
What is Minikube?
Minikube is a lightweight tool designed to help you set up a local Kubernetes cluster on your machine. It supports macOS, Linux, and Windows and can be deployed as a VM, a container, or on bare-metal hardware. Minikube is essentially a simplified version of Kubernetes, making it ideal for beginners and testing environments.
Key Features of Minikube
Task 1: Install Minikube on Your Local Machine
To install Minikube, follow these steps:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Start Minikube: After installation, start Minikube:
minikube start
Understanding Kubernetes Pods
Pods are the smallest deployable units in Kubernetes. They represent a single instance of a running application. Think of a pod as a logical host that contains one or more tightly coupled containers.
Pod Features
领英推荐
Task 2: Create Your First Pod
We’ll create an Nginx pod using Minikube.
Steps to Create an Nginx Pod
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
Deploy the Pod Apply the configuration using kubectl:
kubectl apply -f nginx-pod.yaml
Verify Pod Status Check if the pod is running:
kubectl get pods
Access the Pod Use port-forwarding to access the Nginx service:
kubectl port-forward pod/nginx-pod 8080:80
Open a browser and visit https://localhost:8080.
Celebrate Your First Kubernetes Deployment! ??
By using Minikube and Kubernetes, you’ve taken your first steps into container orchestration. You’ve not only set up a local cluster but also created and accessed an Nginx pod, showcasing the power of Kubernetes.
#KubernetesBeginner #MinikubeSetup #KubernetesPod #NGINX #KubernetesTutorial #DevOpsLearning #KubernetesArchitecture #ContainerOrchestration #CloudNative