namespace

Use the namespace object (in the cluster plug-in) to provision and manage a Kubernetes namespace.

Installation

tanzu plugin install cluster --target mission-control 

Usage

tanzu mission-control cluster namespace [command]

Commands

  create      Create a namespace object
  delete      Delete a namespace
  get         Get details from a namespace
  list        Return a list of namespaces
  template    Namespace template
  update      Update (overwrite) a namespace

create

Create a namespace object.

Usage

tanzu mission-control cluster create [flags]

Flags

  -v, --data-values-file string   data values file to use
      --dry-run                   create the data model only, do not apply to server
  -f, --file string               Configuration file from which to create a namespace
  -t, --template string           template to use (default "default")

Example

To use the default template for creating a namespace and update values:

1) Create a YAML file with the fields to be changed like this:

**test_values.yaml** :
  Name: test-ns
  Labels: env:staging
  Description: Test namespace

2) Run the following command and provide the path to your YAML file:

  tanzu mission-control cluster namespace create --template default --data-values-file test_values.yaml

delete

Delete a namespace.

Usage

  tanzu mission-control cluster namespace delete NAMESPACE_NAME [flags]

Flags

      --cluster-name string              name of the cluster
  -m, --management-cluster-name string   management cluster name
  -p, --provisioner-name string          provisioner name

Example

To delete a namespace named test-ns in cluster test with management-cluster and provisioner as attached:

tanzu mission-control cluster namespace delete test-ns --cluster-name test -m attached -p attached

get

Get details from a namespace.

Usage

  tanzu mission-control cluster namespace get NAMESPACE_NAME [flags]

Flags

      --cluster-name string              name of the cluster
  -m, --management-cluster-name string   name of the management cluster
  -o, --output string                    output format (yaml | json) (default "yaml")
  -p, --provisioner-name string          name of the provisioner

Example

To get the contents of the test-ns namespace in cluster test with management-cluster and provisioner as attached in YAML format:

tanzu mission-control cluster namespace get test-ns --cluster-name test -m attached -p attached -o yaml

list

Return a list of namespaces.

Usage

  tanzu mission-control cluster namespace list [flags]

Flags

      --cluster-name string              scope search to the specified cluster name
  -m, --management-cluster-name string   management cluster name for the namespace
      --max-size uint                    number of records to return
      --name string                      scope search to the specified name
      --offset uint                      offset at which to start returning records
  -o, --output string                    output format (yaml|json)
  -p, --provisioner-name string          provisioner name for the namespace
      --workspace-name string            filter by workspace name

template

Namespace template.

Usage

  tanzu mission-control cluster namespace template [command]

Commands

  get         Get Template for namespace
  list        List Templates for namespace

update

Update (overwrite) a namespace.

Usage

  tanzu mission-control cluster namespace update [flags]

Flags

  -f, --file string   config file from which to update the namespace

Example

To update a namespace:
1. Fetch the resource file by running tanzu mission-control cluster namespace get.
1. Update the required fields in the resource file.
1. Then run tanzu mission-control cluster namespace update using the updated resource file.

check-circle-line exclamation-circle-line close-line
Scroll to top icon