Skip to content
Closed
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JSONNET_FMT := jsonnet fmt -n 2 --max-blank-lines 2 --string-style s --comment-style s
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s

fmt:
find . -name '*.libsonnet' -o -name '*.jsonnet' | \
Expand Down
8 changes: 4 additions & 4 deletions ksonnet-util/kausal.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ k {
local appsExtentions = {
daemonSet+: {
new(name, containers)::
local labels = {name: name};
local labels = { name: name };

super.new() +
super.mixin.metadata.withName(name) +
Expand Down Expand Up @@ -207,18 +207,18 @@ k {
],

// serviceFor create service for a given deployment.
serviceFor(deployment, ignored_labels=[], nameFormat="%(container)s-%(port)s")::
serviceFor(deployment, ignored_labels=[], nameFormat='%(container)s-%(port)s')::
local container = $.core.v1.container;
local service = $.core.v1.service;
local servicePort = service.mixin.spec.portsType;
local ports = [
servicePort.newNamed(
name=(nameFormat % {container: c.name, port: port.name}),
name=(nameFormat % { container: c.name, port: port.name }),
port=port.containerPort,
targetPort=port.containerPort
) +
if std.objectHas(port, 'protocol')
then servicePort.withProtocol(port.protocol)
then servicePort.withProtocol(port.protocol)
else {}
for c in deployment.spec.template.spec.containers
for port in (c + container.withPortsMixin([])).ports
Expand Down
2 changes: 1 addition & 1 deletion prometheus-ksonnet/lib/alertmanager.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
]
else if isGossiping then
[
'alertmanager-%d.alertmanager.%s.svc.%s.%s:%s' % [i, $._config.namespace, $._config.cluster_name , $._config.cluster_dns_tld, $._config.alertmanager_gossip_port]
'alertmanager-%d.alertmanager.%s.svc.%s.%s:%s' % [i, $._config.namespace, $._config.cluster_name, $._config.cluster_dns_tld, $._config.alertmanager_gossip_port]
for i in std.range(0, replicas - 1)
]
else [],
Expand Down
8 changes: 4 additions & 4 deletions prometheus-ksonnet/lib/prometheus-config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
regex: $._config.namespace,
action: 'keep',
}, {
// This prevents port-less containers and the gossip ports from showing up.
// This prevents port-less containers and the gossip ports from showing up.
source_labels: ['__meta_kubernetes_pod_container_port_number'],
regex: $._config.alertmanager_port,
action: 'keep',
}],
},
] + if $._config.alertmanager_cluster_self.global then [{
// For non-local instances, use static DNS entries.
// Sadly, the K8s-provided DNS-SRV records only point to the service IP,
// but we need to send alerts to every Alertmanager instance individually.
// Sadly, the K8s-provided DNS-SRV records only point to the service IP,
// but we need to send alerts to every Alertmanager instance individually.
api_version: 'v2',
path_prefix: $._config.alertmanager_path,
static_configs: [{ targets: [
'alertmanager-%d.alertmanager.%s.svc.%s.%s:%s' % [i, $._config.namespace, cluster, $._config.cluster_dns_tld, $._config.alertmanager_port]
for cluster in std.objectFields($._config.alertmanager_clusters)
if $._config.cluster_name != cluster && $._config.alertmanager_clusters[cluster].global && $._config.alertmanager_clusters[cluster].replicas > 1
for i in std.range(0, $._config.alertmanager_clusters[cluster].replicas - 1)
for i in std.range(0, $._config.alertmanager_clusters[cluster].replicas - 1)
] }],
}]
else [],
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 @@ -99,5 +99,5 @@
$.util.serviceFor(self.prometheus_statefulset),
},

main_prometheus: $.prometheus {name: "prometheus"},
main_prometheus: $.prometheus { name: 'prometheus' },
}