Repository navigation
lookup function not working on argocd #330
Copy link
Copy link
Open
Labels
Description
Can you please provide an alternative way to handle secrets {{ .Release.Name}}-lapi-secrets?
Because at the moment it's managed with this:
{{/*
Generate CS_LAPI_SECRET if not specified in values
*/}}
{{ define "lapi.csLapiSecret" }}
{{- if and (not .Values.lapi.enabled) (not .Values.lapi.secrets.csLapiSecret) }}
{{- fail "lapi.enabled is false, but no lapi.secrets.csLapiSecret provided" }}
{{- end }}
{{- if .Values.lapi.secrets.csLapiSecret }}
{{- .Values.lapi.secrets.csLapiSecret -}}
{{- else if (lookup "v1" "Secret" .Release.Namespace "crowdsec-lapi-secrets").data }}
{{- $obj := (lookup "v1" "Secret" .Release.Namespace "crowdsec-lapi-secrets").data -}}
{{- index $obj "csLapiSecret" | b64dec -}}
{{- else -}}
{{- randAscii 64 -}}
{{- end -}}
{{- end -}}
{{/*
Generate registrationToken if not specified in values
*/}}
{{ define "lapi.registrationToken" }}
{{- if and (not .Values.lapi.enabled) (empty .Values.lapi.secrets.registrationToken) }}
{{- fail "lapi.enabled is false, but no lapi.secrets.registrationToken provided" }}
{{- end }}
{{- if .Values.lapi.secrets.registrationToken }}
{{- .Values.lapi.secrets.registrationToken -}}
{{- else if (lookup "v1" "Secret" .Release.Namespace "crowdsec-lapi-secrets").data }}
{{- $obj := (lookup "v1" "Secret" .Release.Namespace "crowdsec-lapi-secrets").data -}}
{{- index $obj "registrationToken" | b64dec -}}
{{- else -}}
{{- randAlphaNum 48 -}}
{{- end -}}
{{- end -}}
But this mechanism isn't handled by ArgoCD (despite these open issues: argoproj/argo-cd#21745 argoproj/argo-cd#5202).
The lack of lookup support is starting to be noisy, especially when you use stakater/reloader
agent/lapi/appsec:
deployAnnotations:
reloader.stakater.com/auto: "true"
For instance, on every sync of ArgoCD, new secrets will be generated, then a new deployment of all the services will occur.
I know this is not directly a real problem of CrowdSec, but it would be really appreciated.
Thank you!
│ time="2026-02-13T11:13:05Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T11:14:40Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T11:14:40Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T12:00:48Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T12:00:48Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T12:12:45Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T12:12:45Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T12:31:17Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T12:31:17Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T14:16:13Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T14:16:13Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T14:42:46Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T14:42:46Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T14:53:55Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T14:53:55Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:10:53Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:10:53Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:16:52Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:16:52Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:19:20Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:19:20Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:25:10Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:25:10Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:48:23Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T15:48:23Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:06:21Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:06:21Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:10:28Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:10:28Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:20:44Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:20:44Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:21:52Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:21:52Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:28:20Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-appsec' of type 'Deployment' in namespace 'crowdsec'" │
│ time="2026-02-13T16:28:20Z" level=info msg="Changes detected in 'crowdsec-lapi-secrets' of type 'SECRET' in namespace 'crowdsec'; updated 'crowdsec-lapi' of type 'Deployment' in namespace 'crowdsec'"
Reactions are currently unavailable
Activity
github-actions commentedon Feb 13, 2026
@DrummyFloyd: Thanks for opening an issue, it is currently awaiting triage.
If you haven't already, please provide the following information:
bug,enhancementordocumentationagent,appsec,configuration,cscli,local-apiIn the meantime, you can:
Details
I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the forked project rr404/oss-governance-bot repository.
github-actions commentedon Feb 13, 2026
@DrummyFloyd: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.
/kind bug/kind documentation/kind enhancementDetails
I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the forked project rr404/oss-governance-bot repository.
DrummyFloyd commentedon Feb 13, 2026
/kind enhancement
blotus commentedon Feb 13, 2026
Hello,
Unfortunately, we currently have multiple features of the chart that do not work properly with Argo (such as our use of hooks to create secrets with LAPI/CAPI credentials, this issue and probably more still unknown :( ).
To be honest, I'm not really sure what's the best course of action for us: while we would like for users to be able to deploy the chart with the tools they are familiar with, I don't really want to workaround the limitations of those tools (helm by itself is already painful enough to work with...).
DrummyFloyd commentedon Feb 13, 2026
thank for the reply, and i understand
can we explore something similar to this => #205