Skip to content

Part 2: Connecting to an existing (dev, test & live) Kubernetes cluster

andrewC edited this page Mar 5, 2024 · 4 revisions

Overview

This guide help the user to configure the connection to an existing AWS EKS cluster

Step 1: Install and Set Up kubectl

On your localhost install the kubectl

Step 2: Install and configure AWS CLI

On the bastion host install and configure AWS CLI

Step 3: Install aws-iam-authenticator

Install the aws-iam-authenticator

Step 4: Allow the Kubectl to access the AWS EKS control plane

To allow the Kubectl to access the AWS EKS control plane, user have to update the kubectl config. To update the config use the following command. Here the region, name of the cluster and user profile have to be updated. (Get the EKS cluster name from AWS console for the Dev, Test and Live accounts. See screenshot below for those used at present.)

aws eks --region eu-west-2 update-kubeconfig --name <eks-cluster-name> --profile <devdsadmin>

If you have multiple contexts you need to switch to the context you wish to use (e.g. KBS on Dev, Test or Live). To find the available contexts run this command:

kubectl config get-contexts

This will list your contexts with the current one asterisked -

image

To switch to a context run this command:

kubectl config use-context <context name from the previous list of context >

e.g. kubectl config use-context arn:aws:eks:eu-west-2:825668827209:cluster/dev-eks-cluster

Double check you are on the right cluster as this will be the cluster you are deploying to:

kubectl config get-contexts

image