Skip to content

Commit

Permalink
Add ability to mount extra ConfigMaps to OTel collector pods (open-te…
Browse files Browse the repository at this point in the history
…lemetry#47)

This change adds the ability to mount extra ConfigMaps by setting the extraConfigMapMounts value.

Values set example:

```
standaloneCollector:
  enabled: true
  
  configOverride:
    receivers:
      jaeger:
        protocols:
          grpc:
        remote_sampling:
          strategy_file: "/conf/jaeger/strategies.json"

extraConfigMapMounts:
- name: jaeger-sampling-strategies
  configMap: jaeger-sampling-strategies
  mountPath: /conf/jaeger
  readOnly: true
```

Extra ConfigMap example:

```
apiVersion: v1
kind: ConfigMap
metadata:
  name: jaeger-sampling-strategies
data:
  strategies.json: |-
    {
      "default_strategy":
        {
          "type": "probabilistic",
          "param": 1
        }
    }
```
  • Loading branch information
kaz-zahed authored Jun 10, 2021
1 parent a9bccac commit 3073fc6
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.5
version: 0.5.6
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 @@ -53,6 +53,14 @@ containers:
volumeMounts:
- mountPath: /conf
name: {{ .Chart.Name }}-configmap
{{- range .Values.extraConfigMapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
readOnly: {{ .readOnly }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- range .Values.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
Expand Down Expand Up @@ -84,6 +92,11 @@ volumes:
items:
- key: relay
path: relay.yaml
{{- range .Values.extraConfigMapMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- range .Values.extraHostPathMounts }}
- name: {{ .name }}
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 @@ -100,6 +100,7 @@ tolerations: []
affinity: {}

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

Expand Down

0 comments on commit 3073fc6

Please sign in to comment.