Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias k='kubectl' # The kubectl command
- alias kca='kubectl --all-namespaces' # The kubectl command targeting all namespaces
- alias kaf='kubectl apply -f' # Apply a YML file
- alias keti='kubectl exec -ti' # Drop into an interactive terminal on a container
- # Manage configuration quickly to switch contexts between local, dev and staging
- alias kcuc='kubectl config use-context' # Set the current-context in a kubeconfig file
- alias kcsc='kubectl config set-context' # Set a context entry in kubeconfig
- alias kcdc='kubectl config delete-context' # Delete the specified context from the kubeconfig
- alias kccc='kubectl config current-context' # Display the current-context
- # General aliases
- alias kdel='kubectl delete' # Delete resources by filenames, stdin, resources and names, or by resources and label selector
- alias kdelf='kubectl delete -f' # Delete a pod using the type and name specified in -f argument
- # Pod management
- alias kgp='kubectl get pods' # List all pods in ps output format
- alias kgpw='kgp --watch' # After listing/getting the requested object, watch for changes
- alias kgpwide='kgp -o wide' # Output in plain-text format with any additional information. For pods, the node name is included
- alias kep='kubectl edit pods' # Edit pods from the default editor
- alias kdp='kubectl describe pods' # Describe all pods
- alias kdelp='kubectl delete pods' # Delete all pods matching passed arguments
- alias kgpl='kgp -l' # Get pod by label. Example: kgpl "app=myapp" -n myns
- # Service management
- alias kgs='kubectl get svc' # List all services in ps output format
- alias kgsw='kgs --watch' # After listing all services, watch for changes
- alias kgswide='kgs -o wide' # After listing all services, output in plain-text format with any additional information
- alias kes='kubectl edit svc' # Edit services(svc) from the default editor
- alias kds='kubectl describe svc' # Describe all services in detail
- alias kdels='kubectl delete svc' # Delete all services matching passed argument
- # Ingress management
- alias kgi='kubectl get ingress' # List ingress resources in ps output format
- alias kei='kubectl edit ingress' # Edit ingress resource from the default editor
- alias kdi='kubectl describe ingress' # Describe ingress resource in detail
- alias kdeli='kubectl delete ingress' # Delete ingress resources matching passed argument
- # Namespace management
- alias kgns='kubectl get namespaces' # List the current namespaces in a cluster
- alias kcn='kubectl config set-context --current' # Change current namespace
- alias kens='kubectl edit namespace' # Edit namespace resource from the default editor
- alias kdns='kubectl describe namespace' # Describe namespace resource in detail
- alias kdelns='kubectl delete namespace' # Delete the namespace. WARNING! This deletes everything in the namespace
- # ConfigMap management
- alias kgcm='kubectl get configmaps' # List the configmaps in ps output format
- alias kecm='kubectl edit configmap' # Edit configmap resource from the default editor
- alias kdcm='kubectl describe configmap' # Describe configmap resource in detail
- alias kdelcm='kubectl delete configmap' # Delete the configmap
- # Secret management
- alias kgsec='kubectl get secret' # Get secret for decoding
- alias kdsec='kubectl describe secret' # Describe secret resource in detail
- alias kdelsec='kubectl delete secret' # Delete the secret
- # Deployment management
- alias kgd='kubectl get deployment' # Get the deployment
- alias kgdw='kgd --watch' # After getting the deployment, watch for changes
- alias kgdwide='kgd -o wide' # After getting the deployment, output in plain-text format with any additional information
- alias ked='kubectl edit deployment' # Edit deployment resource from the default editor
- alias kdd='kubectl describe deployment' # Describe deployment resource in detail
- alias kdeld='kubectl delete deployment' # Delete the deployment
- alias ksd='kubectl scale deployment' # Scale a deployment
- alias krsd='kubectl rollout status deployment' # Check the rollout status of a deployment
- alias kres='kubectl set env' # Recreate all pods in deployment with zero-downtime
- # Rollout management
- alias kgrs='kubectl get rs' # To see the ReplicaSet rs created by the deployment
- alias krh='kubectl rollout history' # Check the revisions of this deployment
- alias kru='kubectl rollout undo' # Rollback to the previous revision
- # Port forwarding
- alias kpf='kubectl port-forward' # Forward one or more local ports to a pod
- # Tools for accessing all information
- alias kga='kubectl get all' # List all resources in ps format
- alias kgaa='kubectl get all --all-namespaces' # List the requested object(s) across all namespaces
- # Logs
- alias kl='kubectl logs' # Print the logs for a container or resource
- alias klf='kubectl logs -f' # Stream the logs for a container or resource (follow)
- # File copy
- alias kcp='kubectl cp' # Copy files and directories to and from containers
- # Node management
- alias kgno='kubectl get nodes' # List the nodes in ps output format
- alias keno='kubectl edit node' # Edit nodes resource from the default editor
- alias kdno='kubectl describe node' # Describe node resource in detail
- alias kdelno='kubectl delete node' # Delete the node
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement