|
| 1 | +# AWS Secret Manager for ArgoCD Admin Password |
| 2 | + |
| 3 | +Example on how to deploy Amazon EKS with addons configured via ArgoCD. |
| 4 | +In this example we show how to deploy Argo Workflows |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | +Before you begin, make sure you have the following command line tools installed: |
| 8 | +- git |
| 9 | +- terraform |
| 10 | +- kubectl |
| 11 | +- argocd (brew install argocd) |
| 12 | +- argo (brew install argo) |
| 13 | + |
| 14 | +## Fork the Git Repositories |
| 15 | + |
| 16 | +### Fork the Addon GitOps Repo |
| 17 | +1. Fork the git repository for addons [here](https://github.com/gitops-bridge-dev/gitops-bridge-argocd-control-plane-template). |
| 18 | +2. Update the following environment variables to point to your fork by changing the default values: |
| 19 | +```shell |
| 20 | +export TF_VAR_gitops_addons_org=https://github.com/gitops-bridge-dev |
| 21 | +export TF_VAR_gitops_addons_repo=gitops-bridge-argocd-control-plane-template |
| 22 | +``` |
| 23 | + |
| 24 | +## Deploy the EKS Cluster |
| 25 | +Initialize Terraform and deploy the EKS cluster: |
| 26 | +```shell |
| 27 | +terraform init |
| 28 | +terraform apply -auto-approve |
| 29 | +``` |
| 30 | +Retrieve `kubectl` config, then execute the output command: |
| 31 | +```shell |
| 32 | +terraform output -raw configure_kubectl |
| 33 | +``` |
| 34 | + |
| 35 | +### Monitor GitOps Progress for Addons |
| 36 | +Wait until all the ArgoCD applications' `HEALTH STATUS` is `Healthy`. Use Crl+C to exit the `watch` command |
| 37 | +```shell |
| 38 | +watch kubectl get applications -n argocd |
| 39 | +``` |
| 40 | + |
| 41 | +## Use Argo Workflows |
| 42 | +Make sure you have kubectl/KUBECONFIG setup by usind the output of `terraform output -raw configure_kubectl` |
| 43 | +Run a workflow in the `default` namespace using the service account created by the argo-workflow helm chart addon |
| 44 | +```shell |
| 45 | +argo submit -n default --serviceaccount argo-workflow https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/hello-world.yaml |
| 46 | +``` |
| 47 | +Check the status of the workflow |
| 48 | +```shell |
| 49 | +argo list |
| 50 | +``` |
| 51 | +Expected output: |
| 52 | +``` |
| 53 | +NAME STATUS AGE DURATION PRIORITY MESSAGE |
| 54 | +hello-world-zvczz Succeeded 59s 10s 0 |
| 55 | +``` |
| 56 | +Get the output of the workflow |
| 57 | +```shell |
| 58 | +argo logs @latest |
| 59 | +``` |
| 60 | +Expected output: |
| 61 | +``` |
| 62 | +hello-world-zvczz: _____________ |
| 63 | +hello-world-zvczz: < hello world > |
| 64 | +hello-world-zvczz: ------------- |
| 65 | +hello-world-zvczz: \ |
| 66 | +hello-world-zvczz: \ |
| 67 | +hello-world-zvczz: \ |
| 68 | +hello-world-zvczz: ## . |
| 69 | +hello-world-zvczz: ## ## ## == |
| 70 | +hello-world-zvczz: ## ## ## ## === |
| 71 | +hello-world-zvczz: /""""""""""""""""___/ === |
| 72 | +hello-world-zvczz: ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ |
| 73 | +hello-world-zvczz: \______ o __/ |
| 74 | +hello-world-zvczz: \ \ __/ |
| 75 | +hello-world-zvczz: \____\______/ |
| 76 | +hello-world-zvczz: time="2024-01-23T20:32:24.174Z" level=info msg="sub-process exited" argo=true error="<nil>" |
| 77 | +``` |
| 78 | +Use the Argo Workflow UI, use port-forward, and open url http://localhost:8080 |
| 79 | +```shell |
| 80 | +kubectl port-forward -n argo-workflows svc/argo-workflows-server 8080:2746 |
| 81 | +``` |
| 82 | +Get authentication token using argo cli |
| 83 | +```shell |
| 84 | +argo auth token |
| 85 | +``` |
| 86 | + |
| 87 | + |
| 88 | +## Access ArgoCD |
| 89 | +Access ArgoCD's UI, run the command from the output: |
| 90 | +```shell |
| 91 | +terraform output -raw access_argocd |
| 92 | +``` |
| 93 | + |
| 94 | +Destroy EKS Cluster |
| 95 | +```shell |
| 96 | +cd hub |
| 97 | +./destroy.sh |
| 98 | +``` |
0 commit comments