Skip to content

Commit 551c0c4

Browse files
authored
Chart: Implement runtimeClassName. (#13381)
Signed-off-by: joey <zchengjoey@gmail.com>
1 parent 92b4470 commit 551c0c4

9 files changed

+41
-0
lines changed

charts/ingress-nginx/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ metadata:
283283
| controller.admissionWebhooks.patch.priorityClassName | string | `""` | Provide a priority class name to the webhook patching job # |
284284
| controller.admissionWebhooks.patch.rbac | object | `{"create":true}` | Admission webhook patch job RBAC |
285285
| controller.admissionWebhooks.patch.rbac.create | bool | `true` | Create RBAC or not |
286+
| controller.admissionWebhooks.patch.runtimeClassName | string | `""` | Instruct the kubelet to use the named RuntimeClass to run the pod |
286287
| controller.admissionWebhooks.patch.securityContext | object | `{}` | Security context for secret creation & webhook patch pods |
287288
| controller.admissionWebhooks.patch.serviceAccount | object | `{"automountServiceAccountToken":true,"create":true,"name":""}` | Admission webhook patch job service account |
288289
| controller.admissionWebhooks.patch.serviceAccount.automountServiceAccountToken | bool | `true` | Auto-mount service account token or not |
@@ -438,6 +439,7 @@ metadata:
438439
| controller.reportNodeInternalIp | bool | `false` | Bare-metal considerations via the host network https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#via-the-host-network Ingress status was blank because there is no Service exposing the Ingress-Nginx Controller in a configuration using the host network, the default --publish-service flag used in standard cloud setups does not apply |
439440
| controller.resources.requests.cpu | string | `"100m"` | |
440441
| controller.resources.requests.memory | string | `"90Mi"` | |
442+
| controller.runtimeClassName | string | `""` | Instruct the kubelet to use the named RuntimeClass to run the pod |
441443
| controller.scope.enabled | bool | `false` | Enable 'scope' or not |
442444
| controller.scope.namespace | string | `""` | Namespace to limit the controller to; defaults to $(POD_NAMESPACE) |
443445
| controller.scope.namespaceSelector | string | `""` | When scope.enabled == false, instead of watching all namespaces, we watching namespaces whose labels only match with namespaceSelector. Format like foo=bar. Defaults to empty, means watching all namespaces. |
@@ -549,6 +551,7 @@ metadata:
549551
| defaultBackend.readinessProbe.timeoutSeconds | int | `5` | |
550552
| defaultBackend.replicaCount | int | `1` | |
551553
| defaultBackend.resources | object | `{}` | |
554+
| defaultBackend.runtimeClassName | string | `""` | Instruct the kubelet to use the named RuntimeClass to run the pod |
552555
| defaultBackend.service.annotations | object | `{}` | |
553556
| defaultBackend.service.clusterIPs | list | `[]` | Pre-defined cluster internal IP addresses of the default backend service. Take care of collisions with existing services. This value is immutable. Set once, it can not be changed without deleting and re-creating the service. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address |
554557
| defaultBackend.service.externalIPs | list | `[]` | List of IP addresses at which the default backend service is available # Ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips # |

charts/ingress-nginx/templates/admission-webhooks/job-patch/job-createSecret.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ spec:
3737
{{- if .Values.controller.admissionWebhooks.patch.priorityClassName }}
3838
priorityClassName: {{ .Values.controller.admissionWebhooks.patch.priorityClassName }}
3939
{{- end }}
40+
{{- if .Values.controller.admissionWebhooks.patch.runtimeClassName }}
41+
runtimeClassName: {{ .Values.controller.admissionWebhooks.patch.runtimeClassName | quote }}
42+
{{- end }}
4043
{{- if .Values.imagePullSecrets }}
4144
imagePullSecrets: {{ toYaml .Values.imagePullSecrets | nindent 8 }}
4245
{{- end }}

charts/ingress-nginx/templates/admission-webhooks/job-patch/job-patchWebhook.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ spec:
3737
{{- if .Values.controller.admissionWebhooks.patch.priorityClassName }}
3838
priorityClassName: {{ .Values.controller.admissionWebhooks.patch.priorityClassName }}
3939
{{- end }}
40+
{{- if .Values.controller.admissionWebhooks.patch.runtimeClassName }}
41+
runtimeClassName: {{ .Values.controller.admissionWebhooks.patch.runtimeClassName | quote }}
42+
{{- end }}
4043
{{- if .Values.imagePullSecrets }}
4144
imagePullSecrets: {{ toYaml .Values.imagePullSecrets | nindent 8 }}
4245
{{- end }}

charts/ingress-nginx/templates/controller-daemonset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ spec:
5757
{{- if .Values.controller.priorityClassName }}
5858
priorityClassName: {{ .Values.controller.priorityClassName | quote }}
5959
{{- end }}
60+
{{- if .Values.controller.runtimeClassName }}
61+
runtimeClassName: {{ .Values.controller.runtimeClassName | quote }}
62+
{{- end }}
6063
{{- if or .Values.controller.podSecurityContext .Values.controller.sysctls }}
6164
securityContext:
6265
{{- if .Values.controller.podSecurityContext }}

charts/ingress-nginx/templates/controller-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ spec:
6363
{{- if .Values.controller.priorityClassName }}
6464
priorityClassName: {{ .Values.controller.priorityClassName | quote }}
6565
{{- end }}
66+
{{- if .Values.controller.runtimeClassName }}
67+
runtimeClassName: {{ .Values.controller.runtimeClassName | quote }}
68+
{{- end }}
6669
{{- if or .Values.controller.podSecurityContext .Values.controller.sysctls }}
6770
securityContext:
6871
{{- if .Values.controller.podSecurityContext }}

charts/ingress-nginx/templates/default-backend-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ spec:
4545
{{- if .Values.defaultBackend.priorityClassName }}
4646
priorityClassName: {{ .Values.defaultBackend.priorityClassName }}
4747
{{- end }}
48+
{{- if .Values.defaultBackend.runtimeClassName }}
49+
runtimeClassName: {{ .Values.defaultBackend.runtimeClassName | quote }}
50+
{{- end }}
4851
{{- if .Values.defaultBackend.podSecurityContext }}
4952
securityContext: {{ toYaml .Values.defaultBackend.podSecurityContext | nindent 8 }}
5053
{{- end }}

charts/ingress-nginx/tests/controller-daemonset_test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,12 @@ tests:
199199
- equal:
200200
path: spec.template.spec.automountServiceAccountToken
201201
value: false
202+
203+
- it: should create a DaemonSet with a custom runtime if `controller.runtimeClassName` is set
204+
set:
205+
controller.kind: DaemonSet
206+
controller.runtimeClassName: myClass
207+
asserts:
208+
- equal:
209+
path: spec.template.spec.runtimeClassName
210+
value: myClass

charts/ingress-nginx/tests/controller-deployment_test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,11 @@ tests:
223223
- equal:
224224
path: spec.template.spec.automountServiceAccountToken
225225
value: false
226+
227+
- it: should create a Deployment with a custom runtime if `controller.runtimeClassName` is set
228+
set:
229+
controller.runtimeClassName: myClass
230+
asserts:
231+
- equal:
232+
path: spec.template.spec.runtimeClassName
233+
value: myClass

charts/ingress-nginx/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ controller:
7878
# By default, while using host network, name resolution uses the host's DNS. If you wish nginx-controller
7979
# to keep resolving names inside the k8s network, use ClusterFirstWithHostNet.
8080
dnsPolicy: ClusterFirst
81+
# -- Instruct the kubelet to use the named RuntimeClass to run the pod
82+
runtimeClassName: ""
8183
# -- Bare-metal considerations via the host network https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#via-the-host-network
8284
# Ingress status was blank because there is no Service exposing the Ingress-Nginx Controller in a configuration using the host network, the default --publish-service flag used in standard cloud setups does not apply
8385
reportNodeInternalIp: false
@@ -822,6 +824,8 @@ controller:
822824
# -- Provide a priority class name to the webhook patching job
823825
##
824826
priorityClassName: ""
827+
# -- Instruct the kubelet to use the named RuntimeClass to run the pod
828+
runtimeClassName: ""
825829
podAnnotations: {}
826830
# NetworkPolicy for webhook patch
827831
networkPolicy:
@@ -1195,6 +1199,8 @@ defaultBackend:
11951199
servicePort: 80
11961200
type: ClusterIP
11971201
priorityClassName: ""
1202+
# -- Instruct the kubelet to use the named RuntimeClass to run the pod
1203+
runtimeClassName: ""
11981204
# -- Labels to be added to the default backend resources
11991205
labels: {}
12001206
## Enable RBAC as per https://github.com/kubernetes/ingress-nginx/blob/main/docs/deploy/rbac.md and https://github.com/kubernetes/ingress-nginx/issues/266

0 commit comments

Comments
 (0)