diff --git a/jsonnet/kube-prometheus/kube-state-metrics/kube-state-metrics.libsonnet b/jsonnet/kube-prometheus/kube-state-metrics/kube-state-metrics.libsonnet index 8a9840afe78ae980d901e8c4a56b4be4ac315383..4b09ed13b40cee733d5388cf46140164ebf9635b 100644 --- a/jsonnet/kube-prometheus/kube-state-metrics/kube-state-metrics.libsonnet +++ b/jsonnet/kube-prometheus/kube-state-metrics/kube-state-metrics.libsonnet @@ -16,7 +16,7 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; }, versions+:: { - kubeStateMetrics: 'v1.6.0', + kubeStateMetrics: 'v1.7.1', kubeRbacProxy: 'v0.4.1', addonResizer: '1.8.4', }, @@ -43,88 +43,95 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; local clusterRole = k.rbac.v1.clusterRole; local rulesType = clusterRole.rulesType; - local coreRule = rulesType.new() + - rulesType.withApiGroups(['']) + - rulesType.withResources([ - 'configmaps', - 'secrets', - 'nodes', - 'pods', - 'services', - 'resourcequotas', - 'replicationcontrollers', - 'limitranges', - 'persistentvolumeclaims', - 'persistentvolumes', - 'namespaces', - 'endpoints', - ]) + - rulesType.withVerbs(['list', 'watch']); + local rules = [ + rulesType.new() + + rulesType.withApiGroups(['']) + + rulesType.withResources([ + 'configmaps', + 'secrets', + 'nodes', + 'pods', + 'services', + 'resourcequotas', + 'replicationcontrollers', + 'limitranges', + 'persistentvolumeclaims', + 'persistentvolumes', + 'namespaces', + 'endpoints', + ]) + + rulesType.withVerbs(['list', 'watch']), + + rulesType.new() + + rulesType.withApiGroups(['extensions']) + + rulesType.withResources([ + 'daemonsets', + 'deployments', + 'replicasets', + 'ingresses', + ]) + + rulesType.withVerbs(['list', 'watch']), + + rulesType.new() + + rulesType.withApiGroups(['apps']) + + rulesType.withResources([ + 'statefulsets', + 'daemonsets', + 'deployments', + 'replicasets', + ]) + + rulesType.withVerbs(['list', 'watch']), - local extensionsRule = rulesType.new() + - rulesType.withApiGroups(['extensions']) + - rulesType.withResources([ - 'daemonsets', - 'deployments', - 'replicasets', - 'ingresses', - ]) + - rulesType.withVerbs(['list', 'watch']); + rulesType.new() + + rulesType.withApiGroups(['batch']) + + rulesType.withResources([ + 'cronjobs', + 'jobs', + ]) + + rulesType.withVerbs(['list', 'watch']), - local appsRule = rulesType.new() + - rulesType.withApiGroups(['apps']) + - rulesType.withResources([ - 'statefulsets', - 'daemonsets', - 'deployments', - 'replicasets', - ]) + - rulesType.withVerbs(['list', 'watch']); - - local batchRule = rulesType.new() + - rulesType.withApiGroups(['batch']) + - rulesType.withResources([ - 'cronjobs', - 'jobs', - ]) + - rulesType.withVerbs(['list', 'watch']); - - local autoscalingRule = rulesType.new() + - rulesType.withApiGroups(['autoscaling']) + - rulesType.withResources([ - 'horizontalpodautoscalers', - ]) + - rulesType.withVerbs(['list', 'watch']); - - local authenticationRole = rulesType.new() + - rulesType.withApiGroups(['authentication.k8s.io']) + - rulesType.withResources([ - 'tokenreviews', - ]) + - rulesType.withVerbs(['create']); - - local authorizationRole = rulesType.new() + - rulesType.withApiGroups(['authorization.k8s.io']) + - rulesType.withResources([ - 'subjectaccessreviews', - ]) + - rulesType.withVerbs(['create']); - - local policyRule = rulesType.new() + - rulesType.withApiGroups(['policy']) + - rulesType.withResources([ - 'poddisruptionbudgets', - ]) + - rulesType.withVerbs(['list', 'watch']); - - local certificateRule = rulesType.new() + - rulesType.withApiGroups(['certificates.k8s.io']) + - rulesType.withResources([ - 'certificatesigningrequests', - ]) + - rulesType.withVerbs(['list', 'watch']); - - local rules = [coreRule, extensionsRule, appsRule, batchRule, autoscalingRule, authenticationRole, authorizationRole, policyRule, certificateRule]; + rulesType.new() + + rulesType.withApiGroups(['autoscaling']) + + rulesType.withResources([ + 'horizontalpodautoscalers', + ]) + + rulesType.withVerbs(['list', 'watch']), + + rulesType.new() + + rulesType.withApiGroups(['authentication.k8s.io']) + + rulesType.withResources([ + 'tokenreviews', + ]) + + rulesType.withVerbs(['create']), + + rulesType.new() + + rulesType.withApiGroups(['authorization.k8s.io']) + + rulesType.withResources([ + 'subjectaccessreviews', + ]) + + rulesType.withVerbs(['create']), + + rulesType.new() + + rulesType.withApiGroups(['policy']) + + rulesType.withResources([ + 'poddisruptionbudgets', + ]) + + rulesType.withVerbs(['list', 'watch']), + + rulesType.new() + + rulesType.withApiGroups(['certificates.k8s.io']) + + rulesType.withResources([ + 'certificatesigningrequests', + ]) + + rulesType.withVerbs(['list', 'watch']), + + rulesType.new() + + rulesType.withApiGroups(['storage.k8s.io']) + + rulesType.withResources([ + 'storageclasses', + ]) + + rulesType.withVerbs(['list', 'watch']), + ]; clusterRole.new() + clusterRole.mixin.metadata.withName('kube-state-metrics') + diff --git a/jsonnetfile.lock.json b/jsonnetfile.lock.json index c3d664a212591632645ca22b8b6b57e669ebf333..5e12508f3555868338f62e86aa49d6135f3bceed 100644 --- a/jsonnetfile.lock.json +++ b/jsonnetfile.lock.json @@ -8,7 +8,7 @@ "subdir": "jsonnet/kube-prometheus" } }, - "version": "aa7df507e98312f638c6a2aa7429906bc63949a6" + "version": "eb132e923ef07147131a62ed0e597cf0a90e984b" }, { "name": "ksonnet", @@ -48,7 +48,7 @@ "subdir": "grafana-builder" } }, - "version": "dbc94ab71afa538b2cf467f06751b1836920dce9" + "version": "8e77b50ee8aea319dac9964b2cc2183f3bc184d2" }, { "name": "grafana", @@ -78,7 +78,7 @@ "subdir": "Documentation/etcd-mixin" } }, - "version": "d137fa9d4ad7aa242f6fed04186a700ce082fdda" + "version": "149e5dc291a97eb41585fbd2b44ce00c4db684ad" }, { "name": "prometheus", @@ -88,7 +88,7 @@ "subdir": "documentation/prometheus-mixin" } }, - "version": "87a0fe0c75a42d66fcfc82a0ad89bd2549fcfadf" + "version": "0f007373087bfb2d581f77a4a9a47941e5eeee6b" } ] } diff --git a/manifests/kube-state-metrics-clusterRole.yaml b/manifests/kube-state-metrics-clusterRole.yaml index 9b96af3cc2b6c6013c52b825bd092845f6279571..a0722c70d4f342d43724defa69240f8ba051ff94 100644 --- a/manifests/kube-state-metrics-clusterRole.yaml +++ b/manifests/kube-state-metrics-clusterRole.yaml @@ -82,3 +82,10 @@ rules: verbs: - list - watch +- apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - list + - watch diff --git a/manifests/kube-state-metrics-deployment.yaml b/manifests/kube-state-metrics-deployment.yaml index 260cce68833074969a4abcafc9744a1a74b6e051..96351166b27d8a64fc3ca5195644b14db419a90d 100644 --- a/manifests/kube-state-metrics-deployment.yaml +++ b/manifests/kube-state-metrics-deployment.yaml @@ -55,7 +55,7 @@ spec: - --port=8081 - --telemetry-host=127.0.0.1 - --telemetry-port=8082 - image: quay.io/coreos/kube-state-metrics:v1.6.0 + image: quay.io/coreos/kube-state-metrics:v1.7.1 name: kube-state-metrics resources: limits: