TKG on AWS: Part1 | Preparation/Boot Node

--

In this article, we are going to see how to install and prepare a node to trigger deployment of TKG clusters on AWS.

Source from VMware Documentation

Follow below steps to install ubuntu based preparation node on AWS,

Step1: Log in to AWS console and search for EC2 (Elastic Cloud Compute) or You can also find EC2 under AWS services

Step2: Click on launch instance

Step3: Search for Ubuntu AMI (Amazon Machine Image)

Select 1st AMI i.e Ubuntu Server 20.04LTS (HVM) 64 bit(x84)

Step4: Select an Instance type

Step5: Configure Instance details as below,

Select appropriate vpc, if you want publicly accessible VM then select public subnet and enable Auto-assign public IP.
Note: If you planning to deploy TKG clusters on existing vpc then better to deploy this preparation node also on same existing vpc otherwise you need to do vpc peering for establish communication between preparation node vpc and TKG clusters vpc.

Step6: Add storage as per your requirement

Step7: Add appropriate tagging — optional

Step8: Configure Security group, either you can attach existing one or you can also create new SG as below

Step9: Review and launch the Instance

Step10: Select an existing key pair or create a new key pair to ssh into this EC2 Instance.

After saved the .pem file, click on Launch Instances
You can see here, the status of Instance Launch

Step11: SSH to deployed EC2 instance

Give 2mins of time for EC2 instance to came up and running state

Click on connect and then select SSH client to get details of EC2 Instance to connect.

Follow instructions provided to ssh an instance

[somaraju@local Downloads]$ chmod 400 TKGPreparationNode.pem

[somaraju@local Downloads]$ ssh -i “TKGPreparationNode.pem” ubuntu@ec2–3–12–xx–xxx.us-east-2.compute.amazonaws.com
The authenticity of host ‘ec2–3–12–xx–xxx.us-east-2.compute.amazonaws.com (3.12.xxx.xx)’ can’t be established.
ECDSA key fingerprint is SHA256:OmASIl8dlkTx5Ld+g9hwHVTHavTEbVlIu/SnSUqCTik.
ECDSA key fingerprint is MD5:62:1e:5a:b7:09:93:37:e9:c5:76:91:82:56:f5:a7:7d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘ec2–3–12–xx–xxx.us-east-2.compute.amazonaws.com,3.12.xxx.xx’ (ECDSA) to the list of known hosts.
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0–1045-aws x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information as of Tue Sep 7 06:19:25 UTC 2021

System load: 0.0 Processes: 119
Usage of /: 16.4% of 7.69GB Users logged in: 0
Memory usage: 6% IPv4 address for eth0: 10.0.8.xx
Swap usage: 0%

1 update can be applied immediately.
To see these additional updates run: apt list — upgradable

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user “root”), use “sudo <command>”.
See “man sudo_root” for details.

ubuntu@ip-10–0–x–xx:~$ sudo -i
root@ip-10–0–x–xx:~#

We are now successfully able to ssh into our Ubuntu based preparation node

Installation of Kubectl, Docker, Tanzu CLI, Tanzu CLI plugins, AWS CLI on Preparation Node

Follow bellow steps to download the binaries,

Step1: Go to https://www.vmware.com/go/get-tkg and log in with your My VMware credentials.

Step2: Under Product Downloads, click Go to Downloads.

Step3: Scroll down to the VMware Tanzu 1.3.1 CLI and kubectl entries and click the Download Now button

kubectl cluster cli v1.20.5 for Linux, VMware Tanzu CLI for Linux

You need to copy downloaded binaries on a preparation node installation directory using WinSCP or any other tool

root@ip-10–0–44–xx:/som/TKGonAWS# mkdir tkg1.3.1

root@ip-10–0–44–xx:/som/TKGonAWS# cd tkg1.3.1/

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# ll

total 542328

drwxr-xr-x 2 root root 4096 Aug 25 17:10 ./

drwxrwxrwx 5 root root 4096 Aug 25 17:07 ../

-rw-r — r — 1 root root 528445440 Aug 25 17:10 tanzu-cli-bundle-v1.3.1-linux-amd64.tar

-rw-r — r — 1 root root 255989 Aug 25 17:10 ‘tkg-extensions-manifests-v1.3.1-vmware.1(1).tar.gz’

-rw-r — r — 1 root root 40255488 Aug 25 17:10 ‘kubectl-linux-v1.20.5-vmware.1.gz’

-rw-r — r — 1 root root 26626235 Aug 25 17:09 ‘velero-linux-v1.5.4_vmware(1).1.gz’

Install kubectl on a Preparation node:

Unpack the kubectl binary file ‘kubectl-linux-v1.20.5-vmware.1.gz’, The unpacked kubectl binary file is kubectl-linux-v1.20.5-vmware.1.

Rename the kubectl-linux-v1.20.5-vmware.1 executable to kubectl

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# gunzip kubectl-linux-v1.20.5-vmware.1.gz

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# mv kubectl-linux-v1.20.5-vmware.1 kubectl

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# chmod +x kubectl

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# mv kubectl /usr/local/bin

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# kubectl version

Client Version: version.Info{Major:”1", Minor:”20", GitVersion:”v1.20.4", GitCommit:”e87da0bd6e03ec3fea7933c4b5263d151aafd07c”, GitTreeState:”clean”, BuildDate:”2021–02–18T16:12:00Z”, GoVersion:”go1.15.8", Compiler:”gc”, Platform:”linux/amd64"}

Server Version: version.Info{Major:”1", Minor:”19", GitVersion:”v1.19.3+vmware.1", GitCommit:”2ac9e7ea06a1230ca196931def19d2bb67b580c7", GitTreeState:”clean”, BuildDate:”2020–10–30T07:25:38Z”, GoVersion:”go1.15.2", Compiler:”gc”, Platform:”linux/amd64"}

You need to install docker on a preparation node:

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# apt-get install docker

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# systemctl start docker

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# systemctl enable docker

Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service

You need to install Tanzu CLI on a preparation node:

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# tar -xvf tanzu-cli-bundle-v1.3.1-linux-amd64.tar

cli/

cli/core/

cli/core/v1.3.1/

cli/core/v1.3.1/tanzu-core-linux_amd64

cli/core/plugin.yaml

cli/cluster/

cli/cluster/v1.3.1/

cli/cluster/v1.3.1/tanzu-cluster-linux_amd64

cli/cluster/plugin.yaml

cli/login/

cli/login/v1.3.1/

cli/login/v1.3.1/tanzu-login-linux_amd64

cli/login/plugin.yaml

cli/management-cluster/

cli/management-cluster/v1.3.1/

cli/management-cluster/v1.3.1/tanzu-management-cluster-linux_amd64

cli/management-cluster/plugin.yaml

cli/pinniped-auth/

cli/pinniped-auth/v1.3.1/

cli/pinniped-auth/v1.3.1/tanzu-pinniped-auth-linux_amd64

cli/pinniped-auth/plugin.yaml

cli/kubernetes-release/

cli/kubernetes-release/v1.3.1/

cli/kubernetes-release/v1.3.1/tanzu-kubernetes-release-linux_amd64

cli/kubernetes-release/plugin.yaml

cli/manifest.yaml

cli/ytt-linux-amd64-v0.31.0+vmware.1.gz

cli/kapp-linux-amd64-v0.36.0+vmware.1.gz

cli/imgpkg-linux-amd64-v0.5.0+vmware.1.gz

cli/kbld-linux-amd64-v0.28.0+vmware.1.gz

cli/vendir-linux-amd64-v0.18.0+vmware.1.gz

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# cd cli

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1/cli# ll

total 43224

drwxr-xr-x 8 201 201 4096 May 7 04:22 ./

drwxr-xr-x 3 root root 4096 Aug 25 17:11 ../

drwxr-xr-x 3 201 201 4096 May 7 03:05 cluster/

drwxr-xr-x 3 201 201 4096 May 7 03:29 core/

-rw-r — r — 1 201 201 5737491 May 7 04:22 imgpkg-linux-amd64-v0.5.0+vmware.1.gz

-rw-r — r — 1 201 201 15873375 May 7 04:22 kapp-linux-amd64-v0.36.0+vmware.1.gz

-rw-r — r — 1 201 201 8717984 May 7 04:22 kbld-linux-amd64-v0.28.0+vmware.1.gz

drwxr-xr-x 3 201 201 4096 May 7 03:06 kubernetes-release/

drwxr-xr-x 3 201 201 4096 May 7 03:05 login/

drwxr-xr-x 3 201 201 4096 May 7 03:05 management-cluster/

-rw-r — r — 1 201 201 588 May 7 03:06 manifest.yaml

drwxr-xr-x 3 201 201 4096 May 7 03:05 pinniped-auth/

-rw-r — r — 1 201 201 6555847 May 7 04:22 vendir-linux-amd64-v0.18.0+vmware.1.gz

-rw-r — r — 1 201 201 7329861 May 7 04:22 ytt-linux-amd64-v0.31.0+vmware.1.gz

Install the binary to /usr/local/bin:

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1/cli# sudo install core/v1.3.1/tanzu-core-linux_amd64 /usr/local/bin/tanzu

Confirm that the binary is executable by running the tanzu version command.

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1/cli# tanzu version

version: v1.3.1

buildDate: 2021–05–07

sha: e5c37c4

Install the Tanzu CLI Plugins:

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1/cli# cd ..

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# tanzu plugin install — local cli all

root@ip-10–0–44–xx:/som/TKGonAWS/tkg1.3.1# tanzu plugin list

NAME LATEST VERSION DESCRIPTION REPOSITORY VERSION STATUS

alpha v1.3.1 Alpha CLI commands core not installed

cluster v1.3.1 Kubernetes cluster operations core v1.3.1 installed

kubernetes-release v1.3.1 Kubernetes release operations core v1.3.1 installed

login v1.3.1 Login to the platform core v1.3.1 installed

management-cluster v1.3.1 Kubernetes management cluster operations core v1.3.1 installed

pinniped-auth v1.3.1 Pinniped authentication operations (usually not directly invoked) core v1.3.1 installed

You need to install AWS CLI and jq on a preparation node:

root@ip-10–0–xx–xx:~# sudo apt-get update
Hit:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:9 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:10 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:11 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1175 kB]
Get:12 http://us-east-2.ec2.archive

.

….

…..

Get:41 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [4948 B]
Get:42 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]
Fetched 19.8 MB in 3s (6638 kB/s)
Reading package lists… Done

root@ip-10–0–xx–xx:~# sudo apt-get install awscli -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
docutils-common fontconfig fontconfig-config fonts-………………..

..

…….

………………..

…………………………………………………………..
update-alternatives: using /usr/share/docutils/scripts/python3/rst2odt_prepstyles to provide /usr/bin/rst2odt_prepstyles (rst2odt_prepstyles) in auto mode
update-alternatives: using /usr/share/docutils/scripts/python3/rst2pseudoxml to provide /usr/bin/rst2pseudoxml (rst2pseudoxml) in auto mode
update-alternatives: using /usr/share/docutils/scripts/python3/rst2s5 to provide /usr/bin/rst2s5 (rst2s5) in auto mode
update-alternatives: using /usr/share/docutils/scripts/python3/rst2xetex to provide /usr/bin/rst2xetex (rst2xetex) in auto mode
update-alternatives: using /usr/share/docutils/scripts/python3/rst2xml to provide /usr/bin/rst2xml (rst2xml) in auto mode
update-alternatives: using /usr/share/docutils/scripts/python3/rstpep2html to provide /usr/bin/rstpep2html (rstpep2html) in auto mode
Setting up python3-botocore (1.16.19+repack-1ubuntu0.20.04.1) …
Setting up python3-s3transfer (0.3.3–1) …
Setting up awscli (1.18.69–1ubuntu0.20.04.1) …

root@ip-10–0–8–27:~# aws — version
aws-cli/1.18.69 Python/3.8.5 Linux/5.4.0–1045-aws botocore/1.16.19

root@ip-10–0–xx–xx:~# sudo apt-get install jq
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libjq1 libonig5
The following NEW packages will be installed:
jq libjq1 libonig5
0 upgraded, 3 newly installed, 0 to remove and 104 not upgraded.
Need to get 313 kB of archives.
After this operation, 1062 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 libonig5 amd64 6.9.4–1 [142 kB]
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libjq1 amd64 1.6–1ubuntu0.20.04.1 [121 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 jq amd64 1.6–1ubuntu0.20.04.1 [50.2 kB]
Fetched 313 kB in 0s (14.0 MB/s)
Selecting previously unselected package libonig5:amd64.
(Reading database … 70205 files and directories currently installed.)
Preparing to unpack …/libonig5_6.9.4–1_amd64.deb …
Unpacking libonig5:amd64 (6.9.4–1) …
Selecting previously unselected package libjq1:amd64.
Preparing to unpack …/libjq1_1.6–1ubuntu0.20.04.1_amd64.deb …
Unpacking libjq1:amd64 (1.6–1ubuntu0.20.04.1) …
Selecting previously unselected package jq.
Preparing to unpack …/jq_1.6–1ubuntu0.20.04.1_amd64.deb …
Unpacking jq (1.6–1ubuntu0.20.04.1) …
Setting up libonig5:amd64 (6.9.4–1) …
Setting up libjq1:amd64 (1.6–1ubuntu0.20.04.1) …
Setting up jq (1.6–1ubuntu0.20.04.1) …
Processing triggers for man-db (2.9.1–1) …
Processing triggers for libc-bin (2.31–0ubuntu9.2) …

In the next article, I will walk-through over installation of TKG Management Cluster on AWS.

--

--

No responses yet