What are the three kinds of object management supported in Kubernetes?

Experience Level: Junior
Tags: Kubernetes

Answer

  • Imperative commands
  • Imperative object configuration
  • Declarative object configuration

Very often you generate a manifest using an imperative command together with --dry-run=client parameter and then further tweak it using an editor. Once finished, you apply the changes.

Example:

Run the following to generate a pod manifest.

kubectl run mypod --image=nginx --dry-run=client -o yaml > file.yaml

Run the following to open the pod manifest in an editor:

nano file.yaml

Apply the changes by running the following command:

kubectl apply -f file.yaml

The above technique will also allow you to get back to the manifest if needed. You can always delete the resoruce (pod), modify the manifest and recreate it again using the modified version.

Comments

No Comments Yet.
Be the first to tell us what you think.
Kubernetes Certified Application Developer (CKAD) preparation
Kubernetes Certified Application Developer (CKAD) preparation

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes
Kubernetes

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
25 Kubernetes questions that will help you get certified and become more efficient with K8s
25 Kubernetes questions that will help you get certified and become more efficient with K8s

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself