Skip to content

Commit

Permalink
feat(promtail): Make cluster role configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
slim-bean committed Aug 20, 2019
1 parent 777fcfc commit fdafa10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions production/ksonnet/promtail/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
docker: {},
}],
},
promtail_cluster_role_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 @@ -9,7 +9,7 @@ k + config + scrape_config {
local policyRule = $.rbac.v1beta1.policyRule,

promtail_rbac:
$.util.rbac('promtail', [
$.util.rbac($._config.promtail_cluster_role_name, [
policyRule.new() +
policyRule.withApiGroups(['']) +
policyRule.withResources(['nodes', 'nodes/proxy', 'services', 'endpoints', 'pods']) +
Expand Down Expand Up @@ -62,7 +62,7 @@ k + config + scrape_config {

promtail_daemonset:
daemonSet.new('promtail', [$.promtail_container]) +
daemonSet.mixin.spec.template.spec.withServiceAccount('promtail') +
daemonSet.mixin.spec.template.spec.withServiceAccount($._config.promtail_cluster_role_name) +
$.util.configVolumeMount('promtail', '/etc/promtail') +
$.util.hostVolumeMount('varlog', '/var/log', '/var/log') +
$.util.hostVolumeMount('varlibdockercontainers', $._config.promtail_config.container_root_path + '/containers', $._config.promtail_config.container_root_path + '/containers', readOnly=true),
Expand Down

0 comments on commit fdafa10

Please sign in to comment.