DEV Community

Nidhin BM
Nidhin BM

Posted on

Part 2.1 What Happens when you type kubectl command?- create namespace

Entry point https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubectl/pkg/cmd/create/create_namespace.go#L76

  • Complete completes all the required options
  • Validate validates required fields are set to support structured generation
  • Run calls the CreateSubcommandOptions.Run in NamespaceOpts instance
  • createNamespace outputs a namespace object using the configured fields
  • Then o.Client.Namespaces().Create(context.TODO(), namespace, createOptions) creates namespace

Next part staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go

Top comments (0)