Hi, I have a simple job utilizing the aws-eks: circleci/aws-eks@1.1.0
orb, almost directly from the example in the docs.
All the setup steps work as expected, until I call any kubectl
command when I get an error: You must be logged in to the server (Unauthorized)
.
I did a little research and most people who receive this error get it when they haven’t used the job to build the cluster. I’m in the same situation, where I need to update deployments in a previously built cluster. I feel like I’m missing a fundamental setup piece, but nothing else is specified in the docs. I’m thinking that I need to create an iam with the correct access for this to work correctly, but it’s missing.
Anyone have any ideas?
Relevant pieces of my config.yml:
version: 2.1
orbs:
aws-ecr: circleci/aws-ecr@7.0.0
aws-eks: circleci/aws-eks@1.1.0
kubernetes: circleci/kubernetes@0.4.0
# Run db migrations...
db-migration:
executor: aws-eks/python3
parameters:
job_yml:
type: string
steps:
- checkout
- aws-eks/update-kubeconfig-with-authenticator:
aws-region: ${AWS_REGION}
cluster-name: my-cluster
install-kubectl: true
- run:
name: "Remove previous job..."
command: kubectl delete -f << parameters.job_yml >> --ignore-not-found
- run:
name: "Run migrations..."
command: kubectl apply -f << parameters.job_yml >>