Deploy k3d dev environment to AWS, including:
- creating an ec2 security group
- creating a private key
- creating a local .pem file
- creating an ec2 keypair
- creating an ec2 instance
- creating a k3d cluster on the instance
- installing Big Bang's flux on the k3d cluster
- copying the cluster's kubeconfig to your local machine
- aws cli
- terraform
- kubectl
Shell commands used:
scp- to copy the remote kubeconfig to local machinesed- to update the kubeconfig's server IP
- Check for an existing AWS profile
aws configure list-profiles- If desired profile is not present, configure a profile
aws configure --profile <PROFILE_NAME>
# aws_access_key_id - The AWS access key part of your credentials
# aws_secret_access_key - The AWS secret access key part of your credentials
# region - us-gov-west-1
# output - json- Set variables in variables.yaml
# example
awsProfile: default
awsUsername: first.last
instanceType: t2.2xlarge
volumeSize: 50
k3dVersion: v4.4.7
registryUsername: first.last
registryPassword: abcd1234- Initialize terraform (first time only)
terraform init- Create infrastructure (kubeconfig is dumped into working directory as
k3d.yaml)
terraform apply- Test cluster access (you should see some pods in the
kube-systemandflux-systemnamespaces)
kubectl --kubeconfig=./k3d.yaml get pods --all-namespacesterraform destroyPlease open an issue or PR if you'd like to see something changed.