Skip to content

Commit 45e0e6f

Browse files
authored
Merge pull request #26 from yuri-1987/add_option_to_use_existing_secret_ref
Added option to use existing secretRef for api key
2 parents c86767e + 5ac250a commit 45e0e6f

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
For actual scalyr agent changelog, please see https://github.com/scalyr/scalyr-agent-2/blob/release/CHANGELOG.md
44

5+
## 0.2.21
6+
7+
- Add new ``existingSecretRef`` chart value. When set (defaults to unset), it will use that
8+
value for the agent ``secretKeyRef`` ``name`` field value. When not set, ``secretKeyRef``
9+
``name`` field value defaults to ``{{ include "scalyr-helm.fullname" . }}-scalyr-api-key``.
10+
11+
This allows users to re-use the existing Kubernetes secret where DataSet API key is stored.
12+
513
## 0.2.20
614

715
- Update agent to the latest stable version (v2.1.36).

charts/scalyr-agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: scalyr-agent
33
description: A Helm chart for deploying the Scalyr agent
44
type: application
5-
version: 0.2.20
5+
version: 0.2.21
66
appVersion: 2.1.36
77
keywords:
88
- scalyr

charts/scalyr-agent/templates/daemonset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ spec:
8585
- name: "SCALYR_API_KEY"
8686
valueFrom:
8787
secretKeyRef:
88+
{{- if .Values.existingSecretRef }}
89+
name: {{ .Values.existingSecretRef }}
90+
{{- else }}
8891
name: "{{ include "scalyr-helm.fullname" . }}-scalyr-api-key"
92+
{{- end }}
8993
key: "scalyr-api-key"
9094
{{- if (or (or (.Values.scalyr.k8s.enableMetrics) (.Values.scalyr.k8s.enableLogs)) (.Values.scalyr.k8s.enableExplorer)) }}
9195
- name: "SCALYR_K8S_CLUSTER_NAME"

charts/scalyr-agent/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ spec:
8686
- name: "SCALYR_API_KEY"
8787
valueFrom:
8888
secretKeyRef:
89+
{{- if .Values.existingSecretRef }}
90+
name: {{ .Values.existingSecretRef }}
91+
{{- else }}
8992
name: "{{ include "scalyr-helm.fullname" . }}-scalyr-api-key"
93+
{{- end }}
9094
key: "scalyr-api-key"
9195
{{- if (or (or (.Values.scalyr.k8s.enableMetrics) (.Values.scalyr.k8s.enableLogs)) (.Values.scalyr.k8s.enableExplorer)) }}
9296
- name: "SCALYR_K8S_CLUSTER_NAME"

charts/scalyr-agent/templates/secret.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if eq .Values.existingSecretRef "" -}}
12
{{- $name := .Values.scalyr.apiKey | required ".Values.scalyr.apiKey is required." -}}
23

34
apiVersion: v1
@@ -8,3 +9,4 @@ metadata:
89
{{- include "scalyr-helm.labels" . | nindent 4 }}
910
data:
1011
scalyr-api-key: {{ .Values.scalyr.apiKey | b64enc }}
12+
{{- end }}

charts/scalyr-agent/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,6 @@ affinity: {}
133133
serviceAccount:
134134
# serviceAccount.annotations -- optional arbitrary service account annotations
135135
annotations: {}
136+
137+
# Use this value if the Scalyr API key is already stored in a Kubernetes secret that was created by an external secrets operator or similar.
138+
existingSecretRef: ""

0 commit comments

Comments
 (0)