Add way to enable app of apps in kustomize way

This commit is contained in:
Roman Kathriner 2020-05-15 23:41:08 +02:00
parent 6bed858de3
commit 3abafe0361
8 changed files with 155 additions and 0 deletions

View File

@ -0,0 +1,4 @@
SERVER=https://kubernetes.default.svc
REPO_URL=https://github.com/argoproj/argocd-example-apps
TARGET_REVISION=HEADs
PROJECT=default

View File

@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: helm-guestbook
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: helm-guestbook
server: $(SERVER)
project: $(PROJECT)
source:
path: helm-guestbook
repoURL: $(REPO_URL)
targetRevision: $(TARGET_REVISION)

View File

@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: helm-hooks
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: helm-hooks
server: $(SERVER)
project: $(PROJECT)
source:
path: helm-hooks
repoURL: $(REPO_URL)
targetRevision: $(TARGET_REVISION)

View File

@ -0,0 +1,47 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configurations:
- kustomize-argocd-config.yaml
resources:
- helm-guestbook.yaml
- helm-hooks.yaml
- kustomize-guestbook.yaml
- namespaces.yaml
- sync-waves.yaml
configMapGenerator:
- name: argocd-env
envs:
- config.env
vars:
- name: SERVER
objref:
kind: ConfigMap
name: argocd-env
apiVersion: v1
fieldref:
fieldpath: data.SERVER
- name: TARGET_REVISION
objref:
kind: ConfigMap
name: argocd-env
apiVersion: v1
fieldref:
fieldpath: data.TARGET_REVISION
- name: PROJECT
objref:
kind: ConfigMap
name: argocd-env
apiVersion: v1
fieldref:
fieldpath: data.PROJECT
- name: REPO_URL
objref:
kind: ConfigMap
name: argocd-env
apiVersion: v1
fieldref:
fieldpath: data.REPO_URL

View File

@ -0,0 +1,13 @@
varReference:
- path: spec/destination/namespace
kind: Application
apiVersion: argoproj.io/v1alpha1
- path: spec/destination/server
kind: Application
apiVersion: argoproj.io/v1alpha1
- path: spec/project
kind: Application
apiVersion: argoproj.io/v1alpha1
- path: spec/source/targetRevision
kind: Application
apiVersion: argoproj.io/v1alpha1

View File

@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kustomize-guestbook
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: kustomize-guestbook
server: $(SERVER)
project: $(PROJECT)
source:
path: kustomize-guestbook
repoURL: $(REPO_URL)
targetRevision: $(TARGET_REVISION)

View File

@ -0,0 +1,27 @@
apiVersion: v1
kind: Namespace
metadata:
name: helm-guestbook
annotations:
argocd.argoproj.io/sync-wave: "-1"
---
apiVersion: v1
kind: Namespace
metadata:
name: helm-hooks
annotations:
argocd.argoproj.io/sync-wave: "-1"
---
apiVersion: v1
kind: Namespace
metadata:
name: kustomize-guestbook
annotations:
argocd.argoproj.io/sync-wave: "-1"
---
apiVersion: v1
kind: Namespace
metadata:
name: sync-waves
annotations:
argocd.argoproj.io/sync-wave: "-1"

View File

@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sync-waves
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: sync-waves
server: $(SERVER)
project: $(PROJECT)
source:
path: sync-waves
repoURL: $(REPO_URL)
targetRevision: $(TARGET_REVISION)