Skip to content

Commit

Permalink
make promtail daemonset name configurable
Browse files Browse the repository at this point in the history
also adding a regex test for something else I was working on
  • Loading branch information
slim-bean committed Sep 16, 2019
1 parent f918aa0 commit 04a615a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pkg/logentry/stages/regex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ func TestRegexParser_Parse(t *testing.T) {
"protocol": "unknown",
},
},
"case insensitive": {
map[string]interface{}{
"expression": "(?i)(?P<bad>panic:|core_dumped|failure|error|attack| bad |illegal |denied|refused|unauthorized|fatal|failed|Segmentation Fault|Corrupted)",
},
map[string]interface{}{},
"A Terrible Error has occurred!!!",
map[string]interface{}{
"bad": "Error",
},
},
"missing extracted[source]": {
map[string]interface{}{
"expression": "^HTTP\\/(?P<protocol_version>.*)$",
Expand Down
1 change: 1 addition & 0 deletions production/ksonnet/promtail/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
},
promtail_cluster_role_name: 'promtail',
promtail_configmap_name: 'promtail',
promtail_pod_name: 'promtail',
},
}
4 changes: 2 additions & 2 deletions production/ksonnet/promtail/promtail.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ k + config + scrape_config {
local configMap = $.core.v1.configMap,

promtail_config_map:
configMap.new('promtail') +
configMap.new($._config.promtail_configmap_name) +
configMap.withData({
'promtail.yml': $.util.manifestYaml($.promtail_config),
}),
Expand Down Expand Up @@ -61,7 +61,7 @@ k + config + scrape_config {
local daemonSet = $.extensions.v1beta1.daemonSet,

promtail_daemonset:
daemonSet.new('promtail', [$.promtail_container]) +
daemonSet.new($._config.promtail_pod_name, [$.promtail_container]) +
daemonSet.mixin.spec.template.spec.withServiceAccount($._config.promtail_cluster_role_name) +
$.util.configVolumeMount($._config.promtail_configmap_name, '/etc/promtail') +
$.util.hostVolumeMount('varlog', '/var/log', '/var/log') +
Expand Down

0 comments on commit 04a615a

Please sign in to comment.