diff --git a/base_operator_stack.jsonnet b/base_operator_stack.jsonnet index 68cb364..4b021dd 100644 --- a/base_operator_stack.jsonnet +++ b/base_operator_stack.jsonnet @@ -64,27 +64,28 @@ local vars = import 'vars.jsonnet'; //--------------------------------------- prometheus+:: { + # Add option (from vars.yaml) to enable persistence local pvc = k.core.v1.persistentVolumeClaim, prometheus+: { spec+: { - retention: '15d', - externalUrl: 'http://' + $._config.urls.prom_ingress, - } - + ( if vars.enablePersistence['prometheus'] then { - storage: { - volumeClaimTemplate: - pvc.new() + - pvc.mixin.spec.withAccessModes('ReadWriteOnce') + - pvc.mixin.spec.resources.withRequests({ storage: '20Gi' }), - // Uncomment below to define a StorageClass name - //+ pvc.mixin.spec.withStorageClassName('nfs-master-ssd'), - }, - } else {}), + retention: '15d', + externalUrl: 'http://' + $._config.urls.prom_ingress, + } + + (if vars.enablePersistence.prometheus then { + storage: { + volumeClaimTemplate: + pvc.new() + + pvc.mixin.spec.withAccessModes('ReadWriteOnce') + + pvc.mixin.spec.resources.withRequests({ storage: '20Gi' }), + // Uncomment below to define a StorageClass name + //+ pvc.mixin.spec.withStorageClassName('nfs-master-ssd'), + }, + } else {}), }, }, // Override deployment for Grafana data persistence - grafana+:: if vars.enablePersistence['grafana'] then { + grafana+:: if vars.enablePersistence.grafana then { deployment+: { spec+: { template+: { @@ -117,38 +118,6 @@ local vars = import 'vars.jsonnet'; grafanaDashboards+:: $._config.grafanaDashboards, - kubeStateMetrics+:: { - // Override command for addon-resizer due to change from parameter --threshold to --acceptance-offset - deployment+: { - spec+: { - template+: { - spec+: { - containers: - std.map( - function(c) - if std.startsWith(c.name, 'addon-resizer') then - c { - command: [ - '/pod_nanny', - '--container=kube-state-metrics', - '--cpu=100m', - '--extra-cpu=2m', - '--memory=150Mi', - '--extra-memory=30Mi', - '--acceptance-offset=5', - '--deployment=kube-state-metrics', - ], - } - else - c, - super.containers, - ), - }, - }, - }, - }, - }, - // Create ingress objects per application ingress+: { local secret = k.core.v1.secret, diff --git a/image_sources_versions.jsonnet b/image_sources_versions.jsonnet index fbb226f..b5cd01b 100644 --- a/image_sources_versions.jsonnet +++ b/image_sources_versions.jsonnet @@ -5,7 +5,7 @@ alertmanager: 'v0.16.0', kubeStateMetrics: 'v1.5.0', kubeRbacProxy: 'v0.4.1', - addonResizer: '2.1', + addonResizer: 'v1.8.4', nodeExporter: 'v0.17.0', prometheusOperator: 'v0.28.0', prometheusAdapter: 'v0.4.1', diff --git a/manifests/kube-state-metrics-deployment.yaml b/manifests/kube-state-metrics-deployment.yaml index 8e28a72..7fa4b88 100644 --- a/manifests/kube-state-metrics-deployment.yaml +++ b/manifests/kube-state-metrics-deployment.yaml @@ -71,7 +71,7 @@ spec: - --extra-cpu=2m - --memory=150Mi - --extra-memory=30Mi - - --acceptance-offset=5 + - --threshold=5 - --deployment=kube-state-metrics env: - name: MY_POD_NAME @@ -84,7 +84,7 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: carlosedp/addon-resizer:2.1 + image: carlosedp/addon-resizer:v1.8.4 name: addon-resizer resources: limits: