feat(bootstrap): add health check and sync wave for ApplicationSets

This commit is contained in:
Khue Doan 2021-11-26 11:57:02 +07:00
parent d034851e56
commit 38cacd468f
6 changed files with 22 additions and 9 deletions

View File

@ -12,4 +12,4 @@ argocd:
.PHONY: root-app
root-app:
kustomize build ./root-app | kubectl apply -f -
kubectl apply -f root-app/applicationsets/bootstrap.yaml

View File

@ -16,3 +16,16 @@ data:
end
end
return hs
resource.customizations.health.argoproj.io_ApplicationSet: |
hs = {}
hs.status = "Progressing"
hs.message = ""
if obj.status ~= nil then
if obj.status.health ~= nil then
hs.status = obj.status.health.status
if obj.status.health.message ~= nil then
hs.message = obj.status.health.message
end
end
end
return hs

View File

@ -2,6 +2,8 @@ apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: apps
annotations:
argocd.argoproj.io/sync-wave: "4"
spec:
generators:
- git:
@ -12,8 +14,6 @@ spec:
template:
metadata:
name: '{{path.basename}}'
annotations:
argocd.argoproj.io/sync-wave: "4"
spec:
destination:
name: in-cluster

View File

@ -2,6 +2,8 @@ apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: bootstrap
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
generators:
- git:
@ -12,8 +14,6 @@ spec:
template:
metadata:
name: '{{path.basename}}'
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
destination:
name: in-cluster

View File

@ -2,6 +2,8 @@ apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: platform
annotations:
argocd.argoproj.io/sync-wave: "3"
spec:
generators:
- git:
@ -12,8 +14,6 @@ spec:
template:
metadata:
name: '{{path.basename}}'
annotations:
argocd.argoproj.io/sync-wave: "3"
spec:
destination:
name: in-cluster

View File

@ -2,6 +2,8 @@ apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: system
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
generators:
- git:
@ -12,8 +14,6 @@ spec:
template:
metadata:
name: '{{path.basename}}'
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
destination:
name: in-cluster