When adding Kubernetes components to a vRealize Automation Cloud Assembly blueprint, you can choose to add clusters or enable users to create namespaces in various configurations. Typically, this choice depends on your access control requirements, how you have configured your Kubernetes components, and your deployment requirements.

To add a Kubernetes component to a blueprint in vRealize Automation Cloud Assembly, click Blueprints, select New, and then locate and expand the Kubernetes option on the left menu. Then, make the desired selection, either Cluster or KBS Namespace by dragging it to the canvas.

Adding a Kubernetes cluster that is associated with a project to a blueprint is the most straightforward method of making Kubernetes resources available to valid users. You can use tags on clusters to control where they are deplyed just as you do with other Cloud Assembly resources. You can use tags to select a zone and a PKS plan during the allocation phase of cluster deployment.

Once you add a cluster in this way, it is automatically available to all valid users.

Blueprint Examples

The first blueprint example shows a blueprint for a simple Kubernetes deployment that is controlled by tagging. A Kubernetes zone was created with two deployment plans, configured on the New Kubernetes Zone page In this case, a tag called placement:tag was added as a capability on the zone, and it was used to match the analogous constraint on the blueprint. If there were more than one zone configured with the tag, the one with the lowest priority number would be selected.

formatVersion: 1
inputs: {}
resources:
  Cluster_provisioned_from_tag:
    type: Cloud.K8S.Cluster
    properties:
      hostname: 109.129.209.125
      constraints:
	-tag: 'placement tag'
      port: 7003
      workers: 1
      connectBy: hostname 

The second blueprint examples shows how to set up a blueprint with a variable called $(input.hostname) so that users can input the desired cluster hostname when requesting a deployment. Tags can also be used to select a zone and a PKS plan durring the resource allocation phase of cluster deployment.

formatVersion: 1
inputs:
  hostname:
    type: string
    title: Cluster hostname
resources:
  Cloud_K8S_Cluster_1:
    type: Cloud.K8S.Cluster
    properties:
      hostname: ${input.hostname}
      port: 8443
      connectBy: hostname
      workers: 1

If you want to use namespaces to mange cluster usage, you can set up a variable in the blueprint called name: ${input.name} to substitute for the namespace name which a user enters when requesting a deployment. For this sort of deployment, you would create a blueprint something like the following example:

1 formatVersion: 1
2 inputs:
3 name:
4    type: string
5    title: "Namespace name"
6 resources:
7    Cloud_KBS_Namespace_1:
8        type: Cloud.KBS.Namespace
9        properties:
10            name: ${input.name}

Users can manage deployed clusters via kubeconfig files that are accessible from the Infrastructure > Resources > Kubernetes Clusters page. Locate the card on the page for the desired cluster and click Kubeconfig.