Skip to content

Commit

Permalink
first example of gitops-bridge
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Santana <[email protected]>
  • Loading branch information
csantanapr committed Oct 26, 2023
1 parent 5c7b714 commit 3a22160
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 321 deletions.
117 changes: 0 additions & 117 deletions patterns/argocd/README.md

This file was deleted.

20 changes: 20 additions & 0 deletions patterns/argocd/gitops-bridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ArgoCD on Amazon EKS

This example shows how to deploy Amazon EKS with addons configured via ArgoCD

Deploy EKS Cluster
```shell
terraform init
terraform apply
```

Access Terraform output to configure `kubectl` and `argocd`
```shell
terraform output
```

Destroy EKS Cluster
```shell
cd hub
./destroy.sh
```
32 changes: 32 additions & 0 deletions patterns/argocd/gitops-bridge/bootstrap/addons.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: bootstrap-addons
namespace: argocd
spec:
syncPolicy:
preserveResourcesOnDeletion: true
generators:
- clusters:
selector:
matchExpressions:
- key: akuity.io/argo-cd-cluster-name
operator: NotIn
values: [in-cluster]
template:
metadata:
name: 'bootstrap-addons'
spec:
project: default
source:
repoURL: '{{metadata.annotations.addons_repo_url}}'
path: '{{metadata.annotations.addons_repo_basepath}}{{metadata.annotations.addons_repo_path}}'
targetRevision: '{{metadata.annotations.addons_repo_revision}}'
directory:
recurse: true
exclude: exclude/*
destination:
namespace: 'argocd'
name: '{{name}}'
syncPolicy:
automated: {}
20 changes: 20 additions & 0 deletions patterns/argocd/gitops-bridge/bootstrap/workloads.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: bootstrap-workloads
namespace: 'argocd'
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
server: https://kubernetes.default.svc
namespace: 'guestbook'
project: default
source:
path: helm-guestbook
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: HEAD
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
16 changes: 16 additions & 0 deletions patterns/argocd/gitops-bridge/destroy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -x

# Delete the Ingress/SVC before removing the addons
TMPFILE=$(mktemp)
terraform output -raw configure_kubectl > "$TMPFILE"
source "$TMPFILE"

kubectl delete svc -n argocd argo-cd-argocd-server

terraform destroy -target="module.gitops_bridge_bootstrap" -auto-approve
terraform destroy -target="module.eks_blueprints_addons" -auto-approve
terraform destroy -target="module.eks" -auto-approve
terraform destroy -target="module.vpc" -auto-approve
terraform destroy -auto-approve
Loading

0 comments on commit 3a22160

Please sign in to comment.