Commands.app

Kubernetes Commands

Kubernetes container orchestration and kubectl commands

25 commands found
kubectl get
Display resources
Resource Management
kubectl get pods
kubectl describe
Show detailed resource information
Resource Management
kubectl describe pod mypod
kubectl create
Create resources from file or stdin
Resource Management
kubectl create -f deployment.yaml
kubectl apply
Apply configuration to resources
Resource Management
kubectl apply -f deployment.yaml
kubectl delete
Delete resources
Resource Management
kubectl delete pod mypod
kubectl logs
Print container logs
Debugging
kubectl logs mypod
kubectl exec
Execute command in container
Debugging
kubectl exec mypod -- ls /app
kubectl cp
Copy files to/from containers
Debugging
kubectl cp mypod:/app/logs.txt ./logs.txt
kubectl port-forward
Forward local port to pod
Networking
kubectl port-forward mypod 8080:80
kubectl expose
Expose resource as service
Networking
kubectl expose deployment myapp --port=80
kubectl scale
Scale deployment replicas
Scaling
kubectl scale deployment myapp --replicas=3
kubectl autoscale
Auto-scale deployment based on metrics
Scaling
kubectl autoscale deployment myapp --min=2 --max=10 --cpu-percent=80
kubectl rollout
Manage deployment rollouts
Deployments
kubectl rollout status deployment/myapp
kubectl set
Set resource attributes
Deployments
kubectl set image deployment/myapp mycontainer=myimage:v2
kubectl edit
Edit resource in editor
Resource Management
kubectl edit deployment myapp
kubectl config
Manage kubeconfig settings
Configuration
kubectl config view
kubectl top
Display resource usage
Monitoring
kubectl top nodes
kubectl run
Run a pod
Resource Management
kubectl run nginx --image=nginx
kubectl label
Add or update labels
Labels & Annotations
kubectl label pods mypod env=production
kubectl annotate
Add or update annotations
Labels & Annotations
kubectl annotate pods mypod description="My app"
kubectl taint
Add or remove node taints
Node Management
kubectl taint nodes mynode key=value:NoSchedule
kubectl cordon
Mark node as unschedulable
Node Management
kubectl cordon mynode
kubectl drain
Drain node for maintenance
Node Management
kubectl drain mynode --ignore-daemonsets
kubectl api-resources
List available API resources
Cluster Info
kubectl api-resources
kubectl explain
Documentation for resources
Cluster Info
kubectl explain pods