Skip to content

Status fields for resource health in VaultStaticSecret and VaultDynamicSecret resources #538

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

Open
dmavis opened this issue Dec 26, 2023 · 6 comments · May be fixed by #1058
Open

Status fields for resource health in VaultStaticSecret and VaultDynamicSecret resources #538

dmavis opened this issue Dec 26, 2023 · 6 comments · May be fixed by #1058
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dmavis
Copy link

dmavis commented Dec 26, 2023

Is your feature request related to a problem? Please describe.
GitOps tools like Argo CD have the notion of resource health. When using Argo CD, the health of resources help indicate if any issues or errors exist in the application. Teaching Argo CD about the health of Vault secrets resources like VaultStaticSecret and VaultDynamicSecret enables those resources to accurately provide their health status to Argo CD. Both the VaultStaticSecret and VaultDynamicSecret resources don't seem to have any fields in their status that would make that possible (e.g. a valid or error field or even the standard conditions field).

Describe the solution you'd like
Add field(s) to the status of VaultStaticSecret and VaultDynamicSecret resources that indicate the state of the secret, similar to the valid and error fields in the VaultPKISecret, VaultAuth, and VaultConnection resources. Even having a standard conditions field would help communicate any issues and provide easy access to any error details.

Describe alternatives you've considered
Clear communication of the resource status is critical when using the extensible, declarative resource model provided by Kubernetes, so any alternatives or workarounds would probably not be appropriate for this use case

@dmavis dmavis added the enhancement New feature or request label Dec 26, 2023
@benashz benashz self-assigned this Jan 11, 2024
@benashz
Copy link
Collaborator

benashz commented Jan 11, 2024

Thanks for submitting this enhancement request @dmavis - I like the idea of adopting Conditions for all VSO CRDs.

@benashz benashz added this to the v0.6.0 milestone Jan 11, 2024
@dmavis
Copy link
Author

dmavis commented Jan 11, 2024

Thanks for submitting this enhancement request @dmavis - I like the idea of adopting Conditions for all VSO CRDs.

Excellent! I completely agree that adding conditions to all CRDs would be the best option. In my internal work building Kubernetes controllers/operators, I've found using conditions to be a great, flexible way to communicate various status details and many Kubernetes-based tools automatically have some understanding of them.

@ChristianCiach
Copy link

ChristianCiach commented Apr 30, 2024

The missing status is unfortunate, since I tried to implement a custom health-indicator for ArgoCD, but there is nothing inside the VaultStaticSecret or VaultDynamicSecret resources that I can work with to assess the health of the object. This means that these objects always appear to be "healthy" when looking at them via the ArgoCD UI.

For comparison, external-secrets.io properly sets the status of their resources, and ArgoCD even bundles an appropriate health-check: https://github.com/argoproj/argo-cd/blob/master/resource_customizations/external-secrets.io/ExternalSecret/health.lua

Currently, this is the best I can do:

  resource.customizations: |
    secrets.hashicorp.com/VaultStaticSecret:
      health.lua: |
        hs = {}
        hs.status = "Progressing"
        hs.message = "Waiting for Secret creation..."
        if obj.status ~= nil and obj.status.secretMAC ~= nil then
          hs.status = "Healthy"
          hs.message = ""
        end
        return hs

But this only works correctly when deploying the object for the first time. If the VaultStaticSecret degrades later (e.g. patched with a wrong configuration or some vault backend failure) there is currently no way to notice that and the object continues to appear as "healthy".

@benashz benashz modified the milestones: v0.7.0, v0.8.0 May 15, 2024
@benashz benashz modified the milestones: v0.8.0, v0.9.0 Jul 17, 2024
@benashz benashz modified the milestones: v0.9.0, v0.10.0 Oct 8, 2024
@dm3ch
Copy link

dm3ch commented Nov 27, 2024

I see that this feature request have changed milestone few times.

Is there anything tricky? Would you accept external PR with this functionality? And if it's so do you have any requirements for implementation?

@sergeyshevch
Copy link

Hello! is there any progress about this feature? We are also interested in correct resource health in ArgoCD

@sergeyshevch
Copy link

Implemented in #1058

@benashz benashz linked a pull request Apr 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants