Skip to content

Commit dfb58eb

Browse files
committed
FluentD Sidecar Config in Helm Chart
1 parent 1aacff1 commit dfb58eb

File tree

11 files changed

+78
-231
lines changed

11 files changed

+78
-231
lines changed

charts/templates/configmap.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,60 @@ data:
1010
MARKLOGIC_FQDN_SUFFIX: {{ include "marklogic.headlessURL" . }}
1111
MARKLOGIC_INIT: "true"
1212
MARKLOGIC_JOIN_CLUSTER: "true"
13+
---
14+
apiVersion: v1
15+
kind: ConfigMap
16+
metadata:
17+
name: fluentd-config
18+
namespace: {{ .Release.Namespace }}
19+
labels:
20+
kubernetes.io/cluster-service: "true"
21+
data:
22+
fluent.conf: |
23+
<match fluent.**>
24+
@type null
25+
</match>
26+
27+
<source>
28+
@type tail
29+
@id tail_marklogic_logs
30+
format none
31+
path /var/opt/MarkLogic/Logs/*
32+
pos_file /tmp/log/ml-logs.log.pos
33+
path_key log_file
34+
tag marklogic.logs
35+
read_from_head true
36+
<parse>
37+
@type none
38+
time_key @timestamp
39+
time_format %Y-%m-%dT%H:%M:%S.%N%z
40+
keep_time_key true
41+
</parse>
42+
</source>
43+
44+
<filter marklogic.logs>
45+
@type record_transformer
46+
enable_ruby true
47+
<record>
48+
# overwrite full path to file name
49+
log_file ${File.basename(record["log_file"])}
50+
</record>
51+
</filter>
52+
53+
<match marklogic.logs>
54+
@type elasticsearch
55+
host elasticsearch.default.svc.cluster.local
56+
port 9200
57+
user admin
58+
password admin
59+
index_name fluentd.${tag}
60+
include_timestamp true
61+
utc_index false
62+
time_key_format "%Y-%m-%dT%H:%M:%S.%N%z"
63+
time_key time
64+
logstash_format true
65+
logstash_prefix marklogic.logs
66+
path_key out/${log_file}
67+
flush_interval 1s
68+
</match>
69+

charts/templates/statefulset.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,35 @@ spec:
9696
{{- with .Values.resources }}
9797
resources: {{- toYaml . | nindent 12 }}
9898
{{- end }}
99+
- name: fluentd
100+
env:
101+
- name: FLUENT_UID
102+
value: root
103+
- name: FLUENT_CONF
104+
value: fluent.conf
105+
- name: FLUENTD_ARGS
106+
value: -c /fluentd/etc/fluent.conf
107+
image: saravak/fluentd:elastic
108+
volumeMounts:
109+
- name: datadir
110+
mountPath: {{ .Values.persistence.mountPath }}
111+
{{- if .Values.extraVolumeMounts }}
112+
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
113+
{{- end }}
114+
- name: fdconf
115+
mountPath: /fluentd/etc/
99116
dnsConfig:
100117
searches:
101118
- {{ include "marklogic.headlessURL" . }}
102119
{{- if .Values.imagePullSecret }}
103120
imagePullSecrets:
104121
- name: {{ include "marklogic.fullname" . }}-registry
105122
{{- end }}
106-
{{- if or (not .Values.persistence.enabled) (.Values.extraVolumes) }}
107123
volumes:
124+
- name: fdconf
125+
configMap:
126+
name: fluentd-config
127+
{{- if or (not .Values.persistence.enabled) (.Values.extraVolumes) }}
108128
{{- if not .Values.persistence.enabled }}
109129
- name: datadir
110130
emptyDir: {}

elasticsearch-sts.yaml

Lines changed: 0 additions & 76 deletions
This file was deleted.

elasticsearch-svc.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

fd-ds.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

fd-rb.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

fd-role.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

fd-sa.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

kibana-config.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

logging-namespace.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)