Skip to content

Commit e6bab23

Browse files
authored
Argo workflows ingress (#47)
* initial work argo-workflows Signed-off-by: Carlos Santana <[email protected]>
1 parent a9e9e3b commit e6bab23

File tree

8 files changed

+482
-0
lines changed

8 files changed

+482
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Argo Workflows with ingress domain name
2+
3+
Example on how to deploy Amazon EKS with addons configured via ArgoCD.
4+
In this example the ArgoCD is configured with ingress using a https domain name managed on Route53
5+
6+
7+
**Create DNS Hosted Zone in Route 53:**
8+
9+
In this step you will delegate your registered domain DNS to Amazon Route53. You can either delegate the top level domain or a subdomain.
10+
```shell
11+
export TF_VAR_domain_name=<my-registered-domain> # For example: example.com or subdomain.example.com
12+
```
13+
14+
You can use the Console, or the `aws` cli to create a hosted zone. Execute the following command only once:
15+
```sh
16+
aws route53 create-hosted-zone --name $TF_VAR_domain_name --caller-reference "$(date)"
17+
```
18+
Use the NameServers in the DelegatoinSet to update your registered domain NS records at the registrar.
19+
20+
21+
After creating the Route53 zone deploy the EKS Cluster
22+
```shell
23+
terraform init
24+
terraform apply
25+
```
26+
27+
Access Terraform output to configure `kubectl` and `argocd`
28+
```shell
29+
terraform output
30+
```
31+
32+
To access ArgoCD thru ingress https use the following command to get URL and passwords
33+
```shell
34+
echo "URL: https://$(kubectl get ing -n argocd argo-cd-argocd-server -o jsonpath='{.spec.tls[0].hosts[0]}')"
35+
echo "Username: admin"
36+
echo "Password: $(kubectl get secrets argocd-initial-admin-secret -n argocd --template="{{index .data.password | base64decode}}")"
37+
```
38+
39+
Destroy EKS Cluster
40+
```shell
41+
./destroy.sh
42+
```
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: ApplicationSet
3+
metadata:
4+
name: bootstrap-addons
5+
namespace: argocd
6+
spec:
7+
syncPolicy:
8+
preserveResourcesOnDeletion: true
9+
generators:
10+
- clusters:
11+
selector:
12+
matchExpressions:
13+
- key: akuity.io/argo-cd-cluster-name
14+
operator: NotIn
15+
values: [in-cluster]
16+
template:
17+
metadata:
18+
name: 'bootstrap-addons'
19+
spec:
20+
project: default
21+
source:
22+
repoURL: '{{metadata.annotations.addons_repo_url}}'
23+
path: '{{metadata.annotations.addons_repo_basepath}}{{metadata.annotations.addons_repo_path}}'
24+
targetRevision: '{{metadata.annotations.addons_repo_revision}}'
25+
directory:
26+
recurse: true
27+
exclude: exclude/*
28+
destination:
29+
namespace: 'argocd'
30+
name: '{{name}}'
31+
syncPolicy:
32+
automated: {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: workloads
5+
namespace: 'argocd'
6+
finalizers:
7+
- resources-finalizer.argocd.argoproj.io
8+
spec:
9+
destination:
10+
server: https://kubernetes.default.svc
11+
namespace: 'guestbook'
12+
project: default
13+
source:
14+
path: helm-guestbook
15+
repoURL: https://github.com/argoproj/argocd-example-apps
16+
syncPolicy:
17+
automated: {}
18+
syncOptions:
19+
- CreateNamespace=true
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
# Delete the Ingress/SVC before removing the addons
6+
TMPFILE=$(mktemp)
7+
terraform output -raw configure_kubectl > "$TMPFILE"
8+
source "$TMPFILE"
9+
10+
kubectl delete ing -A --all
11+
12+
terraform destroy -target="module.gitops_bridge_bootstrap" -auto-approve
13+
terraform destroy -target="module.eks_blueprints_addons" -auto-approve
14+
terraform destroy -target="module.eks" -auto-approve
15+
terraform destroy -target="module.vpc" -auto-approve
16+
terraform destroy -auto-approve

0 commit comments

Comments
 (0)