As a cluster administrator, you can use Tanzu Mission Control to add a kustomization to a cluster or cluster group that has continuous delivery enabled on it.
Prerequisites
Log in to the Tanzu Mission Control console, as described in Log In to the Tanzu Mission Control Console.
- To create a kustomization, you must be associated with the cluster.admin or clustergroup.admin role.
Make sure you have already enabled continuous delivery for the cluster, as described in Enable Continuous Delivery for a Cluster or Cluster Group,and defined a Git repository, as described in Add a Git Repository to a Cluster or Cluster Group.
For Tanzu Kubernetes Grid Service clusters running in vSphere with Tanzu that have pod security policies, make sure you have the appropriate role bindings on the workload cluster. Without the appropriate permissions, kustomizations can fail to be deployed. For information about creating role bindings, see Example Role Bindings for Pod Security Policy in the vSphere with Tanzu Configuration and Management documentation.
Procedure
- Navigate to the detail page for the cluster or cluster group to which you want to add a kustomization.
- Click the Add-ons tab.
- In the Add-ons menu click Kustomizations in the Continuous Delivery section.
- Click Add kustomization.
- On the Add kustomization page, enter a name for the kustomization.
- You can optionally provide a description for the kustomization.
- Select the Git repository you want to use for the kustomization.
- Specify the path of the kustomization from the root of the Git repository to the folder containing the kustomization file.
- You can optionally expand the Advanced settings section to specify more options.
- Specify a target namespace.
The target namespace indicates the namespace for objects that are created as part of the kustomization.If you specify a target namespace, that namespace must already exist on the cluster or it must be defined in a manifest included in the kustomization. If it does not exist, applying the kustomization fails.
- If you defined a target namespace in a manifest and also specify one in TMC, then the value defined in the manifest takes precedence.
- If you did not define a target namespace in a manifest and you do not specify one in TMC, then the kustomization is added to the default namespace.
- Click to toggle Prune on or off.
If you configure the kustomization to prune (toggled on), the resources on the cluster that were created through this kustomization are deleted when the kustomization is removed from the cluster. Resources created before prune is enabled are not deleted when the kustomization is removed.
- Specify a target namespace.
- After you finish configuring the kustomization, click Add kustomization.