Welcome to the Linux Foundation Forum!

Office hours - Jan 9 (LFS258)

Options

Hi,

Today we had a short chat to clarify whether the kubectl apply and kubectl create commands can be used interchangeably to generate deployments, services, secrets, configmaps, etc. imperatively.

They cannot. The kubectl create command can be used imperatively to generate a limited set of Kubernetes resources. The kubectl run command is reserved to run application pods imperatively.

However, both kubectl apply and kubectl create overlap in functionality when generating new Kubernetes resources declaratively from definition manifests.

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#create

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply

Regards,
-Chris

Categories

Upcoming Training