init commit

This commit is contained in:
2026-04-25 14:43:45 +00:00
commit 30af3165e4
26 changed files with 16629 additions and 0 deletions
@@ -0,0 +1,39 @@
---
"kind": "ServiceAccount"
"apiVersion": "v1"
"metadata":
"name": "promtail"
"namespace": "loki"
---
"kind": "ClusterRole"
"apiVersion": "rbac.authorization.k8s.io/v1"
"metadata":
"name": "promtail"
"rules":
-
"verbs":
- "get"
- "list"
- "watch"
"apiGroups":
- ""
"resources":
- "nodes"
- "nodes/proxy"
- "services"
- "endpoints"
- "pods"
---
"kind": "ClusterRoleBinding"
"apiVersion": "rbac.authorization.k8s.io/v1"
"metadata":
"name": "promtail"
"subjects":
-
"kind": "ServiceAccount"
"name": "promtail"
"namespace": "loki"
"roleRef":
"apiGroup": "rbac.authorization.k8s.io"
"kind": "ClusterRole"
"name": "promtail"
@@ -0,0 +1,50 @@
---
"kind": "ConfigMap"
"apiVersion": "v1"
"metadata":
"name": "promtail-config"
"namespace": "loki"
"data":
"promtail.yaml": |
server:
http_listen_port: 9080
grpc_listen_port: 0
clients:
- url: http://loki.loki.svc.cluster.local:3100/loki/api/v1/push
positions:
filename: /run/promtail/positions.yaml
scrape_configs:
- job_name: kubernetes-pods
pipeline_stages:
- cri: {}
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: replace
source_labels: [__meta_kubernetes_pod_node_name]
target_label: __host__
- action: replace
source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name]
regex: (.+)
target_label: app
- action: replace
source_labels: [__meta_kubernetes_pod_label_app]
regex: (.+)
target_label: app
- 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
- action: replace
source_labels: [__meta_kubernetes_pod_uid, __meta_kubernetes_pod_container_name]
separator: /
replacement: /var/log/pods/*$1/*.log
target_label: __path__
@@ -0,0 +1,84 @@
---
"kind": "DaemonSet"
"apiVersion": "apps/v1"
"metadata":
"name": "promtail"
"namespace": "loki"
"spec":
"selector":
"matchLabels":
"app": "promtail"
"template":
"metadata":
"labels":
"app": "promtail"
"spec":
"volumes":
-
"name": "config"
"configMap":
"name": "promtail-config"
"defaultMode": 420
-
"name": "run"
"hostPath":
"path": "/run/promtail"
"type": ""
-
"name": "pods"
"hostPath":
"path": "/var/log/pods"
"type": ""
"containers":
-
"name": "promtail"
"image": "grafana/promtail:3.4.2"
"args":
- "-config.file=/etc/promtail/promtail.yaml"
- "-config.expand-env=true"
"ports":
-
"name": "http-metrics"
"containerPort": 9080
"protocol": "TCP"
"env":
-
"name": "HOSTNAME"
"valueFrom":
"fieldRef":
"apiVersion": "v1"
"fieldPath": "spec.nodeName"
"resources": {}
"volumeMounts":
-
"name": "config"
"mountPath": "/etc/promtail"
-
"name": "run"
"mountPath": "/run/promtail"
-
"name": "pods"
"readOnly": true
"mountPath": "/var/log/pods"
"terminationMessagePath": "/dev/termination-log"
"terminationMessagePolicy": "File"
"imagePullPolicy": "IfNotPresent"
"securityContext":
"privileged": true
"runAsUser": 0
"restartPolicy": "Always"
"terminationGracePeriodSeconds": 30
"dnsPolicy": "ClusterFirst"
"serviceAccountName": "promtail"
"serviceAccount": "promtail"
"securityContext": {}
"schedulerName": "default-scheduler"
"tolerations":
-
"operator": "Exists"
"updateStrategy":
"type": "RollingUpdate"
"rollingUpdate":
"maxUnavailable": 1
"maxSurge": 0
"revisionHistoryLimit": 10