-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.libsonnet
78 lines (62 loc) · 2.74 KB
/
config.libsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
local annotation = g.dashboard.annotation;
{
_config+:: {
local this = self,
// Bypasses grafana.com/dashboards validator
bypassDashboardValidation: {
__inputs: [],
__requires: [],
},
// Default datasource name
datasourceName: 'default',
// Opt-in to multiCluster dashboards by overriding this and the clusterLabel.
showMultiCluster: false,
clusterLabel: 'cluster',
kubeStateMetricsSelector: 'job=~"kube-state-metrics"',
grafanaUrl: 'https://grafana.com',
pdbDashboardUid: 'kubernetes-autoscaling-mixin-pdb-jkwq',
hpaDashboardUid: 'kubernetes-autoscaling-mixin-hpa-jkwq',
vpaDashboardUid: 'kubernetes-autoscaling-mixin-vpa-jkwq',
clusterAutoscalerDashboardUid: 'kubernetes-autoscaling-mixin-ca-jkwq',
karpenterOverviewDashboardUid: 'kubernetes-autoscaling-mixin-kover-jkwq',
karpenterActivityDashboardUid: 'kubernetes-autoscaling-mixin-kact-jkwq',
karpenterPerformanceDashboardUid: 'kubernetes-autoscaling-mixin-kperf-jkwq',
vpa: {
enabled: true,
},
clusterAutoscaler: {
enabled: true,
clusterAutoscalerSelector: 'job=~"cluster-autoscaler"',
nodeCountCapacityThreshold: 75,
clusterAutoscalerDashboardUrl: '%s/d/%s/kubernetes-autoscaling-cluster-autoscaler' % [this.grafanaUrl, this.clusterAutoscalerDashboardUid],
},
karpenter: {
enabled: true,
karpenterSelector: 'job=~"karpenter"',
nodepoolCapacityThreshold: 75,
nodeclaimTerminationThreshold: 60 * 20,
karpenterOverviewDashboardUrl: '%s/d/%s/kubernetes-autoscaling-karpenter-overview' % [this.grafanaUrl, this.karpenterOverviewDashboardUid],
karpenterActivityDashboardUrl: '%s/d/%s/kubernetes-autoscaling-karpenter-activity' % [this.grafanaUrl, this.karpenterActivityDashboardUid],
karpenterPerformanceDashboardUrl: '%s/d/%s/kubernetes-autoscaling-karpenter-performance' % [this.grafanaUrl, this.karpenterPerformanceDashboardUid],
},
tags: ['kubernetes', 'autoscaling', 'kubernetes-autoscaling-mixin'],
// Custom annotations to display in graphs
annotation: {
enabled: false,
name: 'Custom Annotation',
datasource: '-- Grafana --',
iconColor: 'green',
tags: [],
},
customAnnotation:: if $._config.annotation.enabled then
annotation.withName($._config.annotation.name) +
annotation.withIconColor($._config.annotation.iconColor) +
annotation.withHide(false) +
annotation.datasource.withUid($._config.annotation.datasource) +
annotation.target.withMatchAny(true) +
annotation.target.withTags($._config.annotation.tags) +
annotation.target.withType('tags')
else {},
},
}