Hello All,
i am trying to log all the kubernetes events like pod restarts are etc which is basically
kubectl get events
from all the namsespaces…
Can someone guide how to proceed further… i am experimenting with helm chat of grafana-loki and tried these scrape configs. but still i could see the {job: kubernetes_events}
- job_name: kubernetes-events
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: replace
source_labels:
- __meta_kubernetes_node_name
target_label: node_name
- action: replace
source_labels:
- __address__
target_label: __address__
regex: (.+):(.+)
replacement: ${1}:10250
scrape_configs:
- job_name: kubernetes-events
kubernetes_sd_configs:
- role: node
metrics_path: /api/v1/events
params:
fieldSelector: [involvedObject.namespace!=""]
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true