Skip to Content
GuideGetting StartedPrepare the terminal environment

Prepare the Terminal Environment

This guide helps you set up a terminal environment to interact with your Kubernetes clusters and configure cloud credentials required for CloudPilot AI.

Prerequisites

  • A Bash shell (macOS, Linux) or access to a Kubernetes cluster.
  • kubectl, aws CLI, and/or aliyun CLI installed and configured in your environment.
  • For Alibaba Cloud: jq must be installed for processing JSON outputs.

Step 1: Launch a Bash Shell in Kubernetes (if needed)

If your local environment lacks a Bash shell, you can start a helper pod with all dependencies pre-installed:

kubectl run helper --image=public.ecr.aws/cloudpilotai/helper:v0.3.0 -it --rm --restart=Never -- /bin/bash

Step 2: Configure AWS Credentials

To work with AWS EKS clusters:

aws configure

Provide the following when prompted:

AWS Access Key ID [None]: <your_ak> AWS Secret Access Key [None]: <your_sk> Default region name [None]: us-east-2 Default output format [None]:

Then, update your kubeconfig:

mkdir -p ~/.kube export KUBECONFIG=~/.kube/config aws eks update-kubeconfig --name <cluster_name> --region us-east-2

Step 3: Configure Alibaba Cloud Credentials

To work with Alibaba Cloud ACK clusters:

aliyun configure

Follow the prompts:

Access Key ID []: <your_ak> Access Key Secret []: <your_sk> Default Region ID []: shenzhen Default Output Format [json]: json Default Language [zh|en]: en

Retrieve and apply the kubeconfig:

mkdir -p ~/.kube export KUBECONFIG=~/.kube/config export CLUSTER_NAME=<cluster_name> export CLUSTER_ID=$(aliyun cs GET /clusters | jq -r --arg CLUSTER_NAME "$CLUSTER_NAME" '.[] | select(.name == $CLUSTER_NAME) | .cluster_id') aliyun cs GET /k8s/$CLUSTER_ID/user_config | jq -r '.config' > $KUBECONFIG

More

After completing the credential and kubeconfig setup, your environment is ready for deploying or managing workloads using CloudPilot AI.

Last updated on