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 helmistInitialize and check dependencies:
bash
make initThis command verifies that your system has all necessary dependencies.
Step 2: Obtain kubeconfig from Rancher
- Open Rancher web UI in your browser
- Navigate to your target cluster
- Click Copy KubeConfig to Clipboard (top right corner)
Step 3: Configure cluster connection
Initialize the terminal environment:
bash
source ./hacks/initWhat 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