Remove ksonnet from prometheus-pvc.jsonnet

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
This commit is contained in:
Kemal Akkoyun
2020-11-06 14:14:59 +01:00
parent 6d641706de
commit c236fec779
2 changed files with 20 additions and 41 deletions

View File

@@ -1,7 +1,3 @@
local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
local statefulSet = k.apps.v1beta2.statefulSet;
local toleration = statefulSet.mixin.spec.template.spec.tolerationsType;
{
_config+:: {
tolerations+:: [
@@ -15,24 +11,14 @@ local toleration = statefulSet.mixin.spec.template.spec.tolerationsType;
key: 'key2',
operator: 'Exists',
},
]
},
local withTolerations() = {
tolerations: [
toleration.new() + (
if std.objectHas(t, 'key') then toleration.withKey(t.key) else toleration) + (
if std.objectHas(t, 'operator') then toleration.withOperator(t.operator) else toleration) + (
if std.objectHas(t, 'value') then toleration.withValue(t.value) else toleration) + (
if std.objectHas(t, 'effect') then toleration.withEffect(t.effect) else toleration),
for t in $._config.tolerations
],
},
prometheus+: {
prometheus+: {
spec+:
withTolerations(),
spec+: {
tolerations: [t for t in $._config.tolerations],
},
},
},
}
}