Merge pull request #5708 from towolf/patch-1

Add sysctl exemptions to controller PSP
This commit is contained in:
Kubernetes Prow Robot 2020-06-16 10:40:04 -07:00 committed by GitHub
commit e65b2ca5b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 6 deletions

View file

@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
name: ingress-nginx name: ingress-nginx
version: 2.5.0 version: 2.6.0
appVersion: 0.33.0 appVersion: 0.33.0
home: https://github.com/kubernetes/ingress-nginx home: https://github.com/kubernetes/ingress-nginx
description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer

View file

@ -90,6 +90,7 @@ Parameter | Description | Default
`controller.podAnnotations` | annotations to be added to pods | `{}` `controller.podAnnotations` | annotations to be added to pods | `{}`
`controller.podLabels` | labels to add to the pod container metadata | `{}` `controller.podLabels` | labels to add to the pod container metadata | `{}`
`controller.podSecurityContext` | Security context policies to add to the controller pod | `{}` `controller.podSecurityContext` | Security context policies to add to the controller pod | `{}`
`controller.sysctls` | Map of optional sysctls to enable in the controller and in the PodSecurityPolicy | `{}`
`controller.replicaCount` | desired number of controller pods | `1` `controller.replicaCount` | desired number of controller pods | `1`
`controller.minAvailable` | minimum number of available controller pods for PodDisruptionBudget | `1` `controller.minAvailable` | minimum number of available controller pods for PodDisruptionBudget | `1`
`controller.resources` | controller pod resource requests & limits | `{}` `controller.resources` | controller pod resource requests & limits | `{}`

View file

@ -42,8 +42,18 @@ spec:
{{- if .Values.controller.priorityClassName }} {{- if .Values.controller.priorityClassName }}
priorityClassName: {{ .Values.controller.priorityClassName }} priorityClassName: {{ .Values.controller.priorityClassName }}
{{- end }} {{- end }}
{{- if or .Values.controller.podSecurityContext .Values.controller.sysctls }}
securityContext:
{{- end }}
{{- if .Values.controller.podSecurityContext }} {{- if .Values.controller.podSecurityContext }}
securityContext: {{ toYaml .Values.controller.podSecurityContext | nindent 8 }} {{- toYaml .Values.controller.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.controller.sysctls }}
sysctls:
{{- range $sysctl, $value := .Values.controller.sysctls }}
- name: {{ $sysctl }}
value: {{ $value }}
{{- end }}
{{- end }} {{- end }}
containers: containers:
- name: controller - name: controller

View file

@ -46,8 +46,18 @@ spec:
{{- if .Values.controller.priorityClassName }} {{- if .Values.controller.priorityClassName }}
priorityClassName: {{ .Values.controller.priorityClassName }} priorityClassName: {{ .Values.controller.priorityClassName }}
{{- end }} {{- end }}
{{- if or .Values.controller.podSecurityContext .Values.controller.sysctls }}
securityContext:
{{- end }}
{{- if .Values.controller.podSecurityContext }} {{- if .Values.controller.podSecurityContext }}
securityContext: {{ toYaml .Values.controller.podSecurityContext | nindent 8 }} {{- toYaml .Values.controller.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.controller.sysctls }}
sysctls:
{{- range $sysctl, $value := .Values.controller.sysctls }}
- name: {{ $sysctl }}
value: {{ $value }}
{{- end }}
{{- end }} {{- end }}
containers: containers:
- name: controller - name: controller

View file

@ -9,6 +9,12 @@ metadata:
spec: spec:
allowedCapabilities: allowedCapabilities:
- NET_BIND_SERVICE - NET_BIND_SERVICE
{{- if .Values.controller.sysctls }}
allowedUnsafeSysctls:
{{- range $sysctl, $value := .Values.controller.sysctls }}
- {{ $sysctl }}
{{- end }}
{{- end }}
privileged: false privileged: false
allowPrivilegeEscalation: true allowPrivilegeEscalation: true
# Allow core volume types. # Allow core volume types.

View file

@ -67,11 +67,16 @@ controller:
# key: value # key: value
## Security Context policies for controller pods ## Security Context policies for controller pods
## See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for
## notes on enabling and using sysctls
## ##
podSecurityContext: {} podSecurityContext: {}
## See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for
## notes on enabling and using sysctls
###
sysctls: {}
# sysctls:
# "net.core.somaxconn": "8192"
## Allows customization of the source of the IP address or FQDN to report ## Allows customization of the source of the IP address or FQDN to report
## in the ingress status field. By default, it reads the information provided ## in the ingress status field. By default, it reads the information provided
## by the service. If disable, the status field reports the IP address of the ## by the service. If disable, the status field reports the IP address of the