Merge pull request 'test' (#11) from test into dev
Reviewed-on: https://gitea.mgmt.nubes.ru/deck/svc-api/pulls/11
This commit is contained in:
@@ -1,144 +0,0 @@
|
||||
{{- if .Values.sidecars.logger.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "fluentbit-{{ .Chart.Name }}"
|
||||
data:
|
||||
fluent-bit.conf: |
|
||||
[SERVICE]
|
||||
Parsers_File /fluent-bit/etc/parsers.conf
|
||||
|
||||
[INPUT]
|
||||
Name tail
|
||||
Tag lk
|
||||
Path /usr/lib/serverHome/logs/access.txt*
|
||||
Mem_Buf_Limit 100MB
|
||||
Skip_Long_Lines On
|
||||
Refresh_Interval 5
|
||||
|
||||
[INPUT]
|
||||
Name tail
|
||||
Tag error_logs
|
||||
Path /usr/lib/serverHome/WEB-INF/lucee-server/context/logs/application.log
|
||||
Refresh_Interval 5
|
||||
Mem_Buf_Limit 100MB
|
||||
Skip_Long_Lines Off
|
||||
Read_from_Head On
|
||||
multiline.parser multiline-regex-lucee
|
||||
|
||||
[FILTER]
|
||||
Name parser
|
||||
Match error_logs
|
||||
Key_name log
|
||||
Parser lucee_errorlog_parser
|
||||
|
||||
[FILTER]
|
||||
Name record_modifier
|
||||
Match *
|
||||
Whitelist_key log
|
||||
|
||||
[FILTER]
|
||||
Name rewrite_tag
|
||||
Match {{ .Chart.Name }}
|
||||
Rule $log kube-probe {{ .Chart.Name }}-healtcheck false
|
||||
|
||||
[FILTER]
|
||||
Name rewrite_tag
|
||||
Match {{ .Chart.Name }}
|
||||
Rule $log {{ .Chart.Name }} {{ .Chart.Name }}.access false
|
||||
|
||||
[FILTER]
|
||||
Name parser
|
||||
Match {{ .Chart.Name }}.access
|
||||
Key_name log
|
||||
Parser lucee_parser
|
||||
|
||||
[OUTPUT]
|
||||
Name loki
|
||||
Match *
|
||||
Host 10.96.52.75
|
||||
labels job={{ .Chart.Name }}-fluentbit-{{ .Values.stand }}
|
||||
port 3100
|
||||
|
||||
[OUTPUT]
|
||||
Name stdout
|
||||
Match *
|
||||
|
||||
parsers.conf: |-
|
||||
[PARSER]
|
||||
Name lucee_parser
|
||||
Format regex
|
||||
Regex ^(?<remote_address>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$
|
||||
Types status:integer
|
||||
|
||||
[PARSER]
|
||||
Name apache
|
||||
Format regex
|
||||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$
|
||||
Time_Key time
|
||||
Time_Format %d/%b/%Y:%H:%M:%S %z
|
||||
|
||||
[PARSER]
|
||||
Name apache2
|
||||
Format regex
|
||||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$
|
||||
Time_Key time
|
||||
Time_Format %d/%b/%Y:%H:%M:%S %z
|
||||
|
||||
[PARSER]
|
||||
Name apache_error
|
||||
Format regex
|
||||
Regex ^\[[^ ]* (?<time>[^\]]*)\] \[(?<level>[^\]]*)\](?: \[pid (?<pid>[^\]]*)\])?( \[client (?<client>[^\]]*)\])? (?<message>.*)$
|
||||
|
||||
[PARSER]
|
||||
Name nginx
|
||||
Format regex
|
||||
Regex ^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$
|
||||
Time_Key time
|
||||
Time_Format %d/%b/%Y:%H:%M:%S %z
|
||||
|
||||
[PARSER]
|
||||
Name json
|
||||
Format json
|
||||
Time_Key time
|
||||
Time_Format %d/%b/%Y:%H:%M:%S %z
|
||||
|
||||
[PARSER]
|
||||
Name docker
|
||||
Format json
|
||||
Time_Key time
|
||||
Time_Format %Y-%m-%dT%H:%M:%S.%L
|
||||
Time_Keep On
|
||||
|
||||
[PARSER]
|
||||
# http://rubular.com/r/tjUt3Awgg4
|
||||
Name cri
|
||||
Format regex
|
||||
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<message>.*)$
|
||||
Time_Key time
|
||||
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
|
||||
|
||||
[PARSER]
|
||||
Name syslog
|
||||
Format regex
|
||||
Regex ^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$
|
||||
Time_Key time
|
||||
Time_Format %b %d %H:%M:%S
|
||||
|
||||
[PARSER]
|
||||
Name lucee_errorlog_parser
|
||||
Format regex
|
||||
Regex ^"(?<severity>ERROR)","(?<thread_id>[^"]*)","(?<date>[^"]*),(?<time>[^"]*)","(?<application>[^"]*)","(?<message>[^"]*)"
|
||||
Time_Key date
|
||||
Time_Format %d/%m/%Y
|
||||
|
||||
[MULTILINE_PARSER]
|
||||
name multiline-regex-lucee
|
||||
type regex
|
||||
flush_timeout 1000
|
||||
|
||||
rule "start_state" "/^\"ERROR\".*$/" "cont"
|
||||
rule "cont" "/^\s+.*$/" "cont"
|
||||
|
||||
{{- end }}
|
||||
@@ -49,26 +49,3 @@ spec:
|
||||
- secretRef:
|
||||
name: "{{ .Values.vault.target.name }}"
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- toYaml .Values.mainContainer.volumeMounts | nindent 12 }}
|
||||
|
||||
# Sidecar-контейнеры
|
||||
{{- if .Values.sidecars.logger.enabled }}
|
||||
- name: logger
|
||||
image: "{{ .Values.sidecars.logger.image.repository }}:{{ .Values.sidecars.logger.image.tag }}"
|
||||
imagePullPolicy: IfNotPresent
|
||||
resources:
|
||||
{{- toYaml .Values.sidecars.logger.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: fluentbit-config
|
||||
mountPath: /fluent-bit/etc/
|
||||
{{- toYaml .Values.sidecars.logger.volumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
|
||||
volumes:
|
||||
{{- if .Values.sidecars.logger.enabled }}
|
||||
- name: fluentbit-config
|
||||
configMap:
|
||||
name: fluentbit-{{ .Chart.Name }}
|
||||
{{- end }}
|
||||
{{- toYaml .Values.mainContainer.volumes | nindent 8 }}
|
||||
|
||||
@@ -28,42 +28,7 @@ mainContainer:
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: {{ appPort }}
|
||||
###### Подключение Volumes
|
||||
volumeMounts:
|
||||
- name: ingress-logs
|
||||
mountPath: /usr/lib/serverHome/logs/
|
||||
- name: application-logs
|
||||
mountPath: /usr/lib/serverHome/WEB-INF/lucee-server/context/logs/
|
||||
# Общий блок volumes для всех контейнеров
|
||||
volumes:
|
||||
- name: ingress-logs
|
||||
emptyDir: {}
|
||||
- name: application-logs
|
||||
emptyDir: {}
|
||||
|
||||
|
||||
sidecars:
|
||||
###### Репозиторий
|
||||
logger:
|
||||
enabled: true
|
||||
image:
|
||||
repository: drn.tst.nubes.ru/fluent-bit
|
||||
tag: 2.2.1
|
||||
###### Ресурсы
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
###### Подключение Volumes
|
||||
volumeMounts:
|
||||
- name: ingress-logs
|
||||
mountPath: /usr/lib/serverHome/logs/
|
||||
- name: application-logs
|
||||
mountPath: /usr/lib/serverHome/WEB-INF/lucee-server/context/logs/
|
||||
|
||||
# Для Vault есть условие
|
||||
# Предварительно в Namespace должен быть создан SecretStore
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user