Skip to content
Kubernetes

kubectl API Reference

kubectl command-line tool for deploying and inspecting applications on a Kubernetes cluster.

By EZ4Code Team

Commands

Subcommands used to create, query, update and debug Kubernetes resources.

kubectl apply -f file [-n namespace]

Creates or updates resources defined in a manifest file (declarative).

Returns: void

kubectl get type [name] [-o format] [-n namespace]

Lists one or more resources with basic status information.

Returns: void

kubectl describe type name [-n namespace]

Shows detailed, human-readable information about a specific resource including events.

Returns: void

kubectl delete (-f file | type name) [--grace-period=0]

Removes resources by file, name, label selector or all.

Returns: void

kubectl logs [-f] pod [-c container] [-n namespace]

Prints container logs. Follows logs with -f; selects a container when a pod has several.

Returns: void

kubectl exec [-it] pod -- command [args...]

Executes a command inside a container in a pod.

Returns: void

More Kubernetes API References