Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions memcached/memcached.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,20 @@ k {
'--web.listen-address=0.0.0.0:9150',
]),

local deployment = $.apps.v1beta1.deployment,
local statefulSet = $.apps.v1beta1.statefulSet,

deployment:
deployment.new(self.name, $._config.memcached_replicas, [
statefulSet:
statefulSet.new(self.name, $._config.memcached_replicas, [
self.memcached_container,
self.memcached_exporter,
]) +
], []) +
statefulSet.mixin.spec.withServiceName(self.name) +
$.util.antiAffinity,

local service = $.core.v1.service,

service:
$.util.serviceFor(self.deployment) +
$.util.serviceFor(self.statefulSet) +
service.mixin.spec.withClusterIp('None'),
},
}
2 changes: 1 addition & 1 deletion prometheus-ksonnet/lib/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
alertmanagerSelector: 'job="default/alertmanager"',

// Node mixin overrides.
nodeCriticalSeverity: 'warning', // Do not page if nodes run out of disk space.
nodeCriticalSeverity: 'warning', // Do not page if nodes run out of disk space.

// oauth2-proxy
oauth_enabled: false,
Expand Down
19 changes: 10 additions & 9 deletions prometheus-ksonnet/lib/grafana.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@

dashboards_config_maps: {
['dashboard-%d' % shard]:
configMap.new('dashboards-%d' % shard) +
configMap.withDataMixin({
[name]: std.toString($.grafanaDashboards[name])
for name in std.objectFields($.grafanaDashboards)
if std.codepoint(std.md5(name)[1]) % $._config.dashboard_config_maps == shard
}),
for shard in std.range(0, $._config.dashboard_config_maps-1)
configMap.new('dashboards-%d' % shard) +
configMap.withDataMixin({
[name]: std.toString($.grafanaDashboards[name])
for name in std.objectFields($.grafanaDashboards)
if std.codepoint(std.md5(name)[1]) % $._config.dashboard_config_maps == shard
})
for shard in std.range(0, $._config.dashboard_config_maps - 1)
},

grafana_dashboard_provisioning_config_map:
Expand Down Expand Up @@ -183,9 +183,10 @@
function(m, acc) m + acc,
[
$.util.configVolumeMount('dashboards-%d' % shard, '/grafana/dashboards/%d' % shard)
for shard in std.range(0, $._config.dashboard_config_maps-1)
for shard in std.range(0, $._config.dashboard_config_maps - 1)
],
{})
{}
)
) +
$.util.podPriority('critical'),

Expand Down
2 changes: 1 addition & 1 deletion prometheus-ksonnet/lib/prometheus.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@
}) +
statefulset.mixin.spec.template.spec.securityContext.withRunAsUser(0) +
statefulset.mixin.spec.template.spec.withServiceAccount(self.name) +
$.util.podPriority('critical')
$.util.podPriority('critical'),
},
}