Skip to content

Commit

Permalink
update argo-app-of-apps
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Santana <[email protected]>
csantanapr committed Mar 21, 2023
1 parent c6e5141 commit 2b70117
Showing 4 changed files with 67 additions and 51 deletions.
24 changes: 12 additions & 12 deletions multi-repo/argo-app-of-apps/dev/templates/ecsdemo-crystal.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
apiVersion: argoproj.io/v1alpha1
{{- if .Values.spec.apps.ecsdemoCrystal.createProject -}}
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: ecsdemo-crystal
namespace: argocd
name: {{ .Values.spec.apps.ecsdemoCrystal.project | default "ecsdemo-crystal" }}
namespace: {{ .Values.argoNamespace | default "argocd" }}
# Finalizer that ensures that project is not deleted until it is not referenced by any application
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destinations:
- namespace: ecsdemo-crystal
server: https://kubernetes.default.svc
- namespace: {{ .Values.spec.apps.ecsdemoCrystal.namespace | default "ecsdemo-crystal" }}
server: {{ .Values.spec.destination.server }}
sourceRepos:
- {{ .Values.spec.apps.ecsdemoCrystal.repoURL }}
---
{{- end }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ecsdemo-crystal
namespace: argocd
name: {{ .Values.spec.apps.ecsdemoCrystal.name | default "ecsdemo-crystal" }}
namespace: {{ .Values.argoNamespace | default "argocd" }}
labels:
{{- toYaml .Values.labels | nindent 4 }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: ecsdemo-crystal
project: {{ .Values.spec.apps.ecsdemoCrystal.project | default "ecsdemo-crystal" }}
destination:
namespace: ecsdemo-crystal
namespace: {{ .Values.spec.apps.ecsdemoCrystal.namespace | default "ecsdemo-crystal" }}
server: {{ .Values.spec.destination.server }}
source:
repoURL: {{ .Values.spec.apps.ecsdemoCrystal.repoURL }}
targetRevision: {{ .Values.spec.apps.ecsdemoCrystal.targetRevision }}
path: {{ .Values.spec.apps.ecsdemoCrystal.path }}
helm:
parameters:
- name: replicaCount
value: '3'
{{- toYaml .Values.spec.apps.ecsdemoCrystal.helm | nindent 6 }}
syncPolicy:
automated:
prune: true
23 changes: 12 additions & 11 deletions multi-repo/argo-app-of-apps/dev/templates/ecsdemo-frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
{{- if .Values.spec.apps.ecsdemoFrontend.createProject -}}
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: ecsdemo-frontend
namespace: argocd
name: {{ .Values.spec.apps.ecsdemoFrontend.project | default "ecsdemo-frontend" }}
namespace: {{ .Values.argoNamespace | default "argocd" }}
# Finalizer that ensures that project is not deleted until it is not referenced by any application
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destinations:
- namespace: ecsdemo-frontend
server: https://kubernetes.default.svc
- namespace: {{ .Values.spec.apps.ecsdemoFrontend.namespace | default "ecsdemo-frontend" }}
server: {{ .Values.spec.destination.server }}
sourceRepos:
- {{ .Values.spec.apps.ecsdemoFrontend.repoURL }}
{{- end }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ecsdemo-frontend
namespace: argocd
name: {{ .Values.spec.apps.ecsdemoFrontend.name | default "ecsdemo-frontend" }}
namespace: {{ .Values.argoNamespace | default "argocd" }}
labels:
{{- toYaml .Values.labels | nindent 4 }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: ecsdemo-frontend
project: {{ .Values.spec.apps.ecsdemoFrontend.project | default "ecsdemo-frontend" }}
destination:
namespace: ecsdemo-frontend
namespace: {{ .Values.spec.apps.ecsdemoFrontend.namespace | default "ecsdemo-frontend" }}
server: {{ .Values.spec.destination.server }}
source:
repoURL: {{ .Values.spec.apps.ecsdemoFrontend.repoURL }}
targetRevision: {{ .Values.spec.apps.ecsdemoFrontend.targetRevision }}
path: {{ .Values.spec.apps.ecsdemoFrontend.path }}
helm:
values: |-
{{ toYaml .Values.spec.apps.ecsdemoFrontend | nindent 8 }}
{{- toYaml .Values.spec.apps.ecsdemoFrontend.helm | nindent 6 }}
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=false # Created with IaC - https://github.com/argoproj/argo-cd/issues/7799
- CreateNamespace=false # Created with IaC - # https://github.com/argoproj/argo-cd/issues/7799
22 changes: 11 additions & 11 deletions multi-repo/argo-app-of-apps/dev/templates/ecsdemo-nodejs.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{{- if .Values.spec.apps.ecsdemoNodejs.createProject -}}
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: ecsdemo-nodejs
namespace: argocd
name: {{ .Values.spec.apps.ecsdemoNodejs.project | default "ecsdemo-nodejs" }}
namespace: {{ .Values.argoNamespace | default "argocd" }}
# Finalizer that ensures that project is not deleted until it is not referenced by any application
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destinations:
- namespace: ecsdemo-nodejs
server: https://kubernetes.default.svc
- namespace: {{ .Values.spec.apps.ecsdemoNodejs.namespace | default "ecsdemo-nodejs" }}
server: {{ .Values.spec.destination.server }}
sourceRepos:
- {{ .Values.spec.apps.ecsdemoNodejs.repoURL }}
---
{{- end }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ecsdemo-nodejs
namespace: argocd
name: {{ .Values.spec.apps.ecsdemoNodejs.name | default "ecsdemo-nodejs" }}
namespace: {{ .Values.argoNamespace | default "argocd" }}
labels:
{{- toYaml .Values.labels | nindent 4 }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: ecsdemo-nodejs
project: {{ .Values.spec.apps.ecsdemoNodejs.project | default "ecsdemo-nodejs" }}
destination:
namespace: ecsdemo-nodejs
namespace: {{ .Values.spec.apps.ecsdemoNodejs.namespace | default "ecsdemo-nodejs" }}
server: {{ .Values.spec.destination.server }}
source:
repoURL: {{ .Values.spec.apps.ecsdemoNodejs.repoURL }}
targetRevision: {{ .Values.spec.apps.ecsdemoNodejs.targetRevision }}
path: {{ .Values.spec.apps.ecsdemoNodejs.path }}
helm:
parameters:
- name: replicaCount
value: '3'
{{- toYaml .Values.spec.apps.ecsdemoNodejs.helm | nindent 6 }}
syncPolicy:
automated:
prune: true
49 changes: 32 additions & 17 deletions multi-repo/argo-app-of-apps/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
argoNamespace: ''

labels:
env: dev
spec:
destination:
server: https://kubernetes.default.svc
# All helm parameters can be sent by IaC code (Terraform or CDK)
# All helm parameters can be sent by IaC code (Terraform or CDK)
apps:
ecsdemoFrontend:
createProject: true
#repoURL: [email protected]:aws-containers/ecsdemo-frontend.git
repoURL: https://github.com/aws-containers/ecsdemo-frontend.git
repoURL: https://github.com/aws-containers/ecsdemo-frontend.git
targetRevision: main
path: kubernetes/helm/ecsdemo-frontend
ingress:
enabled: true
annotations:
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=dev,Team=ecsdemo-frontend
alb.ingress.kubernetes.io/target-type: ip
className: alb
hosts:
- paths:
- path: /
pathType: Prefix
helm:
values: |-
ingress:
enabled: true
annotations:
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=dev,Team=ecsdemo-frontend
alb.ingress.kubernetes.io/target-type: ip
className: alb
hosts:
- paths:
- path: /
pathType: Prefix
ecsdemoNodejs:
repoURL: https://github.com/aws-containers/ecsdemo-nodejs.git
createProject: true
repoURL: https://github.com/aws-containers/ecsdemo-nodejs.git
#repoURL: [email protected]:aws-containers/ecsdemo-nodejs.git
targetRevision: main
path: kubernetes/helm/ecsdemo-nodejs
helm:
parameters:
- name: replicaCount
value: '3'
ecsdemoCrystal:
repoURL: https://github.com/aws-containers/ecsdemo-crystal.git
createProject: true
repoURL: https://github.com/aws-containers/ecsdemo-crystal.git
#repoURL: [email protected]:aws-containers/ecsdemo-crystal.git
targetRevision: main
path: kubernetes/helm/ecsdemo-crystal
path: kubernetes/helm/ecsdemo-crystal
helm:
parameters:
- name: replicaCount
value: '3'

0 comments on commit 2b70117

Please sign in to comment.