Plugin for operating clusters in the organization
Three Tanzu CLI plugins provide commands under tanzu cluster
based on different targets:
kubernetes
target: see tanzu clusteroperations
target: see belowmission-control
target: see cluster in the Tanzu Mission Control Pug-ins documentationCLI plugin: cluster
| Target: operations
| Primarily used for: Platform operations | Release Notes
Syntax:
tanzu operations cluster [command]
attach Attach an existing cluster
create Create a cluster
delete Delete a cluster
extension Cluster addons for the platform.
get Get details from a cluster
kubeconfig Service fetches kubeconfig for clusters
list List clusters
logs Archive the logs of Tanzu Mission Control components present in the cluster
managed-resources Managed kubernetes resources
reattach Reattach an existing cluster
template Policy CLI template
update Update (overwrite) a cluster
validate Prints report of components present in the cluster
-h, --help help for cluster command
attach
Attach an existing cluster
tanzu operations cluster attach [flags]
--continue-bootstrap continue bootstrap to apply the Tanzu Mission Control resource manifest to complete attaching
-f, --file string resource file from which to attach the cluster
--force clean up the Tanzu Misson Control resources of a partially detached/attached cluster
-k, --kubeconfig string the kubeconfig file of the actual cluster to use for applying the Tanzu Mission Control resource manifest
-n, --name string name of the cluster. Used in conjunction with --continue-bootstrap flag
-o, --output string output file to write the Tanzu Mission Control resource manifest (default "k8s-attach-manifest.yaml")
--skip-verify skip the post-flight checks that confirms if the cluster attach was successful
$ cat cluster_attach.yaml
fullName:
managementClusterName: attached
provisionerName: attached
name: cluster1
meta:
description: Attaching cluster using tanzu cli
spec:
clusterGroupName: cgroup1
$ tanzu operations cluster attach --file cluster_attach.yaml --kubeconfig /path/to/kubeconfig.yaml
running pre-flight checks
cluster "cluster1" is being created
Resources applied to the cluster successfully
running post-flight attach checks
cluster cluster1 successfully attached
create
Create a cluster
tanzu operations 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 Resource file from which to create a cluster
-t, --template string template to use (default "default")
delete
Delete a cluster
tanzu operations cluster delete CLUSTER_NAME [flags]
-t, --cluster-type string type of the cluster (eks/attached)
-f, --force force delete a cluster
$ tanzu operations cluster delete cluster1 --cluster-type attached
Deleting cluster...
Cluster is being detached
extension
Cluster addons for the platform.
tanzu operations cluster extension [command]
get Retrieve an extension object
list Return a list of extensions
extension get
Retrieve an extension object
tanzu operations cluster extension get EXTENSION_NAME [flags]
--cluster-name string name of the cluster
-t, --cluster-type string type of the cluster (eks/attached)
-o, --output string output format (yaml | json) (default "yaml")
extension list
Return a list of extensions
tanzu operations cluster extension list [flags]
--cluster-name string scope search to the specified cluster name
-t, --cluster-type string type of the cluster (eks/attached)
--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)
get
Get details from a cluster
tanzu operations cluster get CLUSTER_NAME [flags]
-t, --cluster-type string type of the cluster (eks/attached)
-o, --output string Output format (yaml | json) (default "yaml")
$ tanzu operations cluster get cluster1 --cluster-type attached
fullName:
managementClusterName: attached
name: cluster1
orgId: <id>
provisionerName: attached
meta:
annotations:
authoritativeRID: rid:c:<id>:attached:attached:cluster1
creationtime: "<timestamp>"
description: Attaching cluster using Tanzu CLI
labels:
tmc.cloud.vmware.com/creator: samlee
parentReferences:
- rid: rid:cg:<id>:default
uid: cg:<id>
- rid: rid:prvn:<id>:attached:attached
uid: prvn:<id>
resourceVersion: "471"
kubeconfig
Service fetches kubeconfig for clusters
tanzu operations cluster kubeconfig [command]
get Get cluster kubeconfig.
kubeconfig get
Get cluster kubeconfig.
tanzu operations cluster kubeconfig get CLUSTER_AGENT_NAME [flags]
-t, --cluster-type string type of the cluster (eks/attached) (default "eks")
-n, --namespace string get kubeconfig for specific namespace
list
List clusters
tanzu operations cluster list [flags]
-t, --cluster-type string type of the cluster (eks/attached)
--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)
-q, --query string tql to query the stores
$ tanzu operations cluster list
name MANAGEMENTCLUSTER PROVISIONER LABELS
cluster1 attached attached tmc.cloud.vmware.com/creator:samlee
cluster2 eks eks tmc.cloud.vmware.com/creator:samlee
cluster1 eks eks tmc.cloud.vmware.com/creator:samlee
logs
Archive the logs of Tanzu Mission Control components present in the cluster
tanzu operations cluster logs [flags]
-k, --kubeconfig string the kubeconfig file of the cluster managed by Tanzu Mission Control
-o, --output string the output directory to save logs (default temp directory)
managed-resources
Managed Kubernetes resources
tanzu operations cluster managed-resources [command]
list lists all the tmc managed resources
retain retain tmc managed resources
managed-resources list
List all the TMC-managed resources
tanzu operations cluster managed-resources list [flags]
-k, --kubeconfig string config file of cluster monitored via TMC
managed-resources retain
Retain TMC-managed resources
tanzu operations cluster managed-resources retain [command]
-k, --kubeconfig string config file of cluster monitored via TMC
-n, --namespace string namespace of the resource to be retained
reattach
Reattach an existing cluster
tanzu operations cluster reattach CLUSTER_NAME [flags]
-t, --cluster-type string type of the cluster (eks/attached)
--image-registry string name of the image registry to be used for the cluster. If set empty, no image registry config will be used. If left unset, existing image registry config will be used. (default "use-default")
-k, --kubeconfig string the kubeconfig file of the actual cluster to use for applying the Tanzu Mission Control resource manifest
--proxy-name string name of the proxy config to be used for the cluster. if empty, original proxy config (if any) will be picked
--skip-verify skip the post-flight checks that confirms if the cluster re-attach was successful
--use-proxy use proxy config for the cluster
template
Policy CLI template
tanzu operations cluster template [command]
get Get CLI template for policy
list List CLI templates for policy (filter using policy-type)
template get
Get CLI template for policy
tanzu operations cluster template get TEMPLATE_NAME [flags]
-t, --policy-type string policy type as custom-policy|image-policy|namespace-quota-policy|network-policy|security-policy
template list
List CLI templates for policy (filter using policy-type)
tanzu operations cluster template list [flags]
-t, --policy-type string policy type as custom-policy|image-policy|namespace-quota-policy|network-policy|security-policy
update
Update (overwrite) a cluster
tanzu operations cluster update [flags]
-f, --file string resource file from which to update the cluster
validate
Prints report of components present in the cluster
tanzu operations cluster validate [flags]
-k, --kubeconfig string config file of cluster monitored via TMC