Kubernetes Commands

Kubernetes Commands

Basic Commands

kubectl run

The kubectl run command is used to run a container from an image. The command will pull the image from the registry if it is not already present on the host.

kubectl run <image>

kubectl get pods

The kubectl get pods command is used to list the running pods on the host.

kubectl get pods

kubectl get pods -a

The kubectl get pods -a command is used to list all pods on the host.

kubectl get pods -a

kubectl get services

The kubectl get services command is used to list the running services on the host.

kubectl get services

kubectl get services -a

The kubectl get services -a command is used to list all services on the host.

kubectl get services -a

kubectl get deployments

The kubectl get deployments command is used to list the running deployments on the host.

kubectl get deployments

kubectl get deployments -a

The kubectl get deployments -a command is used to list all deployments on the host.

kubectl get deployments -a

kubectl get nodes

The kubectl get nodes command is used to list the running nodes on the host.

kubectl get nodes

kubectl get nodes -a

The kubectl get nodes -a command is used to list all nodes on the host.

kubectl get nodes -a

kubectl get namespaces

The kubectl get namespaces command is used to list the running namespaces on the host.

kubectl get namespaces

kubectl get namespaces -a

The kubectl get namespaces -a command is used to list all namespaces on the host.

kubectl get namespaces -a

kubectl get configmaps

The kubectl get configmaps command is used to list the running configmaps on the host.

kubectl get configmaps

kubectl get configmaps -a

The kubectl get configmaps -a command is used to list all configmaps on the host.

kubectl get configmaps -a

kubectl get secrets

The kubectl get secrets command is used to list the running secrets on the host.

kubectl get secrets

kubectl get secrets -a

The kubectl get secrets -a command is used to list all secrets on the host.

kubectl get secrets -a

kubectl get pv

The kubectl get pv command is used to list the running persistent volumes on the host.

kubectl get pv

kubectl get pv -a

The kubectl get pv -a command is used to list all persistent volumes on the host.

kubectl get pv -a

kubectl get pvc

The kubectl get pvc command is used to list the running persistent volume claims on the host.

kubectl get pvc

kubectl get pvc -a

The kubectl get pvc -a command is used to list all persistent volume claims on the host.

kubectl get pvc -a

kubectl get jobs

The kubectl get jobs command is used to list the running jobs on the host.

kubectl get jobs

kubectl get jobs -a

The kubectl get jobs -a command is used to list all jobs on the host.

kubectl get jobs -a

kubectl get cronjobs

The kubectl get cronjobs command is used to list the running cronjobs on the host.

kubectl get cronjobs

kubectl get cronjobs -a

The kubectl get cronjobs -a command is used to list all cronjobs on the host.

kubectl get cronjobs -a

kubectl get endpoints

The kubectl get endpoints command is used to list the running endpoints on the host.

kubectl get endpoints

kubectl get endpoints -a

The kubectl get endpoints -a command is used to list all endpoints on the host.

kubectl get endpoints -a

kubectl get events

The kubectl get events command is used to list the running events on the host.

kubectl get events

kubectl get events -a

The kubectl get events -a command is used to list all events on the host.

kubectl get events -a

kubectl get componentstatuses

The kubectl get componentstatuses command is used to list the running component statuses on the host.

kubectl get componentstatuses

kubectl get componentstatuses -a

The kubectl get componentstatuses -a command is used to list all component statuses on the host.

kubectl get componentstatuses -a

kubectl get daemonsets

The kubectl get daemonsets command is used to list the running daemonsets on the host.

kubectl get daemonsets

kubectl get daemonsets -a

The kubectl get daemonsets -a command is used to list all daemonsets on the host.

kubectl get daemonsets -a

kubectl get replicasets

The kubectl get replicasets command is used to list the running replicasets on the host.

kubectl get replicasets

kubectl get replicasets -a

The kubectl get replicasets -a command is used to list all replicasets on the host.

kubectl get replicasets -a

kubectl get statefulsets

The kubectl get statefulsets command is used to list the running statefulsets on the host.

kubectl get statefulsets

kubectl get statefulsets -a

The kubectl get statefulsets -a command is used to list all statefulsets on the host.

kubectl get statefulsets -a

kubectl get ingress

The kubectl get ingress command is used to list the running ingress on the host.

kubectl get ingress

kubectl get ingress -a

The kubectl get ingress -a command is used to list all ingress on the host.

kubectl get ingress -a

kubectl get networkpolicies

The kubectl get networkpolicies command is used to list the running networkpolicies on the host.

kubectl get networkpolicies

kubectl get networkpolicies -a

The kubectl get networkpolicies -a command is used to list all networkpolicies on the host.

kubectl get networkpolicies -a

kubectl get podsecuritypolicies

The kubectl get podsecuritypolicies command is used to list the running podsecuritypolicies on the host.

kubectl get podsecuritypolicies

kubectl get podsecuritypolicies -a

The kubectl get podsecuritypolicies -a command is used to list all podsecuritypolicies on the host.

kubectl get podsecuritypolicies -a

kubectl get poddisruptionbudgets

The kubectl get poddisruptionbudgets command is used to list the running poddisruptionbudgets on the host.

kubectl get poddisruptionbudgets

kubectl get poddisruptionbudgets -a

The kubectl get poddisruptionbudgets -a command is used to list all poddisruptionbudgets on the host.

kubectl get poddisruptionbudgets -a

kubectl get priorityclasses

The kubectl get priorityclasses command is used to list the running priorityclasses on the host.

kubectl get priorityclasses

kubectl get priorityclasses -a

The kubectl get priorityclasses -a command is used to list all priorityclasses on the host.

kubectl get priorityclasses -a

kubectl get podtemplates

The kubectl get podtemplates command is used to list the running podtemplates on the host.

kubectl get podtemplates

kubectl get podtemplates -a

The kubectl get podtemplates -a command is used to list all podtemplates on the host.

kubectl get podtemplates -a