Skip to content

Commit

Permalink
Support CRI 1.14+ directory change
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Sheehy <[email protected]>
  • Loading branch information
Steven Sheehy authored and Ed committed May 8, 2019
1 parent 54340e7 commit ceffcb7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 31 deletions.
17 changes: 0 additions & 17 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ This can have several reasons:
- Detect this by turning on debug logging and then look for `dropping target, no labels` or `ignoring target` messages.
- Promtail cannot find the location of your log files. Check that the scrape_configs contains valid path setting for finding the logs in your worker nodes.
- Your pods are running but not with the labels Promtail is expecting. Check the Promtail scape_configs.
- Kubernetes 1.14+ and GKE 1.12+: the default scape_configs need to be adapted to work.
From
```
- replacement: /var/log/pods/$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
- __meta_kubernetes_pod_container_name
target_label: __path__
```
to
```
- replacement: /var/log/pods/*$1*/*/*.log
source_labels:
- __meta_kubernetes_pod_uid
target_label: __path__
```

## Troubleshooting targets

Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: loki-stack
version: 0.8.0
version: 0.8.1
appVersion: 0.0.1
kubeVersion: "^1.10.0-0"
description: "Loki: like Prometheus, but for logs."
Expand Down
2 changes: 1 addition & 1 deletion production/helm/promtail/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: promtail
version: 0.7.0
version: 0.7.1
appVersion: 0.0.1
kubeVersion: "^1.10.0-0"
description: "Responsible for gathering logs and sending them to Loki"
Expand Down
11 changes: 5 additions & 6 deletions production/helm/promtail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ config:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -206,7 +206,7 @@ config:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -258,7 +258,7 @@ config:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -312,7 +312,7 @@ config:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -359,10 +359,9 @@ config:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_annotation_kubernetes_io_config_mirror
- __meta_kubernetes_pod_container_name
target_label: __path__

2 changes: 1 addition & 1 deletion production/ksonnet/promtail/scrape_config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ config + {
source_labels: [pod_uid, '__meta_kubernetes_pod_container_name'],
target_label: '__path__',
separator: '/',
replacement: '/var/log/pods/$1/*.log',
replacement: '/var/log/pods/*$1/*.log',
},
],
},
Expand Down
10 changes: 5 additions & 5 deletions tools/promtail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -99,7 +99,7 @@ data:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -151,7 +151,7 @@ data:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -205,7 +205,7 @@ data:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_uid
Expand Down Expand Up @@ -252,7 +252,7 @@ data:
target_label: container_name
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- replacement: /var/log/pods/$1/*.log
- replacement: /var/log/pods/*$1/*.log
separator: /
source_labels:
- __meta_kubernetes_pod_annotation_kubernetes_io_config_mirror
Expand Down

0 comments on commit ceffcb7

Please sign in to comment.