AWS Add-Node Provisioning (optional)
Optional AWS EC2 provisioning for a new OpenG2P cluster node — creates a single Ubuntu instance in an existing VPC and writes provision-output.yaml.
The bundled AWS add-node provisioner is a separate, optional step that creates one Ubuntu 24.04 LTS EC2 instance in an existing VPC / security group, then writes provision-output.yaml for the Add Node join workflow. Lives at automation/add-node/aws/.
Use it if you need a new EC2 instance. If you already have a VM (on-prem, another cloud, manually created EC2), skip this page and go straight to Add Node → Step 1.
This script only provisions the VM. Joining the cluster is a separate step — Add Node — run from your admin laptop after SSH is working.
Prerequisites
AWS CLI
v2 installed on your laptop. aws --version should print aws-cli/2.x.
AWS credentials
Configured via aws configure, environment variables, or an AWS_PROFILE. Honours AWS_REGION, AWS_PROFILE.
Bash
4+ (bash --version)
Existing AWS resources
VPC, subnet (public if you SSH from the internet), security group, EC2 key pair
Permissions
ec2:Describe*, ec2:RunInstances, ec2:TerminateInstances, ec2:CreateTags, sts:GetCallerIdentity
Use a project tag value that matches the Project tag on your existing cluster resources so they stay grouped.
Security group
Reuse your cluster Compute security group (<project>-k8s-node) or any SG that allows:
SSH (TCP 22) from your admin CIDR
All intra-VPC traffic (required for RKE2 ports 9345, 6443, 10250, etc.)
The add-node provisioner does not create or modify security group rules.
What gets created
All resources are tagged with Project=<project> and ManagedBy=openg2p-aws-add-node so destroy / --force never touch instances tagged ManagedBy=openg2p-aws-provision.
EC2 instance
Ubuntu 24.04 LTS, encrypted gp3 root volume
provision-output.yaml
IPs, SSH paths, suggested node_name
Never created: VPC, subnets, security groups, Elastic IPs. Key pairs are reused (or created only if you choose “create new” in the interactive menu).
Default sizing
Instance type
t3a.2xlarge (8 vCPU, 32 GB)
instance_type
Root disk
128 GiB gp3, encrypted
disk_gb
OS
Ubuntu 24.04 LTS (latest Canonical AMI)
ubuntu_ami (blank = auto-resolve)
Match or exceed the Compute node minimums for your cluster workloads.
Workflow
Then continue with the cluster join from your laptop (no sudo):
➡️ Add Node
aws/provision-output.yaml is auto-loaded for ssh_host, ssh_user, ssh_key, node_ip, and node_name. You still need server_url, rke2_token, and rke2_version from a control-plane — see Add Node → Step 1.
Interactive selection (default)
When placement / key / sizing keys are blank in aws-config.yaml, the script queries AWS and presents numbered menus. Selections are written back to aws-config.yaml so subsequent runs are stable.
Prompts cover: instance type, root disk size, VPC, Availability Zone, subnet, security group, key pair, and instance Name tag.
For CI / automation, pass --non-interactive and pre-fill all required values.
Options reference
Provision — openg2p-aws-provision.sh
--config <file>
AWS add-node config (required)
--non-interactive
Never prompt — fail if any required value is unspecified
--skip-ssh-wait
Don't wait for SSH after status checks
--ssh-timeout <sec>
SSH wait timeout (default: 600)
--force
Terminate an existing add-node instance with the same Name, then launch fresh
--dry-run
Resolve selection and print what would be launched; create nothing
--help, -h
Show help
--dry-run: still checks credentials and resolves VPC / SG / AMI / etc., then prints the planned launch and exits. Does not call RunInstances, terminate, wait for SSH, or write provision-output.yaml.
--force is useful when a previous launch failed mid-way. It only replaces instances tagged ManagedBy=openg2p-aws-add-node (or listed in provision-output.yaml).
Destroy — openg2p-aws-destroy.sh
--config <file>
AWS add-node config (required)
--instance-id <id>
Explicit instance to terminate (skips auto-detect)
--yes / -y
Skip confirmation (type instance Name)
--dry-run
Resolve the target and print what would be deleted; change nothing
--help, -h
Show help
Target resolution (first match):
--instance-idif providedinstance_idinprovision-output.yamlinstance_nameinaws-config.yaml(withManagedBy=openg2p-aws-add-node)Interactive menu of add-node instances in the project
provision-output.yaml
Written automatically after a successful provision. Example:
SSH to the instance:
Tearing down
This terminates the add-node instance and removes provision-output.yaml. It does not:
Delete the security group, VPC, or subnet
Delete your SSH key pair
Remove the node from the Kubernetes cluster (run
openg2p-remove-node.shfrom the laptop first — see Add Node → Removing a node)
Recommended order when decommissioning:
Remove from cluster (
openg2p-remove-node.shfrom the laptop; confirms before proceeding)Clean up RKE2 on the node (commands printed by remove script)
Destroy EC2 instance (
openg2p-aws-destroy.shon laptop)
Troubleshooting
Key file not found locally
If a previous interactive run saved key_path to a default under aws/keys/ but your .pem lives elsewhere, either:
Update
key_pathinaws-config.yamlto the real location, orRe-run — the script re-prompts for the local
.pemwhen the saved path is missing
Instance launched but no public IP
Pick a subnet with MapPublicIpOnLaunch=true, or SSH via a bastion / VPN using the private IP from provision-output.yaml.
Re-provision after failure
Cluster join errors after AWS provision
See Add Node → Troubleshooting. The AWS script only creates the VM.
Related guides
Add Node — main cluster join guide
Last updated
Was this helpful?