Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To ignore the health check of a specific Deployment #19284

Open
stoneeve415 opened this issue Jul 29, 2024 · 0 comments · May be fixed by #20462
Open

To ignore the health check of a specific Deployment #19284

stoneeve415 opened this issue Jul 29, 2024 · 0 comments · May be fixed by #20462
Labels
bug/enhancement component:application-sets Bulk application management related enhancement New feature or request type:usability Enhancement of an existing feature

Comments

@stoneeve415
Copy link

Summary

When using Resource Health, if a matching label is found, custom health check logic is used; otherwise, default logic is used.

Motivation

I want to ignore the status of a specific deployment (which is expected to be in progress).
Attempt 1:

Add argocd.argoproj.io/compare-options: IgnoreExtraneous to the deployment, as shown below:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
  annotations:
    argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
  ...

But this does not affect the health status.

Attempt 2:
Customize health checks using resource.customizations, and add the skip-health label to the deployment that needs to skip health checks.

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: argocd
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
data:
  resource.customizations: |
    apps/Deployment:
      health.lua: |
        local health_check = {}
        health_check.status = "Progressing"
        health_check.message = "replication controller is waiting for pods to run"
        if obj.metadata.labels ~= nil and type(obj.metadata.labels) == "table" and obj.metadata.labels["skip-health"] == "true" then
          health_check.status = "Healthy"
          health_check.message = "Application is progressing"
          return health_check
        end
        return nil

However, returning nil will cause all other deployments to be in the progressing state. Is there a way to directly invoke the default health check logic?

Proposal

Returning nil will trigger the default health check logic?

@stoneeve415 stoneeve415 added the enhancement New feature or request label Jul 29, 2024
@alexmt alexmt added bug/enhancement component:application-sets Bulk application management related type:usability Enhancement of an existing feature labels Jul 29, 2024
@CefBoud CefBoud linked a pull request Oct 18, 2024 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/enhancement component:application-sets Bulk application management related enhancement New feature or request type:usability Enhancement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants