Home

Kubectl Overview

tl;dr

Resources

ReferenceResource
podPods
svcServices
nsNamespaces
rsReplica Sets
deploymentDeployments
nodeCluster nodes
scStorage Class
pvcPersistent Volume Claim
secretsSecrets

Actions

CommandActionExample
getGet resourcekubectl get pods
describeDescribe resourcekubectl describe node <NODE>
deleteDelete resourcekubectl delete pod <POD>
createCreate resourcekubectl create ns <NAMESPACE>

Setting config

Example exporting to set the correct KUBECONFIG.

export KUBECONFIG=~/.kube/eksctl/clusters/cluster

Base fetching

ActionCommand
Rolebindingskubectl get rolebinds --namespace <namespace> --selector=<selector>
Podskubectl get pods --namespace <namespace> --selector=<selector>
Deploymentskubectl get deployments --namespace <namespace> --selector=<selector>
Serviceskubectl get svc --namespace <namespace> --selector=<selector>
Replica Setskubectl get replicasets --namespace <namespace> --selector=<selector>

All

ActionCommand
Get rolebindingskubectl get all --namespace <namespace> --selector=k8s-app=kubernetes-dashboard

Rolebindings

ActionCommand
Get rolebindingskubectl get rolebindings --namespace <namespace>
Describe rolebindingskubectl describe rolebindings --namespace <namespace>
Describe rolebindings for servicekubectl describe rolebindings <service account> --namespace <namespace>

Namespaces

ActionCommand
Create namespacekubectl create namespace <NAMESPACE>
Get namespacekubectl get namespace

Services

To do

Pods

To do

Deployments

Replica Sets