Kubernetes
Deploy, scale, and manage containerized applications. Master kubectl commands for pods, services, and cluster operations.
158 commands
Browse by Topic
Getting Started
Quick setup and installation
Context
Context management
Pods
Pod management commands
Deployments
Deployment operations
Services
Service management
Namespaces
Namespace operations
Secrets
Secret management
ConfigMaps
ConfigMap operations
Nodes
Node operations
Ingress
Ingress management
Jobs
Job and CronJob management
StatefulSets
StatefulSet operations
DaemonSets
DaemonSet operations
Storage
PV, PVC & storage classes
RBAC
Role-based access control
HPA
Horizontal Pod Autoscaler
Debugging
Events & debugging
Manifests
Apply & manage YAML
Helm
Helm package manager
Install kubectl (macOS)
Install kubectl CLI using Homebrew on macOS
Install kubectl (Linux)
Install kubectl CLI on Linux using curl
Start local cluster with minikube
Start a local Kubernetes cluster using minikube
Verify cluster connection
Display cluster info to verify kubectl is connected
Show current context
Display the current kubectl context.
List all contexts
List all available contexts.
Switch context
Switch to a different cluster context.
Set default namespace
Set default namespace for current context.
View kubeconfig
Show merged kubeconfig settings.
View kubeconfig with secrets
Show kubeconfig with certificate data.
Get current namespace
Show the current default namespace.
Delete context
Remove a context from kubeconfig.
Rename context
Rename a context in kubeconfig.
List deployments
List all deployments in namespace.
Describe deployment
Show detailed deployment information.
Create deployment
Create a new deployment.
Scale deployment
Scale deployment to specified replicas.
Update deployment image
Update container image in deployment.
Rollout status
Monitor deployment rollout progress.
Rollout history
View deployment revision history.
Rollback deployment
Rollback to previous deployment version.
Rollback to specific revision
Rollback to a specific revision number.
Restart deployment
Trigger a rolling restart of all pods.
Pause rollout
Pause an ongoing deployment rollout.
Resume rollout
Resume a paused deployment rollout.
List services
List all services in namespace.
Describe service
Show detailed service information.
Create ClusterIP service
Create internal ClusterIP service.
Create NodePort service
Create NodePort service for external access.
Create LoadBalancer service
Create LoadBalancer service.
Expose deployment
Create service to expose a deployment.
Get service endpoints
Show pod IPs backing a service.
Port forward to pod
Forward local port to pod port.
Port forward to service
Forward local port to service port.
List namespaces
List all namespaces.
Create namespace
Create a new namespace.
Describe namespace
Show namespace details and resource quotas.
Delete namespace
Delete namespace and all its resources.
Get resources in namespace
List all resources in a namespace.
List secrets
List all secrets in namespace.
Create secret from literal
Create secret with key-value pair.
Create secret from file
Create secret from file contents.
Create TLS secret
Create TLS secret from certificate files.
Create Docker registry secret
Create secret for Docker registry auth.
Decode secret value
Decode and display secret value.
Decode all secrets
Decode and display all secret values.
List configmaps
List all configmaps in namespace.
Create configmap from literal
Create configmap with key-value pair.
Create configmap from file
Create configmap from a file.
Create configmap from directory
Create configmap from directory of files.
Get configmap data
View configmap contents as YAML.
List nodes
List all cluster nodes.
Get nodes with details
List nodes with IP and version info.
Describe node
Show detailed node information.
Node resource usage
Show CPU and memory usage per node.
Cordon node
Mark node as unschedulable.
Uncordon node
Mark node as schedulable again.
Drain node
Safely evict pods before maintenance.
Label node
Add label to a node.
Taint node
Add taint to node to repel pods.
Remove taint from node
Remove taint from a node.
Get worker nodes only
List only worker nodes (exclude control plane).
List ingresses
List all ingress resources.
Describe ingress
Show detailed ingress configuration.
Create ingress
Create an ingress rule.
Get ingress with class
List ingresses with their ingress class.
List jobs
List all jobs in namespace.
Create job
Create a job from command.
Get job logs
View logs from a job.
List cronjobs
List all cronjobs.
Create cronjob
Create a scheduled cronjob.
Trigger cronjob manually
Create a job from cronjob template.
List statefulsets
List all statefulsets.
Describe statefulset
Show detailed statefulset information.
Scale statefulset
Scale statefulset to specified replicas.
Rollout status statefulset
Monitor statefulset rollout progress.
List daemonsets
List all daemonsets.
Describe daemonset
Show detailed daemonset information.
Rollout status daemonset
Monitor daemonset rollout progress.
List persistent volumes
List all persistent volumes.
List persistent volume claims
List all persistent volume claims.
Describe PVC
Show detailed PVC information.
Get PV sorted by capacity
List persistent volumes sorted by size.
List storage classes
List available storage classes.
List roles
List all roles in namespace.
List cluster roles
List all cluster-wide roles.
List role bindings
List all role bindings in namespace.
Create role
Create a role with specific permissions.
Create role binding
Bind a role to a service account.
Check permissions
Check if you can perform an action.
Check permissions as user
Check permissions as another identity.
Who am I
Show current user/service account identity.
List service accounts
List all service accounts in namespace.
Create service account
Create a new service account.
List HPAs
List all horizontal pod autoscalers.
Describe HPA
Show detailed HPA information.
Create HPA
Create autoscaler for a deployment.
Get events sorted by time
List cluster events sorted by most recent.
Get warning events only
List only warning events.
Watch events
Watch events in real-time.
Cluster info
Display cluster endpoint information.
Cluster info dump
Dump cluster state for debugging.
API resources
List all available API resources.
Explain resource
Get documentation for resource fields.
Proxy API server
Start proxy to Kubernetes API server.
Debug pod copy with modifications
Create a copy of pod with modified container for debugging.
Debug node with privileged container
Debug a node by running privileged container on it.
Debug with target container
Debug pod by targeting specific container's namespaces.
Watch cluster events (kubectl 1.32+)
View cluster events with improved output format.
Stream events in real-time
Stream cluster events as they occur in real-time.
Filter warning events
Show only warning-level events for troubleshooting.
Apply manifest
Create or update resources from file.
Apply directory of manifests
Apply all manifests in a directory.
Apply from URL
Apply manifest directly from URL.
Dry run (client)
Validate manifest without applying.
Dry run (server)
Server-side validation without applying.
Diff manifest
Show what would change if applied.
Generate YAML from command
Generate YAML manifest from command.
Edit resource
Edit resource in default editor.
Patch resource
Patch resource with JSON merge patch.
Delete from manifest
Delete resources defined in manifest.
Wait for pod condition
Wait for specific condition to be met before proceeding.
Explain resource recursively
Show complete resource schema documentation with all fields.
Apply with automatic pruning
Apply manifests and automatically delete removed resources.
Force replace resource
Force replace resource by deleting and recreating it.
Add Helm repo
Add a Helm chart repository.
Update repos
Update Helm repository cache.
Search charts
Search for charts in repositories.
Install chart
Install a Helm chart.
Install with values
Install chart with custom values file.
Upgrade release
Upgrade a Helm release.
List releases
List installed Helm releases.
Uninstall release
Uninstall a Helm release.
Rollback release
Rollback to a previous revision.
Show chart values
Display chart's default values.
Template chart locally
Render chart templates locally.
Discussion
Loading comments...