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:
kubectl by following these instructions.
eksctl by following these instructions.
Make sure that your AWS credentials are available in your current shell environment.
eksctl will search for credentials in the
AWS_SECRET_ACCESS_KEY environment variables, or your
aws CLI's credentials file (which can be created with
Run the following command:
$ eksctl utils write-kubeconfig --cluster=<cluster_name> --region=<region>
<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
kubectl against the existing Cortex cluster by running a command like the following. Your output will be different.
$ kubectl get podsNAME READY STATUS RESTARTS AGEcloudwatch-agent-statsd-flwmv 1/1 Running 0 6m16sfluentd-bv8xl 1/1 Running 0 6m20sfluentd-vrwhw 1/1 Running 0 6m20soperator-dc489b4f9-mmwkz 1/1 Running 0 6m14s
kubectl is now configured!