This workshop covers the following use cases
- Deploy hub-spoke clusters (hub, staging, prod)
- Deploy namespaces and argocd project
- Deploy application on each environment cluster (ie staging and production)
- Makes changes to the app in production using gitops
- TODO: Have the carts backend use dynamodb deployed with ACK
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
mkdir -p codecommit/platform
cp -r gitops/platform/* codecommit/platform/
cd codecommit
git add .
git commit -m "add platform"
git push
cd ..
mkdir -p codecommit/apps
cp -r gitops/apps/* codecommit/apps/
cd codecommit
git add .
git commit -m "add workloads"
git push
cd ..
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 kubectl
for Staging Cluster
export KUBECONFIG="/tmp/spoke-staging"
aws eks --region us-west-2 update-kubeconfig --name spoke-staging
Setup kubectl
for Production Cluster
export KUBECONFIG="/tmp/spoke-prod"
aws eks --region us-west-2 update-kubeconfig --name spoke-prod
kubectl port-forward -n ui svc/ui 8080:80
Open browser on http://localhost:8080
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
Destroy all AWS resources
./cleaup.sh
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.