psp changes for node-exporter

pull/2282/head
Geet Samra 2022-12-19 18:45:06 -08:00
parent fa6acc091f
commit d6d67f4d33
4 changed files with 37 additions and 8 deletions

View File

@ -18,15 +18,15 @@
- nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 8 }}
+{{- toYaml .Values.nodeSelector | nindent 8 }}
+{{- end }}
+ tolerations: {{ include "linux-node-tolerations" . | nindent 8 }}
+{{- if .Values.tolerations }}
+{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
- {{- with .Values.tolerations }}
- tolerations:
-{{ toYaml . | indent 8 }}
- {{- end }}
+ tolerations: {{ include "linux-node-tolerations" . | nindent 8 }}
+{{- if .Values.tolerations }}
+{{- toYaml .Values.tolerations | nindent 8 }}
+{{- end }}
volumes:
- name: proc
hostPath:

View File

@ -0,0 +1,15 @@
--- charts-original/templates/psp-clusterrole.yaml
+++ charts/templates/psp-clusterrole.yaml
@@ -6,10 +6,12 @@
name: psp-{{ template "prometheus-node-exporter.fullname" . }}
labels: {{ include "prometheus-node-exporter.labels" . | indent 4 }}
rules:
+{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicies" }}
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
+{{- end }}
- {{ template "prometheus-node-exporter.fullname" . }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,14 @@
--- charts-original/templates/psp.yaml
+++ charts/templates/psp.yaml
@@ -1,3 +1,4 @@
+{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicies" }}
{{- if .Values.rbac.create }}
{{- if .Values.rbac.pspEnabled }}
apiVersion: policy/v1beta1
@@ -46,5 +47,6 @@
- min: 0
max: 65535
readOnlyRootFilesystem: false
+{{- end }}
{{- end }}
{{- end }}

View File

@ -18,12 +18,12 @@
pullPolicy: IfNotPresent
sha: ""
@@ -164,6 +169,8 @@
@@ -163,6 +168,8 @@
tolerations:
- effect: NoSchedule
operator: Exists
+ - effect: NoExecute
+ operator: Exists
+ - effect: NoExecute
operator: Exists
## Assign a PriorityClassName to pods if set
# priorityClassName: ""