skip to Main Content

When we run the below command from root user in kubernetes master node:

  • kubectl create deployment nginx –image=nginxD

on which path the yaml file gets stored ?

  • kubectl get deployment nginx -o yaml

from which path it provides us the yaml body ?

2

Answers


  1. It’s never going to create any yaml. It’s create a deployment. when you run this kubectl get deployment nginx -o yaml. The deployment just showed in yaml format.

    Login or Signup to reply.
  2. Raw k8s stores everything within etcd. When running commands like kubectl get deployment nginx -o yaml kubectl talks to the kubeapi which talks to etcd to get the yaml for you.

    etcd is a key-value store so any kubectl get XYZ is reading a specific key. Any kubectl create XYZ is creating a new key/value within etcd.

    Because of the importance of etcd within k8s, it is heavily recommended you back it up in production environments.

    The components and how they talk to everything can be found here: https://kubernetes.io/docs/concepts/overview/components/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search