Use the namespace
object (in the cluster
plug-in) to provision and manage a Kubernetes namespace.
tanzu plugin install cluster --target mission-control
tanzu mission-control cluster namespace [command]
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.
tanzu mission-control cluster create [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")
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.
tanzu mission-control cluster namespace delete NAMESPACE_NAME [flags]
--cluster-name string name of the cluster
-m, --management-cluster-name string management cluster name
-p, --provisioner-name string provisioner name
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.
tanzu mission-control cluster namespace get NAMESPACE_NAME [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
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.
tanzu mission-control cluster namespace list [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.
tanzu mission-control cluster namespace template [command]
get Get Template for namespace
list List Templates for namespace
update
Update (overwrite) a namespace.
tanzu mission-control cluster namespace update [flags]
-f, --file string config file from which to update the namespace
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.