Using vRA to deploy AWS EKS Clusters and register with Tanzu Mission Control
Tags: vmware, kubernetes, aws, codestream
Published: 2021-05-11 07:49:42

---
title: Using vRA to deploy AWS EKS Clusters and register with Tanzu Mission Control
published: true
date: 2021-05-10 22:39:52 UTC
tags: VMware,Kubernetes,AWS,CodeStream
canonical_url: https://veducate.co.uk/vra-deploy-eks-tmc/?utm_source=rss&utm_medium=rss&utm_campaign=vra-deploy-eks-tmc
---

This walk-through will detail the technical configurations for using vRA Code Stream to deploy [AWS EKS Clusters](https://aws.amazon.com/eks), register them as Kubernetes endpoints in vRA Cloud Assembly and Code Stream, and finally register the newly created cluster in [Tanzu Mission Control](https://veducate.co.uk/vmware-tanzu-mission-control-getting-started/).

##### Requirement

Tanzu Mission Control has some fantastic capabilities, including the ability to deploy Tanzu Kubernetes Clusters to various platforms (vSphere, AWS, Azure). However today there is no support to provision native AWS EKS clusters, it can however manage most Kubernetes distributions.

Therefore, when I was asked about where VMware could provide such capabilities, my mind turned to the ability to deploy the clusters using vRA Code Stream, and provide additional functions on making these EKS usable.

##### High Level Steps

- Create a Code Stream Pipeline
  - Create a AWS EKS Cluster
  - Create EKS cluster as endpoint in both Code Stream and Cloud Assembly
  - Register EKS cluster in Tanzu Mission Control

##### Pre-Requisites

- vRA Cloud access
  - The pipeline can be changed easily for use with vRA on-prem
- AWS Account that can provision EKS clusters
  - And basic knowledge of deploying EKS cluster
  - This is a [good beginners guide](https://vzilla.co.uk/vzilla-blog/getting-started-with-amazon-elastic-kubernetes-service-amazon-eks) if you need
- A Docker host to be used by Code Stream
  - Ability to run the container image: [saintdle/aws-k8s-ci](https://hub.docker.com/r/saintdle/aws-k8s-ci)
- Tanzu Mission Control account that can register new clusters
- [VMware Cloud Console Tokens](https://docs.vmware.com/en/VMware-Cloud-services/services/Using-VMware-Cloud-Services/GUID-E2A3B1C1-E9AD-4B00-A6B6-88D31FCDDF7C.html) for vRA Cloud and Tanzu Mission Control API access
- The configuration files for the pipeline can be [found in this GitHub repository](https://github.com/saintdle/vRA-Deploy-EKS-Clusters)

##### Creating a Code Stream Pipeline to deploy a AWS EKS Cluster and register the endpoints with vRA and Tanzu Mission Control

###### Create the variables to be used

First, we will create several variables in Code Stream, you could change the pipeline tasks to use inputs instead if you wanted.

- Create as regular variable
  - eks-tmc-url
    - This is your Tanzu Mission Control URL
- Create as secret
  - eks\_aws\_access\_key\_id
    - IAM Access Key for your AWS user
  - eks\_aws\_secret\_access\_key
    - IAM Secret for your AWS user
  - eks-tmc-token
    - VMware Cloud Console token for access to use Tanzu Mission Control
  - eks-vra-token
    - VMware Cloud Console token for access to use vRealize Automation Cloud

```
Note: Sorry I noticed I mixed the use of hyphens and underscores in the variables
```

[![vRA EKS - Create variables](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Create-variables.jpg?resize=604%2C434&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Create-variables.jpg?ssl=1)

###### Import the Pipeline “Deploy EKS Cluster”

Create (import) the pipeline in Code Stream. ([File here](https://github.com/saintdle/vRA-Deploy-EKS-Clusters/blob/master/Code%20Stream/Deploy%20EKS%20Cluster.yaml)). Set line two to your project name then click import.

[![vRA EKS - Import pipeline](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Import-pipeline.jpg?resize=604%2C531&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Import-pipeline.jpg?ssl=1)

Open the pipeline.

[![vRA EKS - Open pipeline](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Open-pipeline.jpg?resize=292%2C383&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Open-pipeline.jpg?ssl=1)

Go to the Workspace tab and set your Docker Host. Make any changes to the image registry and container image as you need (such as for air gap usage).

[![vRA EKS - Edit pipeline - workspace - docker host](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Edit-pipeline-workspace-docker-host.jpg?resize=604%2C265&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Edit-pipeline-workspace-docker-host.jpg?ssl=1)

On the Input tab, set the default value as needed. I’ve tried to provide good descriptions for each input that is used by the pipeline.

[![vRA EKS - Edit pipeline - Input](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Edit-pipeline-Input.jpg?resize=604%2C304&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Edit-pipeline-Input.jpg?ssl=1)

On the Model tab, select each task and click the validate button, ensure you get a green tick. If there are any errors displayed, resolve them. Usually, it’s the referenced variable names do not match.

You can also explore each of the tasks and make any changes you feel necessary.

[![vRA EKS - Edit pipeline - Model - validate tasks](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Edit-pipeline-Model-validate-tasks.jpg?resize=604%2C300&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Edit-pipeline-Model-validate-tasks.jpg?ssl=1)

When you are happy, click save on the bottom left. Then enable the pipeline.

[![vRA EKS - Enable Pipeline](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Enable-Pipeline.jpg?resize=525%2C124&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Enable-Pipeline.jpg?ssl=1)

##### Running the pipeline

Now the pipeline is enabled, you will be able to run the pipeline.

[![vRA EKS - Run Pipeline](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline.jpg?resize=525%2C192&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline.jpg?ssl=1)

Fill out the inputs and click run.

[![vRA EKS - Run Pipeline - Inputs](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-Inputs.jpg?resize=546%2C1043&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-Inputs.jpg?ssl=1)

Click to view the running execution of the pipeline.

[![vRA EKS - Run Pipeline - View Execution](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-View-Execution.jpg?resize=604%2C81&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-View-Execution.jpg?ssl=1)

Below you can see the output of the first stage and task running. You can click each stage and task to see the progress and outputs from running the commands.

[![vRA EKS - Run Pipeline - View Execution - Build EKS Cluster output](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-View-Execution-Build-EKS-Cluster-output.jpg?resize=604%2C352&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-View-Execution-Build-EKS-Cluster-output.jpg?ssl=1)

Once the pipeline has completed, you’ll see an output all green like the below screenshot.

[![vRA EKS - Run Pipeline - View Execution - Build EKS Cluster - Completed](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-View-Execution-Build-EKS-Cluster-Completed.jpg?resize=604%2C53&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Run-Pipeline-View-Execution-Build-EKS-Cluster-Completed.jpg?ssl=1)

And finally, you’ll have the following items created and configured.

- EKS Cluster
- Cloud Assembly – External Kubernetes Endpoint
- Code Stream – Kubernetes Endpoint
- Tanzu Mission Control – Kubernetes cluster attached

[![eksctl get cluster](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/eksctl-get-cluster.jpg?resize=546%2C95&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/eksctl-get-cluster.jpg?ssl=1)

[![vRA EKS - Cloud Assembly - Kubernetes Endpoint](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Cloud-Assembly-Kubernetes-Endpoint.jpg?resize=604%2C560&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Cloud-Assembly-Kubernetes-Endpoint.jpg?ssl=1)

[![vRA EKS - Code Stream - Kubernetes Endpoint](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Code-Stream-Kubernetes-Endpoint.jpg?resize=604%2C486&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Code-Stream-Kubernetes-Endpoint.jpg?ssl=1)

[![vRA EKS - Tanzu Mission Control - Attached Cluster](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Tanzu-Mission-Control-Attached-Cluster.jpg?resize=604%2C124&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/05/vRA-EKS-Tanzu-Mission-Control-Attached-Cluster.jpg?ssl=1)

##### Wrap up

So for this pipeline, I did create [my own container image](https://github.com/saintdle/aws-k8s-ci) with all the tools I needed to make life easier. You could also use a simple container, and download/install all the tools you need as your first CI task if you wanted.

When you break down the various tasks, it’s all pretty simple and you could follow most of the same steps through the terminal on your local machine.

Hopefully you found this useful.

Regards

[Follow @Saintdle](https://twitter.com/saintdle)<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

[Dean Lewis](https://uk.linkedin.com/in/saintdle?trk=profile-badge)

 

The post [Using vRA to deploy AWS EKS Clusters and register with Tanzu Mission Control](https://veducate.co.uk/vra-deploy-eks-tmc/) appeared first on [vEducate.co.uk](https://veducate.co.uk).