Skip to content

lookup function not working on argocd #330

Open

Description

@DrummyFloyd

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'"   

Activity

  1. github-actions commented on Feb 13, 2026

    @github-actions

    @DrummyFloyd: Thanks for opening an issue, it is currently awaiting triage.

    If you haven't already, please provide the following information:

    • kind : bug, enhancementor documentation
    • area : agent, appsec, configuration, cscli, local-api

    In the meantime, you can:

    1. Check Crowdsec Documentation to see if your issue can be self resolved.
    2. You can also join our Discord.
    3. Check Releases to make sure your agent is on the latest version.
    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.

  2. github-actions commented on Feb 13, 2026

    @github-actions

    @DrummyFloyd: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.

    • /kind bug
    • /kind documentation
    • /kind enhancement
    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.

  3. DrummyFloyd commented on Feb 13, 2026

    @DrummyFloyd
    Author

    /kind enhancement

  4. blotus commented on Feb 13, 2026

    @blotus
    Member

    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...).

  5. DrummyFloyd commented on Feb 13, 2026

    @DrummyFloyd
    Author

    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...).

    thank for the reply, and i understand
    can we explore something similar to this => #205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions