There is a massive shift towards containerised applications. vRealize Automation supports provisioning Kubernetes Namespaces and deploying K8 clusters from Self-Service catalog in Service Broker. Kubernetes can also be used as an endpoint in Code Stream for deploying modern applications via delivery pipelines. While vRA provides native integration with PKS and RedHat OpenShift, it is also possible to add external clusters. In this blog, I will be exploring how to add the external cluster.

I have created a K8 cluster version 1.20 on Centos7 core and I have 1 master and 2 worker nodes. I have used Weavenet plugin to provide the pod network. Installation of the cluster is outside the scope of this article so I will not be addressing that.

in Cloud Assembly, under the Infrastructure tab, go to Resources > Kubernetes. Under the Clusters menu, click on ADD EXTERNAL.

On the next page, enter the name for your cluster. If you wish to share this cluster for all the projects, select Global for sharing. Otherwise, select Project and specify the project. After this add the Cluster Credentials.

The location of CA certificate is /etc/kubernetes/pki and the Public certificate and Private certificate can be found in the config file located at ~/.kube. Click Validate and then Add. This will add the Kubernetes cluster.

Once that is done, the kubernetes zone need to be configured. Under Infrastructure tab, go to Configure > Kubernetes Zones and click NEW KUBERNETES ZONE. Select the Account, fill in the Name of this zone and add any capability tags. On the clusters tab, add the cluster that we added above.

After adding the zone, we need to associate the zone to a project so we can provision clusters and namespaces. Under Infrastructure tab, select Administration > Projects and under the Kubernetes Provisioning menu select the Kubernetes Zone that we created above. If you have multiple zones, you can give them different provisioning priorities. Lower number has higher priority.

Thats it. The cluster is ready for provisioning. I will provision a Namespace with some limits for this demo. I have created the below Cloud Template for the provisioning of the Namespace called development.

formatVersion: 1
inputs: {}
resources:
  Cloud_K8S_Namespace_1:
    type: Cloud.K8S.Namespace
    properties:
      name: development
      limits:
        cpu: '200'
        memory: '900'
        pods: '100'

Once the Template is deployed, the Namespace can be seen under the K8 cluster. A Kubeconfig file also can be downloaded to connect to the Namespace.

In the cluster itself too we can see the new Namespace.

Happy Clustering !!!


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.