[stable/newrelic-infrastructure] add ability to use custom secret for license key (#15707)

* [stable/newrelic-infrastructure] add ability to use custom secret for license key

Signed-off-by: Eriks Zelenka <isindir@users.sf.net>

* fix: deduplicate code for license secret key mounting

Signed-off-by: Eriks Zelenka <isindir@users.sf.net>

* fix: improve readme and license key env variable instantiation code

Signed-off-by: Eriks Zelenka <isindir@users.sf.net>
This commit is contained in:
Eriks Zelenka
2019-07-22 07:22:52 -07:00
committed by Kubernetes Prow Robot
parent 297a5c93d7
commit 37c213fd5b
4 changed files with 22 additions and 10 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart to deploy the New Relic Infrastructure Agent as a DaemonSet
name: newrelic-infrastructure
version: 0.13.0
version: 0.13.1
appVersion: 1.9.0
home: https://hub.docker.com/r/newrelic/infrastructure-k8s/
source:
+6 -4
View File
@@ -8,16 +8,18 @@ This chart will deploy the New Relic Infrastructure agent as a Daemonset.
| Parameter | Description | Default |
| ------------------------- | ------------------------------------------------------------ | -------------------------- |
| `cluster` | The cluster name for the Kubernetes cluster. | |
| `licenseKey` | The [license key](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/license-key) for your New Relic Account. | |
| `config` | A `newrelic.yml` file if you wish to provide. | |
| `cluster` | The cluster name for the Kubernetes cluster. | |
| `licenseKey` | The [license key](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/license-key) for your New Relic Account. This will be preferred configuration option if both `licenseKey` and `customSecret` are specified. | |
| `customSecret.name` | Name of the Secret object where the license key is stored | |
| `customSecret.key` | Key in the Secret object where the license key is stored. | |
| `config` | A `newrelic.yml` file if you wish to provide. | |
| `kubeStateMetricsUrl` | If provided, the discovery process for kube-state-metrics endpoint won't be triggered. Example: http://172.17.0.3:8080 |
| `kubeStateMetricsTimeout` | Timeout for accessing kube-state-metrics in milliseconds. If not set the newrelic default is 5000 | |
| `rbac.create` | Enable Role-based authentication | `true` |
| `rbac.pspEnabled` | Enable pod security policy support | `false` |
| `image.name` | The container to pull. | `newrelic/infrastructure` |
| `image.pullPolicy` | The pull policy. | `IfNotPresent` |
| `image.tag` | The version of the container to pull. | `1.9.0` |
| `image.tag` | The version of the container to pull. | `1.9.0` |
| `resources` | Any resources you wish to assign to the pod. | See Resources below |
| `verboseLog` | Should the agent log verbosely. (Boolean) | `false` |
| `priorityClassName` | Scheduling priority of the pod | `nil` |
@@ -1,4 +1,4 @@
{{- if and .Values.licenseKey .Values.cluster }}
{{- if and (or .Values.licenseKey .Values.customSecret) .Values.cluster }}
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
@@ -35,18 +35,23 @@ spec:
- name: NRIA_LICENSE_KEY
valueFrom:
secretKeyRef:
{{- if .Values.licenseKey }}
name: {{ template "newrelic.fullname" . }}-config
key: license
{{- else }}
name: {{ .Values.customSecret.name }}
key: {{ .Values.customSecret.key }}
{{- end }}
- name: "CLUSTER_NAME"
value: "{{ .Values.cluster }}"
{{- if .Values.kubeStateMetricsUrl }}
{{- if .Values.kubeStateMetricsUrl }}
- name: "KUBE_STATE_METRICS_URL"
value: "{{ .Values.kubeStateMetricsUrl }}"
{{- end }}
{{- if .Values.kubeStateMetricsTimeout }}
{{- end }}
{{- if .Values.kubeStateMetricsTimeout }}
- name: TIMEOUT
value: {{ .Values.kubeStateMetricsTimeout | quote }}
{{- end }}
{{- end }}
- name: "NRIA_DISPLAY_NAME"
valueFrom:
fieldRef:
@@ -1,5 +1,10 @@
# IMPORTANT: Specify your New Relic API key here.
# licenseKey:
#
# or Specify secret which contains New Relic API key
# customSecret:
# name: secret_name
# key: secret_key
# IMPORTANT: The Kubernetes cluster name
# https://docs.newrelic.com/docs/kubernetes-monitoring-integration