Merge pull request #760 from kakkoyun/ksonnet_no_more_3
Remove ksonnet from jsonnet/kube-prometheus
This commit is contained in:
@@ -1,20 +1,11 @@
|
|||||||
local k = import 'github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k.libsonnet';
|
|
||||||
|
|
||||||
{
|
{
|
||||||
prometheus+:: {
|
prometheus+:: {
|
||||||
clusterRole+: {
|
clusterRole+: {
|
||||||
rules+:
|
rules+: [{
|
||||||
local role = k.rbac.v1.role;
|
apiGroups: [''],
|
||||||
local policyRule = role.rulesType;
|
resources: ['services', 'endpoints', 'pods'],
|
||||||
local rule = policyRule.new() +
|
verbs: ['get', 'list', 'watch'],
|
||||||
policyRule.withApiGroups(['']) +
|
}],
|
||||||
policyRule.withResources([
|
},
|
||||||
'services',
|
},
|
||||||
'endpoints',
|
|
||||||
'pods',
|
|
||||||
]) +
|
|
||||||
policyRule.withVerbs(['get', 'list', 'watch']);
|
|
||||||
[rule]
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,22 @@
|
|||||||
local k = import 'github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k.libsonnet';
|
|
||||||
local statefulSet = k.apps.v1.statefulSet;
|
|
||||||
local affinity = statefulSet.mixin.spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecutionType;
|
|
||||||
local matchExpression = affinity.mixin.podAffinityTerm.labelSelector.matchExpressionsType;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
local antiaffinity(key, values, namespace) = {
|
local antiaffinity(key, values, namespace) = {
|
||||||
affinity: {
|
affinity: {
|
||||||
podAntiAffinity: {
|
podAntiAffinity: {
|
||||||
preferredDuringSchedulingIgnoredDuringExecution: [
|
preferredDuringSchedulingIgnoredDuringExecution: [
|
||||||
affinity.new() +
|
{
|
||||||
affinity.withWeight(100) +
|
podAffinityTerm: {
|
||||||
affinity.mixin.podAffinityTerm.withNamespaces(namespace) +
|
namespaces: [namespace],
|
||||||
affinity.mixin.podAffinityTerm.withTopologyKey('kubernetes.io/hostname') +
|
topologyKey: 'kubernetes.io/hostname',
|
||||||
affinity.mixin.podAffinityTerm.labelSelector.withMatchExpressions([
|
labelSelector: {
|
||||||
matchExpression.new() +
|
matchExpressions: [{
|
||||||
matchExpression.withKey(key) +
|
key: key,
|
||||||
matchExpression.withOperator('In') +
|
operator: 'In',
|
||||||
matchExpression.withValues(values),
|
values: values,
|
||||||
]),
|
}],
|
||||||
|
},
|
||||||
|
weight: 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user