From dff7885de1f47c402442e84cbbaed3729543e4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E5=AE=9D=E7=9F=B3=E7=9A=84=E5=82=BB=E8=AF=9D?= Date: Thu, 12 Oct 2023 23:01:50 +0800 Subject: [PATCH] examples generated from libsonnet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蓝宝石的傻话 --- .../deployment-no-node-pods.yaml | 2 +- .../kube-state-metrics.libsonnet | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/examples/daemonsetsharding/deployment-no-node-pods.yaml b/examples/daemonsetsharding/deployment-no-node-pods.yaml index b22d105758..518f4579d6 100644 --- a/examples/daemonsetsharding/deployment-no-node-pods.yaml +++ b/examples/daemonsetsharding/deployment-no-node-pods.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: exporter app.kubernetes.io/name: kube-state-metrics app.kubernetes.io/version: 2.10.0 - name: kube-state-metrics-pods + name: kube-state-metrics namespace: kube-system spec: replicas: 1 diff --git a/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet b/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet index 4ac16fbbc3..4674860bfb 100644 --- a/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet +++ b/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet @@ -373,6 +373,26 @@ }, ), + deploymentNoNodePods: + local c = ksm.deployment.spec.template.spec.containers[0] { + args: [ + '--resources=pods', + '--node=""', + ], + }; + local shardksmname = ksm.name + "-pods"; + std.mergePatch(ksm.deployment, + { + spec: { + template: { + spec: { + containers: [c], + }, + }, + }, + }, + ), + daemonset: // extending the default container from above local c0 = ksm.deployment.spec.template.spec.containers[0] {