This repository was archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Filebeat] Support for Deployment Kubernetes resource #822
Closed
operatorequals
wants to merge
12
commits into
elastic:master
from
operatorequals:filebeat-deployment-support-feature
Closed
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ed1fbf6
Support for Deployment Kubernetes resource
2e1a6d6
Tests on 'deploymentType' YAML directive
959abbf
Similar to Metricbeat Templating
481104e
Fix double value in `filebeat/values.yaml`
eaa12c6
Fix missing parameter in Filebeat Deployment template
9632ad8
Merge branch 'master' into filebeat-deployment-support-feature
operatorequals fe60db0
Update filebeat/templates/configmap.yaml
operatorequals f4f0734
Update filebeat/templates/configmap.yaml
operatorequals 8e3a2a5
Update filebeat/templates/daemonset.yaml
operatorequals 717cbe5
Resolving comments for 8e3a2a530a94963033b2c9a98632ce3ef27653cb
dca3974
Add explanation for deployment/daemonset values scheme
9f25d1f
Merge branch 'master' into filebeat-deployment-support-feature
operatorequals File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| --- | ||
| {{- if eq (printf "%s" .Values.deploymentType | lower) "deployment" }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ template "filebeat.fullname" . }} | ||
| labels: | ||
| app: "{{ template "filebeat.fullname" . }}" | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
|
jmlrt marked this conversation as resolved.
|
||
| heritage: {{ .Release.Service | quote }} | ||
| release: {{ .Release.Name | quote }} | ||
| {{- range $key, $value := .Values.labels }} | ||
| {{ $key }}: {{ $value | quote }} | ||
| {{- end }} | ||
|
jmlrt marked this conversation as resolved.
|
||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: "{{ template "filebeat.fullname" . }}" | ||
| release: {{ .Release.Name | quote }} | ||
|
jmlrt marked this conversation as resolved.
|
||
| template: | ||
| metadata: | ||
| annotations: | ||
| {{- range $key, $value := .Values.podAnnotations }} | ||
| {{ $key }}: {{ $value | quote }} | ||
| {{- end }} | ||
| {{/* This forces a restart if the configmap has changed */}} | ||
| {{- if .Values.filebeatConfig }} | ||
| configChecksum: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }} | ||
| {{- end }} | ||
| name: "{{ template "filebeat.fullname" . }}" | ||
| labels: | ||
| app: "{{ template "filebeat.fullname" . }}" | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service | quote }} | ||
| release: {{ .Release.Name | quote }} | ||
| {{- range $key, $value := .Values.labels }} | ||
| {{ $key }}: {{ $value | quote }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.tolerations }} | ||
| tolerations: {{ toYaml . | nindent 6 }} | ||
| {{- end }} | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: {{ toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.priorityClassName }} | ||
| priorityClassName: {{ .Values.priorityClassName }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: {{ toYaml . | nindent 8 -}} | ||
| {{- end }} | ||
| serviceAccountName: {{ template "filebeat.serviceAccount" . }} | ||
| terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }} | ||
| {{- if .Values.hostNetworking }} | ||
| hostNetwork: true | ||
| dnsPolicy: ClusterFirstWithHostNet | ||
| {{- end }} | ||
| volumes: | ||
| {{- range .Values.secretMounts }} | ||
| - name: {{ .name }} | ||
| secret: | ||
| secretName: {{ .secretName }} | ||
| {{- end }} | ||
| {{- if .Values.filebeatConfig }} | ||
| - name: filebeat-config | ||
| configMap: | ||
| defaultMode: 0600 | ||
| name: {{ template "filebeat.fullname" . }}-config | ||
| {{- end }} | ||
| - name: data | ||
| hostPath: | ||
| path: {{ .Values.hostPathRoot }}/{{ template "filebeat.fullname" . }}-{{ .Release.Namespace }}-data | ||
| type: DirectoryOrCreate | ||
| - name: varlibdockercontainers | ||
| hostPath: | ||
| path: /var/lib/docker/containers | ||
| - name: varlog | ||
| hostPath: | ||
| path: /var/log | ||
| - name: varrundockersock | ||
| hostPath: | ||
| path: /var/run/docker.sock | ||
| {{- if .Values.extraVolumes }} | ||
| {{ toYaml .Values.extraVolumes | indent 6 }} | ||
| {{- end }} | ||
| {{- if .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{ toYaml .Values.imagePullSecrets | indent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.extraInitContainers }} | ||
| initContainers: | ||
| # All the other beats accept a string here while | ||
| # filebeat accepts a valid yaml array. We're keeping | ||
| # this as a backwards compatible change, while adding | ||
| # also a way to pass a string as other templates to | ||
| # make these implementations consistent. | ||
| # https://github.com/elastic/helm-charts/issues/490 | ||
| {{- if eq "string" (printf "%T" .Values.extraInitContainers) }} | ||
| {{ tpl .Values.extraInitContainers . | indent 8 }} | ||
| {{- else }} | ||
| {{ toYaml .Values.extraInitContainers | indent 8 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| containers: | ||
| - name: "filebeat" | ||
| image: "{{ .Values.image }}:{{ .Values.imageTag }}" | ||
| imagePullPolicy: "{{ .Values.imagePullPolicy }}" | ||
| args: | ||
| - "-e" | ||
| - "-E" | ||
| - "http.enabled=true" | ||
| livenessProbe: | ||
| {{ toYaml .Values.livenessProbe | indent 10 }} | ||
| readinessProbe: | ||
| {{ toYaml .Values.readinessProbe | indent 10 }} | ||
| resources: | ||
| {{ toYaml .Values.resources | indent 10 }} | ||
| env: | ||
| - name: POD_NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| - name: NODE_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: spec.nodeName | ||
| {{- if .Values.extraEnvs }} | ||
| {{ toYaml .Values.extraEnvs | indent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.envFrom }} | ||
| envFrom: | ||
| {{ toYaml .Values.envFrom | indent 10 }} | ||
| {{- end }} | ||
| {{- if .Values.podSecurityContext }} | ||
| securityContext: | ||
| {{ toYaml .Values.podSecurityContext | indent 10 }} | ||
| {{- end }} | ||
| volumeMounts: | ||
| {{- range .Values.secretMounts }} | ||
| - name: {{ .name }} | ||
| mountPath: {{ .path }} | ||
| {{- if .subPath }} | ||
| subPath: {{ .subPath }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- range $path, $config := .Values.filebeatConfig }} | ||
| - name: filebeat-config | ||
| mountPath: /usr/share/filebeat/{{ $path }} | ||
| readOnly: true | ||
| subPath: {{ $path }} | ||
| {{- end }} | ||
| - name: data | ||
| mountPath: /usr/share/filebeat/data | ||
| - name: varlibdockercontainers | ||
| mountPath: /var/lib/docker/containers | ||
| readOnly: true | ||
| - name: varlog | ||
| mountPath: /var/log | ||
| readOnly: true | ||
| # Necessary when using autodiscovery; avoid mounting it otherwise | ||
| # See: https://www.elastic.co/guide/en/beats/filebeat/master/configuration-autodiscover.html | ||
| - name: varrundockersock | ||
| mountPath: /var/run/docker.sock | ||
| readOnly: true | ||
| {{- if .Values.extraVolumeMounts }} | ||
| {{ toYaml .Values.extraVolumeMounts | indent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.extraContainers }} | ||
| {{ tpl .Values.extraContainers . | indent 6 }} | ||
| {{- end }} | ||
|
|
||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.