TAP On AKS (1.0.0) : Part 1 – Prepare The Setup with acr.io

Reading Time: 4 mins

Overview

Tanzu Application Platform is a packaged set of components that helps developers and operators to more easily build, deploy, and manage apps on a Kubernetes platform.

Prerequisites

  • Tanzu Network account to download Tanzu Application Platform packages.
  • A container image registry, such as Harbor or Docker Hub with at least 10 GB of available storage for application images, base images, and runtime dependencies. When available, VMware recommends using a paid registry account to avoid potential rate-limiting associated with some free registry offerings.
  • Registry credentials with push and write access made available to Tanzu Application Platform to store images.
  • Network access to https://registry.tanzu.vmware.com
  • Network access to your chosen container image registry.

There are some optional prerequisites as well, refer to official doc for more details.

Create AKS Cluster

  • Steps to create AKS cluster is documented here (includes kubectl, gcloud CLI),  but to install TAP you need instances with min 8 GB of RAM across all nodes available to Tanzu Application Platform. So ensure to deploy GKE cluster with below min config:

  • Once the cluster is created and status turns green, click on the cluster > connect > “Run the following commands”
# Set the account

az account set --subscription <Subscription id>

# Get the credentials, below is the example for ref where tap-demo-aks-rg is resource group name and tap-demo-aks-cluster-1 is
the name of AKS cluster.

az aks get-credentials --resource-group tap-demo-aks-rg --name tap-demo-aks-cluster-1

Install Tanzu CLI, plugins

Install Tanzu CLI

Sign to Tanzu Network and accept below EULAs:

Sign in to Tanzu Network , Download tanzu-cluster-essentials-darwin-amd64-1.0.0.tgz (for OS X) or tanzu-cluster-essentials-linux-amd64-1.0.0.tgz (for Linux) into local machine and copy to destination jumpbox using scp or download directly using pivnet cli.

scp command (Optional)
Syntax: scp -i < key file (include path)> <file name (include path )> ubuntu@<ip>:/tmp

$ scp -i ~/.ssh/jumpbox-aws.pem tanzu-cluster-essentials-linux-amd64-1.0.0.tgz ubuntu@13.232.59.142:/tmp

eknath@jumpbox:~$ ls
tanzu tanzu-cluster-essentials-linux-amd64-1.0.0.tgz tanzu-framework-linux-amd64_1.tar

# Create a new directory
mkdir $HOME/tanzu-cluster-essentials

# unpack the TAR file
tar -xvf tanzu-cluster-essentials-linux-amd64-1.0.0.tgz -C $HOME/tanzu-cluster-essentials

# Configure and run install.sh, which installs kapp-controller and secretgen-controller on your cluster: Where TANZU-NET-USER and TANZU-NET-PASSWORD are your credentials for Tanzu Network.

export INSTALL_BUNDLE=registry.tanzu.vmware.com/tanzu-cluster-essentials/cluster-essentials-bundle@sha256:82dfaf70656b54dcba0d4def85ccae1578ff27054e7533d08320244af7fb0343
export INSTALL_REGISTRY_HOSTNAME=registry.tanzu.vmware.com
export INSTALL_REGISTRY_USERNAME=TANZU-NET-USER
export INSTALL_REGISTRY_PASSWORD=TANZU-NET-PASSWORD
cd $HOME/tanzu-cluster-essentials
./install.sh

Note: Succeeded indicates successful installation

# Install the kapp CLI onto your $PATH:

sudo cp $HOME/tanzu-cluster-essentials/kapp /usr/local/bin/kapp

# verify kapp version
$ kapp version
kapp version 0.42.0

Succeeded

Sign in to Tanzu Network , click on folder tanzu-cli-v0.10.0 and download tanzu-framework-bundle-linux (for Linux) into local machine and copy to destination jumpbox using scp or download directly using pivnet cli.

# Create a directory named tanzu:

$ mkdir $HOME/tanzu

# unpack the TAR file into the tanzu directory:

$ tar -xvf tanzu-framework-linux-amd64.tar -C $HOME/tanzu

# Set env var TANZU_CLI_NO_INIT to true to assure the local downloaded versions of the CLI core and plug-ins are installed:

export TANZU_CLI_NO_INIT=true

# Install the CLI core:

cd $HOME/tanzu
sudo install cli/core/v0.10.0/tanzu-core-linux_amd64 /usr/local/bin/tanzu

$ tanzu version
version: v0.10.0
buildDate: 2021-11-03
sha: fd96bebe

# From your tanzu directory, Install the local versions of the plug-ins you downloaded by running:

cd $HOME/tanzu
tanzu plugin install --local cli all

# Check the plugin installation status:

$ tanzu plugin list
NAME LATEST VERSION DESCRIPTION REPOSITORY VERSION STATUS
accelerator Manage accelerators in a Kubernetes cluster v1.0.0 installed
apps Applications on Kubernetes v0.4.0 installed
cluster v0.14.0 Kubernetes cluster operations core v0.10.0 upgrade available
kubernetes-release v0.14.0 Kubernetes release operations core v0.10.0 upgrade available
login v0.14.0 Login to the platform core v0.10.0 upgrade available
management-cluster v0.14.0 Kubernetes management cluster operations core v0.10.0 upgrade available
package v0.14.0 Tanzu package management core v0.10.0 upgrade available
pinniped-auth v0.14.0 Pinniped authentication operations (usually not directly invoked) core v0.10.0 upgrade available
secret v0.14.0 Tanzu secret management core v0.10.0 upgrade available
services Discover Service Types and manage Service Instances (ALPHA) v0.1.1 installed

Install Docker

  • Refer to Docker page to get the detailed steps of Installing Docker.

Create ACR (Optional):

In this demo, I will be using ACR (Azure Container Registries) to store the images. You can deploy the application with images located in any registry of your choice.

  • Login to Azure portal > Container registries > Create container registry
  • In Resource Group, create new as shown below and give it a name

  • Give a registry name and select the Location from drop down.

  • Review + Create 
  • Create

Once registry is successfully created, navigate to container registries > click on created registry > Settings > Access keys > Enable Admin user to get the password and collect below to authenticate using docker login, save it for future ref which will be used in TAP values file in later sections:

      • Login server
      • Username
      • password

# Authenticate

docker login captainrepo.azurecr.io -u captainrepo -p hGQ9XqmuZHfd3o

# Tag Image, syntax: docker tag <local image>:<version> <registryname>.azurecr.io/<reponame>:<version>

$ docker tag 778018584600.dkr.ecr.ap-south-1.amazonaws.com/tbs-spring-image captainrepo.azurecr.io/tbs-spring-image:latest

# Push the image to ACR repo:

$ docker push captainrepo.azurecr.io/tbs-spring-image:latest
  • Login to Azure portal > Container registries > click on registry > Repositories
  • Image pushed in previous step can be seen here