IMAGE_NAME="eks-node" IMAGE_DESCRIPTION="Unified EKS K3s node VM — Alpine + K3s v1.32.5+k3s1 + eks-token-webhook; role (server|agent) chosen at first boot" DISTRO="alpine" ALPINE_VERSION="3.21.7" # 4G — server superset (K3s server binary + embedded-etcd datastore working set under # /var/lib/rancher/k3s on the root disk). Agents use the same image; the ~10MB # of unused server binary + webhook is dwarfed by the headroom for node images. IMAGE_SIZE="4G" # Server superset of both package sets (etcd-ctl is ~5MB, not worth branching). # K3s pulls cgroups + iptables; jq builds the bootstrap-message JSON envelopes; # etcd-client used by the snapshot script (server role only). The control plane # reaches the host via the AWS gateway (eks-gateway-publish), not a NATS CLI. APK_PACKAGES="ca-certificates curl jq iptables ip6tables conntrack-tools cgroup-tools etcd-ctl openrc" # eks-token-webhook binary always installed (agents never start it). # eks-gateway-publish relays the bootstrap envelopes + state reports to the AWS # gateway over SigV4 HTTPS (server role only). The k3s binary is downloaded + # SHA256-verified by setup.sh (network in chroot). BUILD_COMMANDS="CGO_ENABLED=0 GOFIPS140=v1.0.0 go build -o bin/eks-token-webhook ./cmd/eks-token-webhook && CGO_ENABLED=0 GOFIPS140=v1.0.0 go build -o bin/eks-gateway-publish ./cmd/eks-gateway-publish && CGO_ENABLED=0 GOFIPS140=v1.0.0 go build -o bin/eks-gateway-fetch ./cmd/eks-gateway-fetch && CGO_ENABLED=0 GOFIPS140=v1.0.0 go build -o bin/eks-webhook-cert ./cmd/eks-webhook-cert" INSTALL_BINARIES="bin/eks-token-webhook:/usr/local/bin/eks-token-webhook bin/eks-gateway-publish:/usr/local/bin/eks-gateway-publish bin/eks-gateway-fetch:/usr/local/bin/eks-gateway-fetch bin/eks-webhook-cert:/usr/local/bin/eks-webhook-cert" # All role services ship; none but the selector are enabled at bake time. # eks-node-role picks server vs agent at first boot and enables the rest. INSTALL_FILES="\ scripts/images/eks-node/eks-node-role.initd:/etc/init.d/eks-node-role \ scripts/images/eks-node/eks-node-role.sh:/usr/local/sbin/eks-node-role \ scripts/images/eks-node/k3s.initd:/etc/init.d/k3s \ scripts/images/eks-node/k3s-agent.initd:/etc/init.d/k3s-agent \ scripts/images/eks-node/eks-token-webhook.initd:/etc/init.d/eks-token-webhook \ scripts/images/eks-node/k3s-first-boot.initd:/etc/init.d/k3s-first-boot \ scripts/images/eks-node/k3s-first-boot.sh:/usr/local/sbin/k3s-first-boot \ scripts/images/eks-node/mulga-eks-state-report.initd:/etc/init.d/mulga-eks-state-report \ scripts/images/eks-node/mulga-eks-state-report.sh:/usr/local/sbin/mulga-eks-state-report \ scripts/images/eks-node/mulga-eks-addon-sync.initd:/etc/init.d/mulga-eks-addon-sync \ scripts/images/eks-node/mulga-eks-addon-sync.sh:/usr/local/sbin/mulga-eks-addon-sync \ scripts/images/eks-node/addons/spinifex-noop/0.1.0/noop.yaml:/usr/share/spinifex-eks/addons/spinifex-noop/0.1.0/noop.yaml \ scripts/images/eks-node/addons/argocd/3.0.23/argocd.yaml:/usr/share/spinifex-eks/addons/argocd/3.0.23/argocd.yaml \ scripts/images/eks-node/addons/aws-load-balancer-controller/2.11.0/00-crds.yaml:/usr/share/spinifex-eks/addons/aws-load-balancer-controller/2.11.0/00-crds.yaml \ scripts/images/eks-node/addons/aws-load-balancer-controller/2.11.0/10-aws-load-balancer-controller.yaml:/usr/share/spinifex-eks/addons/aws-load-balancer-controller/2.11.0/10-aws-load-balancer-controller.yaml \ scripts/images/eks-node/addons/aws-load-balancer-controller/2.11.0/webhook.conf:/usr/share/spinifex-eks/addons/aws-load-balancer-controller/2.11.0/webhook.conf \ scripts/images/eks-node/coredns/coredns-mulga.yaml:/usr/share/spinifex-eks/coredns/coredns-mulga.yaml \ scripts/images/eks-node/mulga-eks-etcd-snapshot.sh:/etc/periodic/daily/mulga-eks-etcd-snapshot" # Only crond (etcd snapshot) + the role selector at bake. The selector adds the # role-specific services (k3s/eks-token-webhook/k3s-first-boot/state-report or # k3s-agent) to the default runlevel on first boot. ENABLE_SERVICES="crond eks-node-role" SETUP_SCRIPT="scripts/images/eks-node/setup.sh" AMI_NAME="spinifex-eks-node" SYSTEM_TAG="spinifex:managed-by=eks"