Skip to content

Latest commit

 

History

History
133 lines (88 loc) · 2.05 KB

File metadata and controls

133 lines (88 loc) · 2.05 KB

Kubectl Command Cheatsheet

Kubectl is the command line configuration tool for Kubernetes that communicates with a Kubernetes API server. Using kubectl allows you to create, inspect, update, and delete Kubernetes objects.

Cluster Management

Display endpoint information about the master and services in the cluster

kubectl cluster-info

Display the Kubernetes version running on the client and server

kubectl version

Get the configuration of the cluster

kubectl config view

List the API resources that are available

kubectl api-resources

List the API versions that are available

kubectl api-versions

List all the namespace

kubectl get all --all-namespaces

Daemonsets

Shortcode = ds

List one or more daemonsets

kubectl get daemonset

Edit and update the definition of one or more daemonset

kubectl edit daemonset <daemonset_name>

Delete a daemonset

kubectl delete daemonset <daemonset_name>

Create a new daemonset

kubectl create daemonset <daemonset_name>

Manage the rollout of a daemonset

kubectl rollout daemonset

Display the detailed state of daemonsets within a namespace

kubectl describe ds <daemonset_name> -n <namespace_name>

Deployments

Shortcode = deploy

List one or more deployments

kubectl get deployment

Display the detailed state of one or more deployments

kubectl describe deployment <deployment_name>

Edit and update the definition of one or more deployment on the server

kubectl edit deployment <deployment_name>

Create one a new deployment

kubectl create deployment <deployment_name>

Delete deployments

kubectl delete deployment <deployment_name>

See the rollout status of a deployment

kubectl rollout status deployment <deployment_name>