diff --git a/wavefront/README.md b/wavefront/README.md index 91a3444..da60944 100644 --- a/wavefront/README.md +++ b/wavefront/README.md @@ -59,6 +59,7 @@ The following tables lists the configurable parameters of the Wavefront chart an | `clusterName` | Unique name for the Kubernetes cluster | `KUBERNETES_CLUSTER_NAME` | | `wavefront.url` | Wavefront URL for your cluster | `https://YOUR_CLUSTER.wavefront.com` | | `wavefront.token` | Wavefront API Token | `YOUR_API_TOKEN` | +| `wavefront.tokenFromSecret` | Wavefront API Token from a Secret | `nil` | | `collector.enabled` | Setup and enable the Wavefront collector to gather metrics | `true` | | `collector.image.repository` | Wavefront collector image registry and name | `projects.registry.vmware.com/tanzu_observability/kubernetes-collector` | | `collector.image.tag` | Wavefront collector image tag | `{TAG_NAME}` | diff --git a/wavefront/templates/api-token-secret.yaml b/wavefront/templates/api-token-secret.yaml index f15534d..2f23c90 100644 --- a/wavefront/templates/api-token-secret.yaml +++ b/wavefront/templates/api-token-secret.yaml @@ -1,4 +1,4 @@ -{{- if .Values.wavefront.token }} +{{- if and .Values.wavefront.token (not .Values.wavefront.tokenFromSecret) }} apiVersion: v1 kind: Secret metadata: diff --git a/wavefront/templates/proxy-deployment.yaml b/wavefront/templates/proxy-deployment.yaml index 9b1bf0d..a2d8255 100644 --- a/wavefront/templates/proxy-deployment.yaml +++ b/wavefront/templates/proxy-deployment.yaml @@ -31,11 +31,19 @@ spec: env: - name: WAVEFRONT_URL value: {{ .Values.wavefront.url }}/api + {{- if .Values.wavefront.tokenFromSecret }} + - name: WAVEFRONT_TOKEN + valueFrom: + secretKeyRef: + name: {{ .Values.wavefront.tokenFromSecret }} + key: api-token + {{- else }} - name: WAVEFRONT_TOKEN valueFrom: secretKeyRef: name: {{ template "wavefront.fullname" . }} key: api-token + {{- end }} - name: WAVEFRONT_PROXY_ARGS value: {{ .Values.proxy.args }} {{- if .Values.proxy.tracePort }} --traceListenerPorts {{ .Values.proxy.tracePort }}{{- end -}} diff --git a/wavefront/values.yaml b/wavefront/values.yaml index 53640c7..9b9b7d3 100644 --- a/wavefront/values.yaml +++ b/wavefront/values.yaml @@ -13,6 +13,8 @@ installationMethod: helm wavefront: url: https://YOUR_CLUSTER.wavefront.com token: YOUR_API_TOKEN +# OPTIONAL, Allow to use a secret to pull the credentials, the required key is `api-token` + tokenFromSecret: "" ## Wavefront Collector is responsible to get all Kubernetes metrics from your cluster.