falcosecurity/charts

Document Use of falcosidekick.config.existingSecret In Values File

Benjamin-Day opened this issue · 2 comments

After a lot of searching I have been unable to find documentation or examples for the use of the falcosidekick.config.existingSecret value. I may have missed it, but I think this would be excellent area to provide an example or two. I would like to be able to reference my slack webhook url (falcosidekick.config.slack.webhookurl) from an existing secret to avoid having to put it in my values file or configure it manually each time. I have found others online with similar desires but have yet to find a solution. Any feedback or links to existing documentation I may have missed are more than welcome. Thanks!

Hi,

The secrets are used as env vars, and these env vars are used to configure falcosidekick:

          envFrom:
            - secretRef:
                name: {{ include "falcosidekick.fullname" . }}
            {{- if .Values.config.existingSecret }}
            - secretRef:
                name: {{ .Values.config.existingSecret }}
            {{- end }}

A secret file is created by the chart and populated with the values from the values.yaml:

data:
  # Slack Output
  SLACK_WEBHOOKURL: "{{ .Values.config.slack.webhookurl | b64enc }}"
  SLACK_CHANNEL: "{{ .Values.config.slack.channel | b64enc }}"
  SLACK_OUTPUTFORMAT: "{{ .Values.config.slack.outputformat | b64enc }}"
  SLACK_FOOTER: "{{ .Values.config.slack.footer | b64enc }}"
  SLACK_ICON: "{{ .Values.config.slack.icon | b64enc }}"
  SLACK_USERNAME: "{{ .Values.config.slack.username | b64enc }}"
  SLACK_MINIMUMPRIORITY: "{{ .Values.config.slack.minimumpriority | b64enc }}"
  SLACK_MESSAGEFORMAT: "{{ .Values.config.slack.messageformat | b64enc }}"

You can also, create a secret by yourself and use it here. Just respect the same syntax by specifying the env vars. You can find them all in the docs of each output.

As you can see, first are used the "default" env vars from the secret file created by the chart, then those from the secret file you specify, it means the env vars from your file will override the previous ones.

Is it clearer?

Can we close this issue? Thanks.