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.
Run the following to open the pod manifest in an editor:
Apply the changes by running the following command:
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.
Related Kubernetes job interview questions
How do you create a Kubernetes job job1 with image busybox that will be executed 3 times and maximum of 2 job instances will run in parallel? The command executed in a job should be sleep 10 && echo "Hello world"
Kubernetes MediorHow can you display a list of Kubernetes pods that will automatically rerender when a pod status changes?
Kubernetes JuniorHow do you create a temporary pod and verify a http connectivity to a service svc1 that exposed a port 80?
Kubernetes SeniorHow do you create a service svc1 from a Kubernetes pod pod1? The service should use a tcp port redirection of 8080:80.
Kubernetes SeniorWhat is privileged setting of securityContext used for in Kubernetes container manifest?
Kubernetes Senior