CI/CD pipelines · wrap-up
Cheat sheet & self-check
Every command from this section on one page.
AWS
aws ssm get-parameters --names /aws/service/canonical/ubuntu/server/24.04/stable/current/amd64/hvm/ebs-gp3/ami-id --query 'Parameters[0].Value' --output text | Latest Ubuntu 24.04 AMI |
aws ec2 run-instances --image-id $AMI --instance-type t3.medium --key-name lab-key --security-group-ids $SG --subnet-id $SUBNET … | Create a VM |
aws ec2 terminate-instances --instance-ids … | Clean up (stop paying) |
Cluster
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-cert-extra-sans=$CP_PUBLIC_IP | Control plane |
cilium install --set ipam.mode=kubernetes && cilium status --wait | CNI |
kubectl -n demo create secret docker-registry regcred --docker-server=ghcr.io … | Pull credentials |
Pipeline & checks
http://<jenkins-ip>:8080/github-webhook/ | GitHub webhook URL |
kubectl -n demo rollout status deploy/hello | Did the deploy finish? |
curl http://<node-public-ip>:30080 | Check the app |
Argo CD
kubectl create namespace argocd && kubectl apply -n argocd --server-side --force-conflicts -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml | Install (pin a version for real use) |
argocd admin initial-password -n argocd | First login password |
argocd repo add git@github.com:<you>/hello-gitops.git --ssh-private-key-path ./argocd_ro | Private GitOps repo (read-only key) |
argocd app get hello / argocd app history hello | Status and history |
CI update step
kustomize edit set image hello=ghcr.io/<you>/hello-k8s:$TAG | Bump the tag in the overlay |
git commit -am "hello: $TAG" && git push | Hand over to Argo CD |
git revert <sha> && git push (GitOps repo) | Roll back |