2021-05-17 22:30:18 +00:00
{{- $containers := printf "%s/containers/" (default "/var/lib/docker" .Values.global.dockerRootDirectory) }}
apiVersion : logging.banzaicloud.io/v1beta1
kind : Logging
metadata :
name : {{ .Release.Name }}
namespace : {{ .Release.Namespace }}
labels :
{{ include "logging-operator.labels" . | indent 4 }}
spec :
controlNamespace : {{ .Release.Namespace }}
{{- if (include "windowsEnabled" .) }}
nodeAgents :
- name : win-agent
profile : windows
nodeAgentFluentbit :
daemonSet :
spec :
template :
spec :
containers :
- image : "{{ template " system_default_registry" . }}{{ .Values.images.nodeagent_fluentbit.repository }}:{{ .Values.images.nodeagent_fluentbit.tag }}"
name : fluent-bit
tls :
enabled : {{ .Values.nodeAgents.tls.enabled | default false }}
{{- if .Values.additionalLoggingSources.rke.enabled }}
- name : win-agent-rke
profile : windows
nodeAgentFluentbit :
filterKubernetes :
2021-05-28 18:23:41 +00:00
Kube_Tag_Prefix : "{{ template " windowsKubernetesFilter" . }}.var.lib.rancher.rke.log."
2021-05-17 22:30:18 +00:00
inputTail :
2021-05-17 22:34:49 +00:00
Path : "{{ template " windowsPathPrefix" . }}/var/lib/rancher/rke/log"
{{- if .Values.fluentbit.inputTail.Buffer_Chunk_Size }}
2021-06-09 16:30:49 +00:00
Buffer_Chunk_Size : {{ .Values.fluentbit.inputTail.Buffer_Chunk_Size | toString }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Buffer_Max_Size }}
2021-06-09 16:30:49 +00:00
Buffer_Max_Size : {{ .Values.fluentbit.inputTail.Buffer_Max_Size | toString }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Mem_Buf_Limit }}
2021-06-09 16:30:49 +00:00
Mem_Buf_Limit : {{ .Values.fluentbit.inputTail.Mem_Buf_Limit | toString }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Multiline_Flush }}
2021-06-09 21:38:21 +00:00
Multiline_Flush : {{ .Values.fluentbit.inputTail.Multiline_Flush | toString | quote }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Skip_Long_Lines }}
2021-06-09 21:38:21 +00:00
Skip_Long_Lines : {{ .Values.fluentbit.inputTail.Skip_Long_Lines | toString | quote }}
2021-05-17 22:34:49 +00:00
{{- end }}
2021-05-17 22:30:18 +00:00
extraVolumeMounts :
2021-05-28 18:23:41 +00:00
- source : "{{ template " windowsInputTailMount" . }}/var/lib/rancher/rke/log"
destination : "{{ template " windowsInputTailMount" . }}/var/lib/rancher/rke/log"
2021-05-17 22:30:18 +00:00
readOnly : true
daemonSet :
spec :
template :
spec :
containers :
- image : "{{ template " system_default_registry" . }}{{ .Values.images.nodeagent_fluentbit.repository }}:{{ .Values.images.nodeagent_fluentbit.tag }}"
name : fluent-bit
tls :
enabled : {{ .Values.nodeAgents.tls.enabled | default false }}
{{- end }}
{{- end }}
fluentbit :
image :
repository : {{ template "system_default_registry" . }}{{ .Values.images.fluentbit.repository }}
tag : {{ .Values.images.fluentbit.tag }}
2021-05-17 22:34:49 +00:00
{{- if or .Values.fluentbit.inputTail.Buffer_Chunk_Size .Values.fluentbit.inputTail.Buffer_Max_Size .Values.fluentbit.inputTail.Mem_Buf_Limit .Values.fluentbit.inputTail.Multiline_Flush .Values.fluentbit.inputTail.Skip_Long_Lines }}
inputTail :
{{- if .Values.fluentbit.inputTail.Buffer_Chunk_Size }}
2021-06-09 16:30:49 +00:00
Buffer_Chunk_Size : {{ .Values.fluentbit.inputTail.Buffer_Chunk_Size | toString }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Buffer_Max_Size }}
2021-06-09 16:30:49 +00:00
Buffer_Max_Size : {{ .Values.fluentbit.inputTail.Buffer_Max_Size | toString }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Mem_Buf_Limit }}
2021-06-09 16:30:49 +00:00
Mem_Buf_Limit : {{ .Values.fluentbit.inputTail.Mem_Buf_Limit | toString }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Multiline_Flush }}
2021-06-09 21:38:21 +00:00
Multiline_Flush : {{ .Values.fluentbit.inputTail.Multiline_Flush | toString | quote }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- if .Values.fluentbit.inputTail.Skip_Long_Lines }}
2021-06-09 21:38:21 +00:00
Skip_Long_Lines : {{ .Values.fluentbit.inputTail.Skip_Long_Lines | toString | quote }}
2021-05-17 22:34:49 +00:00
{{- end }}
{{- end }}
{{- if not .Values.disablePvc }}
{{- with .Values.fluentbit.bufferStorage }}
bufferStorage : {{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.fluentbit.bufferStorageVolume }}
bufferStorageVolume : {{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
2021-05-17 22:30:18 +00:00
{{- if or .Values.global.psp.enabled .Values.global.seLinux.enabled }}
security :
{{- end }}
{{- if .Values.global.psp.enabled }}
podSecurityPolicyCreate : true
roleBasedAccessControlCreate : true
{{- end }}
{{- if .Values.global.seLinux.enabled }}
securityContext :
seLinuxOptions :
type : rke_logreader_t
{{- end }}
2021-05-17 22:34:49 +00:00
{{- if .Values.global.dockerRootDirectory }}
2021-05-17 22:30:18 +00:00
mountPath : {{ $containers }}
extraVolumeMounts :
- source : {{ $containers }}
destination : {{ $containers }}
readOnly : true
2021-05-17 22:34:49 +00:00
{{- end }}
{{- with (concat (.Values.tolerations) (.Values.fluentbit.tolerations)) }}
tolerations : {{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector : {{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.fluentbit.resources }}
resources : {{- toYaml . | nindent 6 }}
{{- end }}
2021-05-17 22:30:18 +00:00
fluentd :
image :
repository : {{ template "system_default_registry" . }}{{ .Values.images.fluentd.repository }}
tag : {{ .Values.images.fluentd.tag }}
configReloaderImage :
repository : {{ template "system_default_registry" . }}{{ .Values.images.config_reloader.repository }}
tag : {{ .Values.images.config_reloader.tag }}
2021-05-17 22:34:49 +00:00
{{- if not .Values.disablePvc }}
{{- with .Values.fluentd.bufferStorageVolume }}
bufferStorageVolume : {{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
2021-05-17 22:30:18 +00:00
disablePvc : {{ .Values.disablePvc }}
2021-05-17 22:34:49 +00:00
{{- if .Values.fluentd.replicas }}
scaling :
replicas : {{ .Values.fluentd.replicas }}
{{- end }}
2021-05-17 22:30:18 +00:00
{{- if .Values.global.psp.enabled }}
security :
podSecurityPolicyCreate : true
roleBasedAccessControlCreate : true
{{- end }}
2021-05-17 22:34:49 +00:00
{{- with (default .Values.tolerations .Values.fluentd.tolerations) }}
tolerations : {{- toYaml . | nindent 6 }}
2021-05-17 22:30:18 +00:00
{{- end }}
2021-05-17 22:34:49 +00:00
{{- with (default .Values.nodeSelector .Values.fluentd.nodeSelector) }}
nodeSelector : {{- toYaml . | nindent 6 }}
2021-05-17 22:30:18 +00:00
{{- end }}
{{- with .Values.fluentd.resources }}
2021-05-17 22:34:49 +00:00
resources : {{- toYaml . | nindent 6 }}
2021-05-17 22:30:18 +00:00
{{- end }}
{{- with .Values.fluentd.livenessProbe }}
livenessProbe : {{- toYaml . | nindent 6 }}
{{- end }}