Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[filebeat] additionals labels
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymayflower committed Jul 8, 2019
1 parent e1dbc59 commit 8b4b03b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions filebeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ helm install --name filebeat elastic/filebeat --version 7.2.0 --set imageTag=7.2
| `imagePullSecrets` | Configuration for [imagePullSecrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-pod-that-uses-your-secret) so that you can use a private registry for your image | `[]` |
| `managedServiceAccount` | Whether the `serviceAccount` should be managed by this helm chart. Set this to `false` in order to manage your own service account and related roles. | `true` |
| `podAnnotations` | Configurable [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) applied to all Filebeat pods | `{}` |
| `labels` | Configurable [label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) applied to all Filebeat pods | `{}` |
| `podSecurityContext` | Configurable [podSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for Filebeat pod execution environment | `runAsUser: 0`<br>`privileged: false` |
| `livenessProbe` | Parameters to pass to [liveness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) checks for values such as timeouts and thresholds. | `failureThreshold: 3`<br>`initialDelaySeconds: 10`<br>`periodSeconds: 10`<br>`successThreshold: 3`<br>`timeoutSeconds: 5` |
| `readinessProbe` | Parameters to pass to [readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) checks for values such as timeouts and thresholds. | `failureThreshold: 3`<br>`initialDelaySeconds: 10`<br>`periodSeconds: 10`<br>`successThreshold: 3`<br>`timeoutSeconds: 5` |
Expand Down
3 changes: 3 additions & 0 deletions filebeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
8 changes: 8 additions & 0 deletions filebeat/tests/filebeat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,11 @@ def test_adding_a_extra_volume_with_volume_mount():
assert {'name': 'extras', 'emptyDir': {}} in extraVolume
extraVolumeMounts = r['daemonset'][name]['spec']['template']['spec']['containers'][0]['volumeMounts']
assert {'name': 'extras', 'mountPath': '/usr/share/extras', 'readOnly': True} in extraVolumeMounts

def test_adding_pod_labels():
config = '''
labels:
app.kubernetes.io/name: filebeat
'''
r = helm_template(config)
assert r['daemonset'][name]['metadata']['labels']['app.kubernetes.io/name'] == 'filebeat'
3 changes: 3 additions & 0 deletions filebeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ readinessProbe:
# Whether this chart should self-manage its service account, role, and associated role binding.
managedServiceAccount: true

# additionals labels
labels: {}

podAnnotations: {}
# iam.amazonaws.com/role: es-cluster

Expand Down

0 comments on commit 8b4b03b

Please sign in to comment.