Skip to content

Commit

Permalink
feat: convert operators to ArgoCD ApplicationSet
Browse files Browse the repository at this point in the history
Convert the operators to being deployed by an ArgoCD ApplicationSet.
  • Loading branch information
cardoe committed Jun 26, 2024
1 parent d9ed990 commit d112c90
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ spec:
- '*'
destinations:
# make sure our operators don't install in the wrong place
- namespace: '!nautobot'
- namespace: 'rabbitmq-system'
server: '*'
- namespace: '!openstack'
- namespace: 'mariadb-operator'
server: '*'
- namespace: 'postgres-operator'
server: '*'
clusterResourceWhitelist:
- group: '*'
Expand Down
37 changes: 37 additions & 0 deletions apps/appsets/operators/operators.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: operators
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- matrix:
generators:
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
- git:
repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
revision: '{{index .metadata.annotations "uc_repo_ref"}}'
directories:
- path: operators/*
template:
metadata:
name: '{{.name}}-{{.path.basename}}'
spec:
project: operators
source:
repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
path: '{{.path.path}}'
destination:
server: '{{.server}}'
namespace: '{{.path.basename}}'
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
19 changes: 0 additions & 19 deletions apps/operators/mariadb-operator.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions apps/operators/messaging-topology-operator.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions apps/operators/postgres-operator.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions apps/operators/rabbitmq-operator.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions operators/messaging-topology-operator/kustomization.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions operators/rabbitmq-operator/kustomization.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions operators/rabbitmq-system/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
- https://github.com/rabbitmq/messaging-topology-operator/releases/download/v1.13.0/messaging-topology-operator-with-certmanager.yaml

patches:
- patch: |-
apiVersion: v1
kind: Namespace
metadata:
name: rabbitmq-system
$patch: delete

0 comments on commit d112c90

Please sign in to comment.