Add fluentd.conf as a configmap (#792)
Logger's - FluentD config can be passed as a configmap so that user can customize the configuration to their needs
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
# Fluentd deployment for Fission
|
||||
#
|
||||
# Requires:
|
||||
# - service account: fission-svc
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-fission-fluentd
|
||||
data:
|
||||
{{ if .Files.Get "config/fluentd.conf" }}
|
||||
td-agent.conf: |
|
||||
{{ .Files.Get "config/fluentd.conf" | indent 3 }}
|
||||
{{ else }}
|
||||
{{ fail "invalid chart" }}
|
||||
{{ end }}
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: logger
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
svc: logger
|
||||
spec:
|
||||
containers:
|
||||
- name: fluentd
|
||||
image: "{{ .Values.repository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
env:
|
||||
- name: INFLUXDB_ADDRESS
|
||||
value: influxdb
|
||||
- name: INFLUXDB_PORT
|
||||
value: "8086"
|
||||
- name: INFLUXDB_DBNAME
|
||||
value: "fissionFunctionLog"
|
||||
- name: INFLUXDB_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: influxdb
|
||||
key: username
|
||||
- name: INFLUXDB_PASSWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: influxdb
|
||||
key: password
|
||||
- name: FLUENTD_PATH
|
||||
value: /var/log/containers/*{{.Values.functionNamespace}}*.log
|
||||
volumeMounts:
|
||||
- name: container-log
|
||||
mountPath: /var/log/
|
||||
readOnly: true
|
||||
- name: docker-log
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
- name: fission-log
|
||||
mountPath: /var/log/fission
|
||||
readOnly: false
|
||||
- name: fluentd-config
|
||||
mountPath: /etc/td-agent/
|
||||
readOnly: true
|
||||
serviceAccount: fission-svc
|
||||
volumes:
|
||||
- name: container-log
|
||||
hostPath:
|
||||
path: /var/log/
|
||||
- name: docker-log
|
||||
hostPath:
|
||||
path: /var/lib/docker/containers
|
||||
- name: fission-log
|
||||
hostPath:
|
||||
path: /var/log/fission
|
||||
# Fluentd config location: /etc/td-agent/td-agent.conf
|
||||
- name: fluentd-config
|
||||
configMap:
|
||||
name: {{ .Release.Name }}-fission-fluentd
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
Reference in New Issue
Block a user