- Go 1.26.1+ (see
.go-version) - Docker
- AWS CLI with credentials configured
jq
# 1. Build the binary and image
make bin
make image # prints the image tag — copy it for the next step
# 2. Start a kind cluster with the authenticator running
make start-dev \
ADMIN_ARN=arn:aws:iam::123456789012:role/MyAdminRole \
AUTHENTICATOR_IMAGE=<tag printed by make image>ADMIN_ARN is the IAM role or user ARN that will have admin access to the test cluster.
Once started, the script prints the kubectl command to use, with a kubeconfig pointing at your local cluster.
- Downloads
kindto_output/bin/kindif not already present - Creates a Docker bridge network (
172.30.0.0/16) for the authenticator container - Starts the authenticator as a Docker container with your image
- Creates a kind cluster configured to use the authenticator as its webhook
- Writes a kubeconfig to
_output/dev/client/kubeconfig.yaml
Server-side changes (changes to the authenticator server itself): rebuild the image and restart the environment.
make image
make kill-dev
make start-dev ADMIN_ARN=... AUTHENTICATOR_IMAGE=...Client-side changes (changes to the token subcommand): just rebuild the binary — the generated kubeconfig already points at _output/bin/aws-iam-authenticator.
make bin
kubectl --kubeconfig=_output/dev/client/kubeconfig.yaml get nodesTo test the DynamicFile backend mode instead of the default MountedFile mode:
make start-dev-dynamicfileNo environment variables required — the script automatically derives ADMIN_ARN from aws sts get-caller-identity and builds and tags the image itself via make image.
make kill-devThis deletes the kind cluster, stops the authenticator container, removes the Docker network, and cleans up _output/dev/.
If you want to stop the environment without removing _output/dev/ (e.g. to restart with a new image without rebuilding config), use make stop-dev instead — it does everything except the directory cleanup.
Unit tests:
make testRuns go test ./pkg/... with race detection. Outputs coverage.html.
Integration tests (requires AWS credentials and jq):
make integrationSpins up a local API server using etcd (downloaded from the Kubernetes repo on first run) and runs tests against real AWS IAM. Requires sts:GetCallerIdentity permission.
E2E tests against a kind cluster:
make e2e RUNNER=kindE2E tests against a kops cluster on AWS:
make e2e RUNNER=kopsmake lintRequires golangci-lint v2.11.3+. CI uses v2.11.3 with default settings (see .golangci.yaml).
After modifying types in pkg/mapper/crd/apis/, regenerate the CRD client code:
make codegen