@@ -77,8 +77,10 @@ function usage() {
7777 echo " or the podcert-agent sidecar, for clusters without the"
7878 echo " certificates.k8s.io/v1beta1 API such as AKS and EKS"
7979 echo " --overlay=NAME Install from manifests/ate-install/NAME instead of the GKE base"
80- echo " (aks: in-cluster S3 snapshot store, no GCP auth; implies --pki-delivery=agent"
81- echo " unless set). Not combined with kind or --atenet-router=agentgateway"
80+ echo " (aks: in-cluster S3 snapshot store, no GCP auth; eks: Amazon S3 with IRSA,"
81+ echo " needs ATE_AWS_REGION and ATE_EKS_ATELET_ROLE_ARN; both imply"
82+ echo " --pki-delivery=agent unless set). Not combined with kind or"
83+ echo " --atenet-router=agentgateway"
8284 echo " --podcert-workers-per-signer N Concurrent workers per podcertificate-controller signer (default: 1)"
8385 echo " --rollout-timeout DURATION Per-workload readiness wait timeout, kubectl-style Go duration (default: 60s)"
8486 echo " --otlp-endpoint URL Send all control plane telemetry to URL, not to the cluster default (see benchmarking/telemetry/README.md)"
@@ -682,6 +684,8 @@ deploy_ate_system() {
682684 fi
683685 fi
684686
687+ annotate_atelet_service_account_for_irsa
688+
685689 local manifests=" "
686690 manifests=" $( render_ate_system_manifests) "
687691 echo " ${manifests} " | run_kubectl apply -f -
@@ -720,10 +724,13 @@ ensure_apiserver_prerequisites() {
720724 create_api_server_env_vars
721725 run_kubectl get configmap -n ate-system ate-api-authentication > /dev/null 2>&1 \
722726 || create_api_authentication_config
723- if [[ -n " $( install_overlay) " ]]; then
727+ if [[ -n " $( install_overlay) " && -f " manifests/ate-install/ $( install_overlay ) /rustfs.yaml " ]]; then
724728 run_kubectl get secret -n ate-system rustfs-credentials > /dev/null 2>&1 \
725729 || create_rustfs_credentials_secret
726730 fi
731+ if [[ " $( install_overlay) " == " eks" ]]; then
732+ create_aws_config
733+ fi
727734}
728735
729736# The in-cluster S3 store of the aks overlay and atelet share these keys
@@ -737,6 +744,40 @@ create_rustfs_credentials_secret() {
737744 --dry-run=client -o yaml | run_kubectl apply -f -
738745}
739746
747+ # The eks overlay's atelet reads the snapshot bucket's region from this
748+ # ConfigMap (manifests/ate-install/eks/atelet). Reconciled on every install so a
749+ # region change in ATE_AWS_REGION takes effect on the next atelet rollout.
750+ create_aws_config () {
751+ log_step " create_aws_config"
752+ if [[ -z " ${ATE_AWS_REGION:- } " ]]; then
753+ echo " Error: --overlay eks needs ATE_AWS_REGION (the region of the S3 snapshot bucket)" >&2
754+ exit 1
755+ fi
756+ run_kubectl create configmap -n ate-system ate-aws-config \
757+ --from-literal=region=" ${ATE_AWS_REGION} " \
758+ --dry-run=client -o yaml | run_kubectl apply -f -
759+ }
760+
761+ # IRSA for atelet on EKS: the pod identity webhook projects a web identity
762+ # token into pods whose ServiceAccount carries eks.amazonaws.com/role-arn, so
763+ # the annotation must be on the ServiceAccount before the DaemonSet's pods are
764+ # created. The annotation is set imperatively (not through apply) so applying
765+ # the plain manifest afterwards leaves it alone. A changed role needs an atelet
766+ # rollout restart; the installer's apply of the DaemonSet does not restart pods
767+ # on its own when nothing else changed.
768+ annotate_atelet_service_account_for_irsa () {
769+ [[ " $( install_overlay) " == " eks" ]] || return 0
770+ if [[ -z " ${ATE_EKS_ATELET_ROLE_ARN:- } " ]]; then
771+ echo " Error: --overlay eks needs ATE_EKS_ATELET_ROLE_ARN (IAM role with access to the S3 snapshot bucket)" >&2
772+ exit 1
773+ fi
774+ log_step " annotate_atelet_service_account_for_irsa"
775+ run_kubectl get serviceaccount -n ate-system atelet > /dev/null 2>&1 \
776+ || run_kubectl create serviceaccount -n ate-system atelet
777+ run_kubectl annotate serviceaccount -n ate-system atelet --overwrite \
778+ " eks.amazonaws.com/role-arn=${ATE_EKS_ATELET_ROLE_ARN} "
779+ }
780+
740781# Redeploy only the ate-apiserver
741782deploy_ate_apiserver () {
742783 log_step " deploy_ate_apiserver"
@@ -764,6 +805,10 @@ deploy_atelet() {
764805
765806 apply_otel_config
766807 apply_otel_endpoint_override
808+ if [[ " $( install_overlay) " == " eks" ]]; then
809+ create_aws_config
810+ fi
811+ annotate_atelet_service_account_for_irsa
767812
768813 local manifest=" "
769814 if [[ -n " $( install_overlay) " ]]; then
@@ -1174,8 +1219,8 @@ esac
11741219podcert_workers_per_signer > /dev/null
11751220rollout_timeout > /dev/null
11761221install_overlay > /dev/null
1177- # The aks overlay exists for clusters without certificates.k8s.io/v1beta1.
1178- if [[ " ${ATE_INSTALL_OVERLAY:- } " == " aks" && -z " ${ATE_PKI_DELIVERY:- } " ]]; then
1222+ # The aks and eks overlays exist for clusters without certificates.k8s.io/v1beta1.
1223+ if [[ ( " ${ATE_INSTALL_OVERLAY:- } " == " aks" || " ${ATE_INSTALL_OVERLAY :- } " == " eks " ) && -z " ${ATE_PKI_DELIVERY:- } " ]]; then
11791224 ATE_PKI_DELIVERY=agent
11801225fi
11811226if [[ " $( pki_delivery) " == " agent" && " ${ATE_EXPERIMENTAL_USE_SDSMINT:- false} " == " true" ]]; then
0 commit comments