π DevOps Cheatsheet β Podman, Minikube, Kubernetes, Docker
A complete beginner-friendly Markdown cheatsheet with essential commands, YAML examples, and deployment flow.
π Core Concepts
π Term | π§ Meaning |
---|---|
πΌοΈ Image | A snapshot of an app and its dependencies. |
π¦ Container | A running instance of an image. |
π§± Pod | Smallest deployable unit in Kubernetes. Can hold one or more containers. |
π₯οΈ Node | A worker machine in Kubernetes (physical/virtual). |
π§© Cluster | A set of nodes managed by Kubernetes. |
π Service | Exposes pods to the network. |
π οΈ Deployment | Tells Kubernetes how to deploy and manage pods. |
π³ Podman Commands
π Basic Commands
podman --version # Check Podman version
podman info # System info
podman images # List images
podman search <image> # Search images
podman pull <image> # Pull image
podman rmi <image> # Remove image
π¦ Container Management
podman run -it <image> # Run interactive container
podman run -d -p 8080:80 <image> # Run web server container (map port)
podman ps # List running containers
podman ps -a # List all containers
podman stop <container_id> # Stop container
podman rm <container_id> # Remove container
podman logs <container_id> # View logs
podman exec -it <id> <cmd> # Run command in container
π οΈ Build & Push
podman build -t myimage . # Build image from Dockerfile
podman tag myimage docker.io/user/myimage:latest # Tag image for registry
podman push docker.io/user/myimage:latest # Push image to Docker Hub
π¦ Minikube Commands
minikube start # Start Minikube cluster
minikube stop # Stop cluster
minikube delete # Delete cluster
minikube status # Show status
minikube dashboard # Launch dashboard
minikube service <service-name> --url # Get NodePort service URL
π§° Use Podman as runtime (optional):
minikube start --driver=podman
βΈοΈ Kubernetes Commands
kubectl version # Check kubectl version
kubectl cluster-info # Info about cluster
kubectl get nodes # Show nodes
kubectl get pods # Show pods
kubectl get services # Show services
kubectl get deployments # Show deployments
kubectl describe pod <pod_name> # Describe pod
kubectl delete pod <pod_name> # Delete pod
kubectl apply -f <file>.yaml # Apply YAML file
kubectl port-forward svc/<service-name> 8080:80 # Port forward to service
π YAML File Examples
π Deployment YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: mycontainer
image: user/myimage:latest
ports:
- containerPort: 80
Apply:
kubectl apply -f deployment.yaml
π Service YAML
apiVersion: v1
kind: Service
metadata:
name: myapp-service
spec:
selector:
app: myapp
ports:
- protocol: TCP
port: 80
targetPort: 80
type: NodePort
Apply:
kubectl apply -f service.yaml
Get service URL:
minikube service myapp-service --url
π Docker Image Push
docker login
podman build -t myimage .
podman tag myimage docker.io/username/myimage:latest
podman push docker.io/username/myimage:latest
π DevOps Flow (Quick Map)
π§βπ» Code β π Dockerfile β π οΈ Build Image β β
Test Locally (Podman) β π€ Push Image β βΈοΈ Minikube (K8s) β π YAML β π Deploy β π Service β π Access via NodePort
π Happy Shipping from Tech Quanta π