apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ template "winsUpgrader.name" . }} namespace: {{ template "winsUpgrader.namespace" . }} labels: {{ include "winsUpgrader.labels" . | nindent 4 }} rules: - apiGroups: ['policy'] resources: ['podsecuritypolicies'] verbs: ['use'] resourceNames: [{{ include "winsUpgrader.name" . | quote }}] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ template "winsUpgrader.name" . }} namespace: {{ template "winsUpgrader.namespace" . }} labels: {{ include "winsUpgrader.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ template "winsUpgrader.name" . }} subjects: - kind: ServiceAccount name: {{ template "winsUpgrader.name" . }} namespace: {{ template "winsUpgrader.namespace" $ }} --- apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "winsUpgrader.name" . }} namespace: {{ template "winsUpgrader.namespace" . }} labels: {{ include "winsUpgrader.labels" . | nindent 4 }} --- apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: name: {{ template "winsUpgrader.name" . }} namespace: {{ template "winsUpgrader.namespace" . }} labels: {{ include "winsUpgrader.labels" . | nindent 4 }} spec: privileged: false hostNetwork: false hostIPC: false hostPID: false runAsUser: rule: 'RunAsAny' seLinux: rule: 'RunAsAny' supplementalGroups: rule: 'MustRunAs' ranges: - min: 0 max: 65535 fsGroup: rule: 'MustRunAs' ranges: - min: 0 max: 65535 readOnlyRootFilesystem: false volumes: - 'secret' - 'hostPath' allowedHostPaths: - pathPrefix: \\.\pipe\rancher_wins {{- if .Values.masquerade.enabled }} - pathPrefix: {{ include "winsUpgrader.winsMasqueradeHostPath" . }} {{- else }} - pathPrefix: {{ include "winsUpgrader.winsHostPath" . }} {{- end }}