sheetaljoshi / argocd-on-amazon-eks-workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArgoCD on Amazon EKS Workshop

This workshop covers the following use cases

  1. Deploy hub-spoke clusters (hub, staging, prod)
  2. Deploy namespaces and argocd project
  3. Deploy application on each environment cluster (ie staging and production)
  4. Makes changes to the app in production using gitops
  5. TODO: Have the carts backend use dynamodb deployed with ACK

Setup Workshop

Run the following command create git repository in CodeCommit and create 3 EKS Clusters (Hub, Staging, Prod)

export AWS_DEFAULT_REGION="us-west-2"
./install.sh

Deploy Platform Guardrails

mkdir -p codecommit/platform
cp -r gitops/platform/* codecommit/platform/
cd codecommit
git add .
git commit -m "add platform"
git push
cd ..

Deploy Workloads

mkdir -p codecommit/apps
cp -r gitops/apps/* codecommit/apps/
cd codecommit
git add .
git commit -m "add workloads"
git push
cd ..

Setup Hub Cluster

Setup kubectl and argocd for Hub Cluster

export KUBECONFIG="/tmp/hub-cluster"
export ARGOCD_OPTS="--port-forward --port-forward-namespace argocd --grpc-web"
aws eks --region us-west-2 update-kubeconfig --name hub-cluster
kubectl config set-context --current --namespace argocd
argocd login --port-forward --username admin --password $(argocd admin initial-password | head -1)

Access ArgoCD UI

echo "ArgoCD URL: https://$(kubectl get svc -n argocd argo-cd-argocd-server -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"
echo "ArgoCD Username: admin"
echo "ArgoCD Password: $(kubectl get secrets argocd-initial-admin-secret -n argocd --template="{{index .data.password | base64decode}}")"

Setup Staging Cluster Terminal

Setup kubectl for Staging Cluster

export KUBECONFIG="/tmp/spoke-staging"
aws eks --region us-west-2 update-kubeconfig --name spoke-staging

Setup Prod Cluster Terminal

Setup kubectl for Production Cluster

export KUBECONFIG="/tmp/spoke-prod"
aws eks --region us-west-2 update-kubeconfig --name spoke-prod

Access Applicaiton UI on Staging or Production, pick the correct terminal

kubectl port-forward -n ui svc/ui 8080:80

Open browser on http://localhost:8080

Update Workload in Production

Make a change in production, like setting the ui replicas to 2. Update the codecommit/apps/ui/prod/kustomization.yaml Uncomment the lines and save the file

patches:
- deployment.yaml

Push the changes to git

git add .
git commit -m "Replicas for ui set to 2 in prod"
git push

Clean

Destroy all AWS resources

./cleaup.sh

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

License:MIT No Attribution


Languages

Language:HCL 59.3%Language:Smarty 19.3%Language:Python 11.9%Language:Shell 9.5%