mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-09-06 12:57:18 +00:00
Merge pull request #1892 from somaz94/feat/chart-host-users
feat: add opt-in hostUsers to the Helm chart
This commit is contained in:
@@ -71,6 +71,7 @@ The following table lists the configurable parameters of the _descheduler_ chart
|
||||
| `priorityClassName` | The name of the priority class to add to pods | `system-cluster-critical` |
|
||||
| `schedulerName` | The name of the scheduler used to schedule the descheduler cronjob/deployment pods | `""` |
|
||||
| `runtimeClassName` | The RuntimeClass applied to the descheduler cronjob/deployment pods | `""` |
|
||||
| `hostUsers` | If set (`true`/`false`), sets `hostUsers` on the pod spec to control user-namespace sharing | `nil` |
|
||||
| `rbac.create` | If `true`, create & use RBAC resources | `true` |
|
||||
| `resources` | Descheduler container CPU and memory requests/limits | _see values.yaml_ |
|
||||
| `serviceAccount.create` | If `true`, create a service account for the cron job | `true` |
|
||||
|
||||
@@ -93,6 +93,9 @@ spec:
|
||||
{{- if .Values.runtimeClassName }}
|
||||
runtimeClassName: {{ .Values.runtimeClassName }}
|
||||
{{- end }}
|
||||
{{- if kindIs "bool" .Values.hostUsers }}
|
||||
hostUsers: {{ .Values.hostUsers }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "descheduler.serviceAccountName" . }}
|
||||
{{- if kindIs "bool" .Values.automountServiceAccountToken }}
|
||||
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
|
||||
|
||||
@@ -47,6 +47,9 @@ spec:
|
||||
{{- if .Values.runtimeClassName }}
|
||||
runtimeClassName: {{ .Values.runtimeClassName }}
|
||||
{{- end }}
|
||||
{{- if kindIs "bool" .Values.hostUsers }}
|
||||
hostUsers: {{ .Values.hostUsers }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "descheduler.serviceAccountName" . }}
|
||||
{{- if kindIs "bool" .Values.automountServiceAccountToken }}
|
||||
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
|
||||
|
||||
@@ -41,3 +41,27 @@ tests:
|
||||
path: spec.jobTemplate.spec.template.spec.schedulerName
|
||||
- notExists:
|
||||
path: spec.jobTemplate.spec.template.spec.runtimeClassName
|
||||
|
||||
- it: sets hostUsers to false when configured
|
||||
set:
|
||||
hostUsers: false
|
||||
template: templates/cronjob.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.jobTemplate.spec.template.spec.hostUsers
|
||||
value: false
|
||||
|
||||
- it: sets hostUsers to true when configured
|
||||
set:
|
||||
hostUsers: true
|
||||
template: templates/cronjob.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.jobTemplate.spec.template.spec.hostUsers
|
||||
value: true
|
||||
|
||||
- it: omits hostUsers by default
|
||||
template: templates/cronjob.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.jobTemplate.spec.template.spec.hostUsers
|
||||
|
||||
@@ -73,3 +73,27 @@ tests:
|
||||
path: spec.template.spec.schedulerName
|
||||
- notExists:
|
||||
path: spec.template.spec.runtimeClassName
|
||||
|
||||
- it: sets hostUsers to false when configured
|
||||
set:
|
||||
hostUsers: false
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.hostUsers
|
||||
value: false
|
||||
|
||||
- it: sets hostUsers to true when configured
|
||||
set:
|
||||
hostUsers: true
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.hostUsers
|
||||
value: true
|
||||
|
||||
- it: omits hostUsers by default
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.hostUsers
|
||||
|
||||
@@ -172,6 +172,11 @@ schedulerName: ""
|
||||
# Leave empty to use the cluster default runtime.
|
||||
runtimeClassName: ""
|
||||
|
||||
# Set the Pod spec `hostUsers` field to control user-namespace sharing.
|
||||
# Default is not set (the cluster default applies). Set to `false` to opt into
|
||||
# user-namespace isolation, or `true` to share the host user namespace.
|
||||
# hostUsers: false
|
||||
|
||||
nodeSelector: {}
|
||||
# foo: bar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user