From 54720ea2a5e66d6456e4f75b76b54d7790d81b73 Mon Sep 17 00:00:00 2001 From: Arvind Iyengar Date: Fri, 27 Jan 2023 16:12:27 -0800 Subject: [PATCH] [rancher-node-exporter] Replace .Values.rbac.pspEnabled with .Values.global.cattle.psp.enabled and bump major version --- .../patch/templates/psp-clusterrole.yaml.patch | 8 +++++++- .../templates/psp-clusterrolebinding.yaml.patch | 9 +++++++++ .../patch/templates/psp.yaml.patch | 15 +++++---------- .../generated-changes/patch/values.yaml.patch | 16 ++++++++++++++-- .../rancher-node-exporter/package.yaml | 2 +- 5 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrolebinding.yaml.patch diff --git a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrole.yaml.patch b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrole.yaml.patch index 8f3f0b227..800a95d38 100644 --- a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrole.yaml.patch +++ b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrole.yaml.patch @@ -1,6 +1,12 @@ --- charts-original/templates/psp-clusterrole.yaml +++ charts/templates/psp-clusterrole.yaml -@@ -6,10 +6,12 @@ +@@ -1,15 +1,17 @@ + {{- if .Values.rbac.create }} +-{{- if .Values.rbac.pspEnabled }} ++{{- if .Values.global.cattle.psp.enabled }} + kind: ClusterRole + apiVersion: rbac.authorization.k8s.io/v1 + metadata: name: psp-{{ template "prometheus-node-exporter.fullname" . }} labels: {{ include "prometheus-node-exporter.labels" . | indent 4 }} rules: diff --git a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrolebinding.yaml.patch b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrolebinding.yaml.patch new file mode 100644 index 000000000..6eda9d4cc --- /dev/null +++ b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp-clusterrolebinding.yaml.patch @@ -0,0 +1,9 @@ +--- charts-original/templates/psp-clusterrolebinding.yaml ++++ charts/templates/psp-clusterrolebinding.yaml +@@ -1,5 +1,5 @@ + {{- if .Values.rbac.create }} +-{{- if .Values.rbac.pspEnabled }} ++{{- if .Values.global.cattle.psp.enabled }} + apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRoleBinding + metadata: diff --git a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp.yaml.patch b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp.yaml.patch index 57c182d2d..25d912061 100644 --- a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp.yaml.patch +++ b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/templates/psp.yaml.patch @@ -1,14 +1,9 @@ --- charts-original/templates/psp.yaml +++ charts/templates/psp.yaml -@@ -1,3 +1,4 @@ -+{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicies" }} +@@ -1,5 +1,5 @@ {{- if .Values.rbac.create }} - {{- if .Values.rbac.pspEnabled }} +-{{- if .Values.rbac.pspEnabled }} ++{{- if .Values.global.cattle.psp.enabled }} apiVersion: policy/v1beta1 -@@ -46,5 +47,6 @@ - - min: 0 - max: 65535 - readOnlyRootFilesystem: false -+{{- end }} - {{- end }} - {{- end }} + kind: PodSecurityPolicy + metadata: diff --git a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/values.yaml.patch b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/values.yaml.patch index 05fdca8e0..95b064256 100644 --- a/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/values.yaml.patch +++ b/packages/rancher-monitoring/rancher-node-exporter/generated-changes/patch/values.yaml.patch @@ -1,12 +1,14 @@ --- charts-original/values.yaml +++ charts/values.yaml -@@ -1,10 +1,15 @@ +@@ -1,10 +1,17 @@ # Default values for prometheus-node-exporter. # This is a YAML-formatted file. # Declare variables to be passed into your templates. + +global: + cattle: ++ psp: ++ enabled: false + systemDefaultRegistry: "" + image: @@ -18,7 +20,17 @@ pullPolicy: IfNotPresent sha: "" -@@ -163,6 +168,8 @@ +@@ -95,9 +102,6 @@ + ## If true, create & use RBAC resources + ## + create: true +- ## If true, create & use Pod Security Policy resources +- ## https://kubernetes.io/docs/concepts/policy/pod-security-policy/ +- pspEnabled: true + pspAnnotations: {} + + # for deployments that have node_exporter deployed outside of the cluster, list +@@ -163,6 +167,8 @@ tolerations: - effect: NoSchedule diff --git a/packages/rancher-monitoring/rancher-node-exporter/package.yaml b/packages/rancher-monitoring/rancher-node-exporter/package.yaml index 74a1ab85b..e00b92b93 100644 --- a/packages/rancher-monitoring/rancher-node-exporter/package.yaml +++ b/packages/rancher-monitoring/rancher-node-exporter/package.yaml @@ -1,5 +1,5 @@ url: https://github.com/prometheus-community/helm-charts.git subdirectory: charts/prometheus-node-exporter commit: 059e3a6e6b4ba0fd8614763de0f8e24937a89a39 -version: 101.0.0 +version: 102.0.0 doNotRelease: true