Skip to content

Introduce an argo-healthcheck make target#345

Merged
mbaldessari merged 1 commit intovalidatedpatterns:mainfrom
mbaldessari:argo-healthcheck
Sep 25, 2023
Merged

Introduce an argo-healthcheck make target#345
mbaldessari merged 1 commit intovalidatedpatterns:mainfrom
mbaldessari:argo-healthcheck

Conversation

@mbaldessari
Copy link
Copy Markdown
Contributor

This is a simple quick check to see if all argo applications in all
namespaces are synced and error out if they are not.

Synced example:

$ make argo-healthcheck
make -f common/Makefile argo-healthcheck
make[1]: Entering directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'
Checking argo applications
multicloud-gitops-hub acm -> Synced
multicloud-gitops-hub config-demo -> Synced
multicloud-gitops-hub golang-external-secrets -> Synced
multicloud-gitops-hub hello-world -> Synced
multicloud-gitops-hub vault -> Synced
openshift-gitops multicloud-gitops-hub -> Synced
make[1]: Leaving directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'

Not synced example:

$ make argo-healthcheck
make -f common/Makefile argo-healthcheck
make[1]: Entering directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'
Checking argo applications
multicloud-gitops-hub acm -> Synced
multicloud-gitops-hub config-demo -> OutOfSync
multicloud-gitops-hub golang-external-secrets -> Synced
multicloud-gitops-hub hello-world -> Synced
multicloud-gitops-hub vault -> Synced
openshift-gitops multicloud-gitops-hub -> Synced
Applications not synced: 1
make[1]: *** [common/Makefile:115: argo-healthcheck] Error 1
make[1]: Leaving directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'
make: *** [Makefile:12: argo-healthcheck] Error 2

@mbaldessari mbaldessari force-pushed the argo-healthcheck branch 2 times, most recently from 7847dc8 to 3d6edce Compare August 16, 2023 15:10
This is a simple quick check to see if all argo applications in all
namespaces are synced and error out if they are not.

Synced example:

    $ make argo-healthcheck
    make -f common/Makefile argo-healthcheck
    make[1]: Entering directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'
    Checking argo applications
    mcg-private-hub acm -> Sync: Synced - Health: Healthy
    mcg-private-hub config-demo -> Sync: Synced - Health: Healthy
    mcg-private-hub golang-external-secrets -> Sync: Synced - Health: Healthy
    mcg-private-hub hello-world -> Sync: Synced - Health: Healthy
    mcg-private-hub vault -> Sync: Synced - Health: Healthy
    openshift-gitops mcg-private-hub -> Sync: Synced - Health: Healthy
    make[1]: Leaving directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'

Not synced example:

    $ make argo-healthcheck
    make -f common/Makefile argo-healthcheck
    make[1]: Entering directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'
    Checking argo applications
    mcg-private-hub acm -> Sync: Synced - Health: Healthy
    mcg-private-hub config-demo -> Sync: Synced - Health: Degraded
    mcg-private-hub golang-external-secrets -> Sync: Synced - Health: Healthy
    mcg-private-hub hello-world -> Sync: Synced - Health: Healthy
    mcg-private-hub vault -> Sync: Synced - Health: Progressing
    openshift-gitops mcg-private-hub -> Sync: Synced - Health: Healthy
    Some applications are not synced or are unhealthy
    make[1]: *** [common/Makefile:115: argo-healthcheck] Error 1
    make[1]: Leaving directory '/home/michele/Engineering/cloud-patterns/multicloud-gitops'
    make: *** [Makefile:12: argo-healthcheck] Error 2
@day0hero
Copy link
Copy Markdown
Contributor

@mbaldessari - this is a good idea ... iirc, @claudiol is working on better status in the operator too. a combination of both of these things will be good for all the ci's ...

just a thought - it'd be neato if when the application is not synced, we get a dump of the output from the application so we can see where its failing/not -syncing

@mbaldessari
Copy link
Copy Markdown
Contributor Author

Thanks @day0hero, the stuff that might land in the operator will be async by design, this is more "is everything green now" kind of question. The way I plan to use this is in my deployments scripts to wait for a deployment to be completed with a single comment (.e.g if make argo-healthcheck returns 0 I am good to go). I'd avoid adding any more output mainly because doing it in shell wrapped in Makefile is a terrible thing to do already ;)

@mbaldessari mbaldessari merged commit 8846ec3 into validatedpatterns:main Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants