Search…
Set up kubectl
Although it is not necessary to use kubectl to interact with Cortex clusters, advanced users can use kubectl to get more granular visibility into the cluster (since Cortex is built on top of Kubernetes).
Here's how to set up kubectl and connect it to your existing Cortex cluster:

Step 1

Install kubectl by following these instructions.

Step 2

If you don't already have the AWS CLI installed, install it by following these instructions.
Confirm that aws --version >= 1.16, and configure your credentials by running aws configure or by exporting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.

Step 3

Run the following command:
1
$ aws eks update-kubeconfig --name=<cluster_name> --region=<region>
Copied!
Where <cluster_name> is the name of your cluster and <region> is the region of the cluster. These were specified when your cluster was created, either via command line prompts or your cluster configuration file (e.g. cluster.yaml). The default cluster name is cortex, and the default region is us-east-1.

Step 4

Test kubectl against the existing Cortex cluster by running a command like the following. Your output will be different.
1
$ kubectl get pods
2
3
NAME READY STATUS RESTARTS AGE
4
cloudwatch-agent-statsd-flwmv 1/1 Running 0 6m16s
5
fluentd-bv8xl 1/1 Running 0 6m20s
6
fluentd-vrwhw 1/1 Running 0 6m20s
7
operator-dc489b4f9-mmwkz 1/1 Running 0 6m14s
Copied!
kubectl is now configured!
Last modified 10mo ago
Copy link