View on GitHub

HCL Component Pack on managed Kubernetes

This documentation provides information and installation guidelines to get HCL Connections Component Pack running on a managed Kubernetes service on one of the main cloud providers.

1 Create Kubernetes infrastructure on Azure

Choose an Azure region that suits your needs. See Quotas and region availability for Azure Kubernetes Service (AKS) for more details.
Make sure your region has enough resources available. When you create a cluster with 6 nodes, using Standard_B4ms servers, you need 24 free regional vCPUs and 24 free Standard BS vCPUs available.

Take care about the necessary network configuration. There are 2 options available.

  1. Create the Kubernetes Cluster in a separate VNet.
    When choosing this option, the services are reachable via public IP only or you need to create VNet Peering to be able to reach the internal IPs.
  2. Create the Kubernetes Cluster in an existing VNet.
    When choosing this option, some planning is necessary.

1.1 Prepare Azure Environment and Administrative Console

The first three steps are executed using the Azure portal. Experienced users could also use the Azure CLI.

1.1.1 Create Resource Group

To group our infrastructure, I recommend to create a separate resource group.

Azure Portal

Open the Azure Portal and create a new Resource Group.

Azure CLI

When you have the Azure CLI ready on your computer, you also could use those:

See the official documentation for more details.

az group create --location westus --name CPResourceGroup

1.1.2 Create a Bastion Host in your resource group to administer your cluster

The bastion host will be a small Linux host to upload the docker images to the registry and administer the cluster. It is recommended that the host is in the same resource group as your kubernetes cluster. This will simplify the access to the cluster resources and the administration.

The host can use a very small server e.g. Standard_B1s or Basic_A1 as no compute power is necessary.

Azure Portal

Open the Azure Portal and create the Bastion Host. Place the host into the the new Resource Group and in the same region as you will use for your Kubernetes Cluster.

1.2 Make the Bastion Host your administration console

Use SSH (Putty) to connect to your new Bastion Host. For login use the username and the ssh key you configured when you created your host.

1.2.1 Install git to clone this repository to have the scripts available.

sudo -i
yum -y update
yum -y install git
git clone https://github.com/becketalservices/beas-cnx-cloud.git

1.2.2 Install Azure CLI

Install Azure CLI on your Bastion Host.

The instructions of Microsoft: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Use the provided script and check the output.

bash beas-cnx-cloud/Azure/scripts/install_az.sh

After installation make sure, you can authorized yourself using az login.

1.2.3 Configure your environment

As some variables like your resource group name or the region is required more often, create a file with this variables.

# Write our environment settings
cat > ~/installsettings.sh <<EOF
AZRegion=westus
AZResourceGroup=CPResourceGroup
AZStoreAccount=cpstorageacct1
AZStoreName=cpshare
AZRegistryName=cpcontainerregistry
AZRegistryPrincipal=CP_Registry_Reader
AZClusterName=CPCluster
AZDNSPrefix=CP1
AZCluserNodes=4
AZClusterServer=Standard_B4ms
ic_admin_user=admin_user
ic_admin_password=admin_password
ic_internal=ic_internal
ic_front_door=ic_front_door
master_ip=
# "elasticsearch customizer orientme"
starter_stack_list="elasticsearch customizer orientme"
# for test environments with just one node or no taint nodes, set to false.
nodeAffinityRequired=true
EOF

1.3 Create a Docker Registry

To store our images, a Docker Registry is necessary.

See the az acr create documentation for more details.

# Load our environment settings
. ~/installsettings.sh

# Create our Docker Registry
az acr create --resource-group $AZResourceGroup \
  --name $AZRegistryName \
  --location $AZRegion \
  --sku Basic

When you do not use your current computer to publish images, there is no need to login to the registry yet.

1.4 Create a service principal user to access your Docker Registry

We need this service principal to autorize the kubernetes services to pull the images from the registry. IBM Component pack creates a secret named “myregkey” which needs the user id and password of this service principal.

The instructions on how to creates this account are taken from this Microsoft documentation.

I slightly modified the script to use our installsettings.sh file:

bash beas-cnx-cloud/Azure/scripts/create_service_principal.sh

Write down the ID and password. We need this information later to create the kubernetes secret.

1.5 Create your Azure Kubernetes Environment (AKS)

By now, you have a Resource Group to group your environment and a Docker Registry to store the images. The Azure File Share to store your persistent data with ReadWriteMany access will be crated later.

** The given script creates the cluster in a separate VNet. In case you want to use other network settings, see the Microsoft Documentation first.**

As next step, we can create the Kubernetes Cluster.

To start the generation process run:

bash beas-cnx-cloud/Azure/scripts/create_aks.sh

Check the Azure Portal for the current status. It will take a while (10-20minutes) until the cluster is created. When you have not enough resources available in your Azure subscription, the process will fail.

Check the output of the command for details or errors.

1.6 Create a Azure File Storage

1.6.1 Create a storage account

To access your storage, the storage account is necessary.

Create your new storage account:

# Load our environment settings
. ~/installsettings.sh

# Get RG
AZNodeRG=$(az aks show --resource-group $AZResourceGroup \
  --name $AZClusterName \
  --query "nodeResourceGroup"  | sed "s/\"//g")

# Create account
az storage account create --resource-group $AZNodeRG \
  --name $AZStoreAccount --location $AZRegion \
   --sku Standard_LRS

Retrieve your account key. You need it to create an Azure file share.

# Load our environment settings
. ~/installsettings.sh

# Get storage account key
AZStoreKey=$(az storage account keys list --resource-group $AZNodeRG \
 --account-name $AZStoreAccount --query "[0].value" | sed "s/\"//g")
echo Key: $AZStoreKey

Make sure you remember this key. It looks like this: "soh3BvSw895mvxrl0MgeoPw...."