152 lines
5.1 KiB
YAML
152 lines
5.1 KiB
YAML
{{- $statefulSet := or (.Values.autoscaling.enabled) (.Values.useStatefulSet) -}}
|
|
apiVersion: apps/v1
|
|
{{- if $statefulSet }}
|
|
kind: StatefulSet
|
|
{{- else}}
|
|
kind: Deployment
|
|
{{- end}}
|
|
metadata:
|
|
name: {{ template "fluentd.fullname" . }}
|
|
labels:
|
|
app: {{ template "fluentd.name" . }}
|
|
chart: {{ template "fluentd.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
{{- if .Values.autoscaling.enabled }}
|
|
serviceName: {{ template "fluentd.name" . }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ template "fluentd.name" . }}
|
|
release: {{ .Release.Name }}
|
|
{{- if and .Values.persistence.enabled (not .Values.autoscaling.enabled) }}
|
|
strategy:
|
|
type: Recreate
|
|
{{- end }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ template "fluentd.name" . }}
|
|
release: {{ .Release.Name }}
|
|
{{- with .Values.deployment.labels }}
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
annotations:
|
|
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
{{- if .Values.annotations }}
|
|
{{- toYaml .Values.annotations | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.image.pullSecrets }}
|
|
imagePullSecrets:
|
|
{{- range $pullSecret := .Values.image.pullSecrets }}
|
|
- name: {{ $pullSecret }}
|
|
{{- end }}
|
|
{{- end }}
|
|
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- if and (.Values.plugins.enabled) (gt (len .Values.plugins.pluginsList) 0) }}
|
|
command: ["/bin/sh", "-c", "/etc/fluent/config.d/install-plugins.sh"]
|
|
{{- end }}
|
|
env:
|
|
- name: OUTPUT_HOST
|
|
value: {{ .Values.output.host | quote }}
|
|
- name: OUTPUT_PORT
|
|
value: {{ .Values.output.port | quote }}
|
|
- name: OUTPUT_SCHEME
|
|
value: {{ .Values.output.scheme | quote }}
|
|
- name: OUTPUT_SSL_VERSION
|
|
value: {{ .Values.output.sslVersion | quote }}
|
|
- name: OUTPUT_BUFFER_CHUNK_LIMIT
|
|
value: {{ .Values.output.buffer_chunk_limit | quote }}
|
|
- name: OUTPUT_BUFFER_QUEUE_LIMIT
|
|
value: {{ .Values.output.buffer_queue_limit | quote }}
|
|
{{- range $key, $value := .Values.env }}
|
|
- name: {{ $key | quote }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- if .Values.extraEnvVars }}
|
|
{{ toYaml .Values.extraEnvVars | indent 10 }}
|
|
{{- end }}
|
|
resources:
|
|
{{ toYaml .Values.resources | indent 12 }}
|
|
ports:
|
|
{{- range $port := .Values.service.ports }}
|
|
- name: {{ $port.name }}
|
|
containerPort: {{ $port.containerPort }}
|
|
protocol: {{ $port.protocol }}
|
|
{{- end }}
|
|
{{- if .Values.metrics.enabled }}
|
|
- name: metrics
|
|
containerPort: {{ .Values.metrics.service.port }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
- name: http-input
|
|
containerPort: 9880
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
# Use percent encoding for query param.
|
|
# The value is {"log": "health check"}.
|
|
# the endpoint itself results in a new fluentd
|
|
# tag 'fluentd.pod-healthcheck'
|
|
path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D
|
|
port: 9880
|
|
initialDelaySeconds: 5
|
|
timeoutSeconds: 1
|
|
volumeMounts:
|
|
- name: config-volume-{{ template "fluentd.fullname" . }}
|
|
mountPath: /etc/fluent/config.d
|
|
- name: buffer
|
|
mountPath: "/var/log/fluentd-buffers"
|
|
{{- if .Values.extraVolumeMounts }}
|
|
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ template "fluentd.fullname" . }}
|
|
volumes:
|
|
- name: config-volume-{{ template "fluentd.fullname" . }}
|
|
configMap:
|
|
name: {{ template "fluentd.fullname" . }}
|
|
defaultMode: 0777
|
|
{{- if and .Values.persistence.enabled (not $statefulSet) }}
|
|
- name: buffer
|
|
persistentVolumeClaim:
|
|
claimName: {{ template "fluentd.fullname" . }}
|
|
{{- else if (not .Values.persistence.enabled) }}
|
|
- name: buffer
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- if .Values.extraVolumes }}
|
|
{{ toYaml .Values.extraVolumes | indent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
{{- if and .Values.persistence.enabled ($statefulSet) }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: buffer
|
|
spec:
|
|
accessModes: [{{ .Values.persistence.accessMode }}]
|
|
storageClassName: {{ .Values.persistence.storageClass }}
|
|
resources:
|
|
requests:
|
|
storage: {{ .Values.persistence.size }}
|
|
{{- end }}
|