Interact with Kubernetes

You can deploy kdb Insights Enterprise to AWS, GCP, and Azure. The clusters are typically managed through Terraform GitOps scripts. New cluster setup and reconfigurations can be achieved by updating the terraform configuration and applying via DevOps processes.

Prerequisites

A number of tools are required to allow the user to deploy the kdb Insights Enterprise:

Connection to cluster

To connect to a cluster, you must create a context.

A context is the configuration that you use to access a particular cluster and namespace with a user account.

The user account must be authorized to access the cloud provider project. Use the cloud provider CLI to grant authorization. You may need assistance from the project administrator. See the relevant cloud provider documentation for further details on how to do this. Some information is provided below.

Assuming the user account has the appropriate permissions to the cloud provider and cluster, and has authenticated via the CLI, the next step is to connect to a specific cluster and namespace.

AWS

GCP

Azure

This command creates the necessary configuration to set up kubectl to point to the cluster kxi-a1 in the region us-east-1.

shell

Copy
aws eks --region us-east-1 update-kubeconfig --name kxi-a1

To authorize gcloud and utilize GKE, set the appropriate account and project to be active.

shell

Copy
gcloud auth login
gcloud auth configure-docker

Note

The gcloud command offers significant helpers. Running incomplete commands prompts you with available options. For example, gcloud container clusters indicates cluster commands available. See gcloud documentation for full details.

shell

Copy
gcloud container clusters get-credentials \
  kxi-g1 --region us-central1 --project <gcp-project-name>

To authorize az and utilize AKS within the kubectl setup the below steps are required.

  • Set the account subscription id to link az to the Azure subscription.

shell

Copy
az account show | grep id                   # Get subscription ID
az account set --subscription <id>          # Set subscription ID
  • Link kubectl to your credentials by providing the resource group name containing the AKS cluster along with the cluster name.

shell

Copy
az aks get-credentials --resource-group <resource group name> --name <cluster name>

Kubernetes contexts and namespaces

Once connected to the cluster, set up an 'active context'. The default context points to the default namespace within the active cluster. Change this to a siloed namespace to allow multiple deployments of applications within a cluster.

Depending on the maturity of the cluster being used and the kubectl setup, you may need to carry out a number of steps. See full documentation on contexts and namespaces. Below are common commands to help interrogate the active context, clusters, and namespaces.

View active context

Displays the name of the active context.

shell

Copy
kubectl config current-context

View defined contexts

Displays all contexts within your configuration and includes cluster information, users access configuration and namespace association. Note this is dynamically built from various calls highlighted here.

shell

Copy
kubectl config view

Create from command line

shell

Copy
kubectl create namespace kxi-sys

Create a context

Link the cluster, user and namespace to a single context entity.

shell

Copy
kubectl config set-context kxi --namespace=kxi-sys \
  --cluster=<cluster-name> \
  --user=<user-name>

Note

The namespace, cluster and user should already exist in your config kubectl config view.

Set active context

Once you've created the context, set it as active.

shell

Copy
kubectl config use-context kxi