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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay