promtail: generate configmap w/ kustomize
All checks were successful
/ diff-and-deploy (push) Successful in 2m10s
All checks were successful
/ diff-and-deploy (push) Successful in 2m10s
This commit is contained in:
parent
de71bb1041
commit
b595fa9e00
3 changed files with 51 additions and 56 deletions
|
@ -24,3 +24,6 @@ configMapGenerator:
|
||||||
- name: matrix-alertmanager-receiver
|
- name: matrix-alertmanager-receiver
|
||||||
files:
|
files:
|
||||||
- matrix-alertmanager-receiver/config.yaml
|
- matrix-alertmanager-receiver/config.yaml
|
||||||
|
- name: promtail-config
|
||||||
|
files:
|
||||||
|
- promtail/promtail.yaml
|
||||||
|
|
|
@ -51,62 +51,6 @@ spec:
|
||||||
- name: promtail-config
|
- name: promtail-config
|
||||||
configMap:
|
configMap:
|
||||||
name: promtail-config
|
name: promtail-config
|
||||||
--- # configmap.yaml
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: promtail-config
|
|
||||||
namespace: monitoring
|
|
||||||
data:
|
|
||||||
promtail.yaml: |
|
|
||||||
server:
|
|
||||||
http_listen_port: 9080
|
|
||||||
grpc_listen_port: 0
|
|
||||||
|
|
||||||
clients:
|
|
||||||
- url: http://monitoring-0:3100/loki/api/v1/push
|
|
||||||
|
|
||||||
positions:
|
|
||||||
filename: /tmp/positions.yaml
|
|
||||||
target_config:
|
|
||||||
sync_period: 10s
|
|
||||||
scrape_configs:
|
|
||||||
- job_name: pod-logs
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: pod
|
|
||||||
pipeline_stages:
|
|
||||||
- docker: {}
|
|
||||||
relabel_configs:
|
|
||||||
- source_labels:
|
|
||||||
- __meta_kubernetes_pod_node_name
|
|
||||||
target_label: __host__
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_pod_label_(.+)
|
|
||||||
- action: replace
|
|
||||||
replacement: $1
|
|
||||||
separator: /
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_namespace
|
|
||||||
- __meta_kubernetes_pod_name
|
|
||||||
target_label: job
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_namespace
|
|
||||||
target_label: namespace
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_pod_name
|
|
||||||
target_label: pod
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_pod_container_name
|
|
||||||
target_label: container
|
|
||||||
- replacement: /var/log/pods/*$1/*.log
|
|
||||||
separator: /
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_pod_uid
|
|
||||||
- __meta_kubernetes_pod_container_name
|
|
||||||
target_label: __path__
|
|
||||||
|
|
||||||
--- # Clusterrole.yaml
|
--- # Clusterrole.yaml
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
|
48
k8s/monitoring/promtail/promtail.yaml
Normal file
48
k8s/monitoring/promtail/promtail.yaml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
server:
|
||||||
|
http_listen_port: 9080
|
||||||
|
grpc_listen_port: 0
|
||||||
|
|
||||||
|
clients:
|
||||||
|
- url: http://monitoring-0:3100/loki/api/v1/push
|
||||||
|
|
||||||
|
positions:
|
||||||
|
filename: /tmp/positions.yaml
|
||||||
|
target_config:
|
||||||
|
sync_period: 10s
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: pod-logs
|
||||||
|
kubernetes_sd_configs:
|
||||||
|
- role: pod
|
||||||
|
pipeline_stages:
|
||||||
|
- docker: {}
|
||||||
|
relabel_configs:
|
||||||
|
- source_labels:
|
||||||
|
- __meta_kubernetes_pod_node_name
|
||||||
|
target_label: __host__
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_pod_label_(.+)
|
||||||
|
- action: replace
|
||||||
|
replacement: $1
|
||||||
|
separator: /
|
||||||
|
source_labels:
|
||||||
|
- __meta_kubernetes_namespace
|
||||||
|
- __meta_kubernetes_pod_name
|
||||||
|
target_label: job
|
||||||
|
- action: replace
|
||||||
|
source_labels:
|
||||||
|
- __meta_kubernetes_namespace
|
||||||
|
target_label: namespace
|
||||||
|
- action: replace
|
||||||
|
source_labels:
|
||||||
|
- __meta_kubernetes_pod_name
|
||||||
|
target_label: pod
|
||||||
|
- action: replace
|
||||||
|
source_labels:
|
||||||
|
- __meta_kubernetes_pod_container_name
|
||||||
|
target_label: container
|
||||||
|
- replacement: /var/log/pods/*$1/*.log
|
||||||
|
separator: /
|
||||||
|
source_labels:
|
||||||
|
- __meta_kubernetes_pod_uid
|
||||||
|
- __meta_kubernetes_pod_container_name
|
||||||
|
target_label: __path__
|
Loading…
Reference in a new issue