Skip to content

Commit

Permalink
implement secret mounting (#41)
Browse files Browse the repository at this point in the history
Adds the ability for people to mount secrets. This can be used for referencing certificates in the config, like so:

secretMounts:
- name: jaeger-cert
  secretName: jaeger-cert
  mountPath: /etc/tls
  readOnly: true
  subPath: jaeger # subPath is optional
exporters:
    jaeger:
      endpoint: localhost
      cert_file: /etc/tls/tls.crt
      key_file: /etc/tls/tls.key
  • Loading branch information
jdgeisler authored Mar 30, 2021
1 parent 128aa34 commit 0a4c4e4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: opentelemetry-collector
version: 0.5.1
version: 0.5.2
description: OpenTelemetry Collector Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand Down
13 changes: 13 additions & 0 deletions charts/opentelemetry-collector/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ containers:
mountPropagation: {{ .mountPropagation }}
{{- end }}
{{- end }}
{{- range .Values.secretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
readOnly: {{ .readOnly }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- if and $.isAgent .Values.agentCollector.containerLogs.enabled }}
- name: varlogpods
mountPath: /var/log/pods
Expand All @@ -81,6 +89,11 @@ volumes:
hostPath:
path: {{ .hostPath }}
{{- end }}
{{- range .Values.secretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- if and $.isAgent .Values.agentCollector.containerLogs.enabled }}
- name: varlogpods
hostPath:
Expand Down
1 change: 1 addition & 0 deletions charts/opentelemetry-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ affinity: {}

extraEnvs: []
extraHostPathMounts: []
secretMounts: []

# Configuration for ports, shared between agentCollector, standaloneCollector and service.
# Can be overridden here or for agentCollector and standaloneCollector independently.
Expand Down

0 comments on commit 0a4c4e4

Please sign in to comment.