Skip to content

Commit

Permalink
[stable/node-problem-detector] support PSP (helm#15253)
Browse files Browse the repository at this point in the history
Support PSP with permissive default.

Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs authored and k8s-ci-robot committed Jul 18, 2019
1 parent ef07a43 commit 33a1fa3
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/node-problem-detector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: node-problem-detector
version: "1.4.3"
version: "1.5.0"
appVersion: v0.6.3
home: https://github.com/kubernetes/node-problem-detector
description: Installs the node-problem-detector daemonset for monitoring extra attributes on nodes
Expand Down
3 changes: 2 additions & 1 deletion stable/node-problem-detector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ The following table lists the configurable parameters for this chart and their d
| `image.tag` | Image tag | `v0.6.3` |
| `nameOverride` | Override the name of the chart | `nil` |
| `rbac.create` | RBAC | `true` |
| `rbac.pspEnabled` | PodSecuritypolicy | `false` |
| `hostNetwork` | Run pod on host network | `false` |
| `priorityClassName` | Priority class name | `""` |
| `priorityClassName` | Priority class name | `""` |
| `resources` | Pod resource requests and limits | `{}` |
| `settings.custom_monitor_definitions` | User-specified custom monitor definitions | `{}` |
| `settings.log_monitors` | System log monitor config files | `/config/kernel-monitor.json`, `/config/docker-monitor.json` |
Expand Down
17 changes: 17 additions & 0 deletions stable/node-problem-detector/templates/psp-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.rbac.pspEnabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "node-problem-detector.fullname" . }}-psp
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "node-problem-detector.fullname" . }}
{{- end }}
19 changes: 19 additions & 0 deletions stable/node-problem-detector/templates/psp-clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "node-problem-detector.fullname" . }}-psp
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "node-problem-detector.fullname" . }}-psp
subjects:
- kind: ServiceAccount
name: {{ template "node-problem-detector.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
35 changes: 35 additions & 0 deletions stable/node-problem-detector/templates/psp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if .Values.rbac.pspEnabled }}
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
- 'hostPath'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
{{- end }}
1 change: 1 addition & 0 deletions stable/node-problem-detector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ fullnameOverride: ""

rbac:
create: true
pspEnabled: false

# Flag to run Node Problem Detector on the host's network. This is typically
# not recommended, but may be useful for certain use cases.
Expand Down

0 comments on commit 33a1fa3

Please sign in to comment.