Skip to content

Connecting kubectl to k8s Clusters ​

Overview ​

This runbook describes the secure method for connecting kubectl to EKS clusters using the helmist tool, which provides temporary authenticated access through Rancher.

Procedure ​

Step 1: Setup helmist tool ​

Clone the helmist repository:

bash
git clone https://github.com/TrueWatchTech/helmist
cd helmist

Initialize and check dependencies:

bash
make init

This command verifies that your system has all necessary dependencies.

Step 2: Obtain kubeconfig from Rancher ​

  1. Open Rancher web UI in your browser
  2. Navigate to your target cluster
  3. Click Copy KubeConfig to Clipboard (top right corner)

Step 3: Configure cluster connection ​

Initialize the terminal environment:

bash
source ./hacks/init

What this script does:

  • configures your terminal to highlight the target Kubernetes cluster
  • configures KUBECONFIG env var to connect to the target Kubernetes cluster

Important Notes ​

  • Session Duration: Authentication tokens expire after 15 minutes
  • Security: Kubeconfig files are stored with restricted permissions (600)
  • Visual Indicator: Terminal displays cluster/namespace information continuously