What is the significance of the -n flag in the kubectl command?

The -n flag in the kubectl command is used to specify the namespace in which the command should be executed. By default, kubectl operates in the "default" namespace unless another namespace is specified.

For example, if you want to list all pods in a specific namespace called "my-namespace", you would use the command:

kubectl get pods -n my-namespace

This allows you to manage resources in different namespaces within your Kubernetes cluster.

0 Comments

no data
Be the first to share your comment!