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

Support customSecretName for nri-statsd #1324

Open
RoseSecurity opened this issue Apr 4, 2024 · 1 comment
Open

Support customSecretName for nri-statsd #1324

RoseSecurity opened this issue Apr 4, 2024 · 1 comment
Labels
feature request Categorizes issue or PR as related to a new feature or enhancement.

Comments

@RoseSecurity
Copy link

RoseSecurity commented Apr 4, 2024

Description

Right now, the nri-statsd chart requires the API key to be hardcoded in the values.yaml or injected during the helm install, but it would be better if a customSecretName could be utilized to reference the secret location like the other nri-bundle elements utilize.

Acceptance Criteria

Before:

global:
   insightsKey: ""

After:

global:
  customSecretName: nri-statsd-key

Implementation

  • Maybe something like this for the _helpers.tpl:
{{/*
Return the customSecretName where the New Relic Insights API key is being stored
*/}}
{{- define "nri-statsd.customSecretName" -}}
{{- if .Values.global }}
  {{- if .Values.global.customSecretName }}
      {{- .Values.global.customSecretName -}}
  {{- else -}}
      {{- .Values.customSecretName | default "" -}}
  {{- end -}}
{{- else -}}
    {{- .Values.customSecretName | default "" -}}
{{- end -}}
{{- end -}}

At the bottom:

{{/*
Returns if the template should render, it checks if the required values
insightsKey or customSecretName and cluster are set.
*/}}
{{- define "nri-statsd.areValuesValid" -}}
{{- $cluster := include "nri-statsd.cluster" . -}}
{{- $insightsKey := include "nri-statsd.insightsKey" . -}}
{{- $customSecretName := include "nri-statsd.customSecretName" . -}}
{{- and $cluster (or $insightsKey $customSecretName) }}
{{- end -}}

Then update the configmap to use either value

@RoseSecurity RoseSecurity added the feature request Categorizes issue or PR as related to a new feature or enhancement. label Apr 4, 2024
@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Categorizes issue or PR as related to a new feature or enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant