Skip to content

Commit a550e71

Browse files
committed
feat: allow users to run coredns in usernamespaces
Signed-off-by: Henrik Gerdes <[email protected]>
1 parent d42d32b commit a550e71

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

charts/coredns/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: coredns
3-
version: 1.42.2
3+
version: 1.42.3
44
appVersion: 1.12.0
55
home: https://coredns.io
66
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
@@ -19,5 +19,5 @@ maintainers:
1919
type: application
2020
annotations:
2121
artifacthub.io/changes: |
22-
- kind: removed
23-
description: Removed "istcp" true for default dns:// scheme in "coredns.containerPorts" definition.
22+
- kind: added
23+
description: Add support to run pods in usernamespaces

charts/coredns/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The command removes all the Kubernetes components associated with the chart and
110110
| Parameter | Description | Default |
111111
| :--------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------- |
112112
| `image.repository` | The image repository to pull from | coredns/coredns |
113-
| `image.tag` | The image tag to pull from (derived from Chart.yaml) | `` |
113+
| `image.tag` | The image tag to pull from (derived from Chart.yaml) | `` |
114114
| `image.pullPolicy` | Image pull policy | IfNotPresent |
115115
| `image.pullSecrets` | Specify container image pull secrets | `[]` |
116116
| `replicaCount` | Number of replicas | 1 |
@@ -143,6 +143,7 @@ The command removes all the Kubernetes components associated with the chart and
143143
| `isClusterService` | Specifies whether chart should be deployed as cluster-service or normal k8s app. | true |
144144
| `priorityClassName` | Name of Priority Class to assign pods | `""` |
145145
| `securityContext` | securityContext definition for pods | capabilities.add.NET_BIND_SERVICE |
146+
| `hostUsers` | Specifies whether to use usernamespaces or not | true |
146147
| `servers` | Configuration for CoreDNS and plugins | See values.yml |
147148
| `livenessProbe.enabled` | Enable/disable the Liveness probe | `true` |
148149
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60` |
@@ -164,7 +165,7 @@ The command removes all the Kubernetes components associated with the chart and
164165
| `extraVolumes` | Optional array of volumes to create | [] |
165166
| `extraVolumeMounts` | Optional array of volumes to mount inside the CoreDNS container | [] |
166167
| `extraSecrets` | Optional array of secrets to mount inside the CoreDNS container | [] |
167-
| `env` | Optional array of environment variables for CoreDNS container | [] |
168+
| `env` | Optional array of environment variables for CoreDNS container | [] |
168169
| `customLabels` | Optional labels for Deployment(s), Pod, Service, ServiceMonitor objects | {} |
169170
| `customAnnotations` | Optional annotations for Deployment(s), Pod, Service, ServiceMonitor objects |
170171
| `rollingUpdate.maxUnavailable` | Maximum number of unavailable replicas during rolling update | `1` |

charts/coredns/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ spec:
7272
{{- if .Values.isClusterService }}
7373
dnsPolicy: Default
7474
{{- end }}
75+
{{- if not .Values.hostUsers }}
76+
hostUsers: false
77+
{{- end }}
7578
{{- if .Values.affinity }}
7679
affinity:
7780
{{ toYaml .Values.affinity | indent 8 }}

charts/coredns/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ securityContext:
102102
- ALL
103103
readOnlyRootFilesystem: true
104104

105+
# Uses users of the host system. If set to false uses usernamespaces. Requires Kubernetes >= 1.33
106+
hostUsers: true
107+
105108
# Default zone is what Kubernetes recommends:
106109
# https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#coredns-configmap-options
107110
servers:

0 commit comments

Comments
 (0)