Skip to content

Latest commit

 

History

History
96 lines (66 loc) · 2.18 KB

File metadata and controls

96 lines (66 loc) · 2.18 KB

Phase 1 Runbook

This runbook takes the repo from empty AWS account context to validated nginx on a two-node kubeadm cluster, then destroys the stack.

1. Confirm Local Tools

terraform version
ansible --version
aws --version
kubectl version --client=true

The expected AWS profile name is lift-shift.

aws configure list --profile lift-shift

If credentials are missing, configure them through your preferred flow:

aws configure --profile lift-shift
# or
aws configure sso --profile lift-shift

2. Prepare Terraform Variables

cd aws
cp terraform.tfvars.example terraform.tfvars

Replace allowed_admin_cidr with your current public IP:

../scripts/get-admin-cidr.sh

Keep it as a /32 unless you intentionally need a wider source range.

3. Provision EC2 Infrastructure

terraform init
terraform fmt -check -recursive
terraform validate
terraform plan
terraform apply

Terraform writes ansible/inventory.ini and ansible/group_vars/aws.yml after apply. Those files are generated runtime files and are not committed.

4. Build Kubernetes With Ansible

cd ..
./scripts/run-ansible.sh

The playbook installs containerd, kubelet, kubeadm, kubectl, and cri-tools on both nodes; initializes the control plane on the private EC2 IP; applies Calico VXLAN; joins the worker; then waits for both nodes and CoreDNS to become healthy.

5. Validate nginx

./scripts/validate.sh

The validation script applies workloads/nginx-nodeport.yaml, waits for rollout, curls the worker NodePort, and writes proof under proof/.

Useful manual checks:

terraform -chdir=aws output
ssh -i ~/.ssh/id_ed25519 ubuntu@$(terraform -chdir=aws output -raw control_public_ip)
kubectl get nodes -o wide
kubectl get pods -A -o wide

6. Debug If Needed

./scripts/collect-debug.sh

The debug bundle captures Terraform outputs, node status, kube-system pods, Calico daemonset details, crictl ps -a, and kubelet journals.

7. Destroy

./scripts/destroy.sh

Cleanup is complete when Terraform reports destroy success and no Project=lift-shift-k8s EC2 instances, EBS volumes, or security groups remain.