Skip to content

Commit 6cd4e28

Browse files
authored
Merge pull request #28 from punkprzemo/hostPort-only
hostPort without hostNetwork
2 parents 9c8daa2 + 3b0e53d commit 6cd4e28

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

kubernetes-ingress/templates/controller-daemonset.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
*/}}
1616

1717
{{- if eq .Values.controller.kind "DaemonSet" }}
18+
{{- $useHostNetwork := .Values.controller.daemonset.useHostNetwork -}}
1819
{{- $useHostPort := .Values.controller.daemonset.useHostPort -}}
1920
{{- $hostPorts := .Values.controller.daemonset.hostPorts -}}
2021
apiVersion: apps/v1
@@ -52,7 +53,7 @@ spec:
5253
{{- end }}
5354
spec:
5455
serviceAccountName: {{ template "kubernetes-ingress.serviceAccountName" . }}
55-
{{- if $useHostPort }}
56+
{{- if $useHostNetwork }}
5657
hostNetwork: true
5758
{{- end }}
5859
{{- if .Values.controller.imageCredentials.registry }}

kubernetes-ingress/templates/controller-podsecuritypolicy.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
*/}}
1616

1717
{{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled }}
18+
{{- $useHostNetwork := .Values.controller.daemonset.useHostNetwork }}
1819
{{- $useHostPort := .Values.controller.daemonset.useHostPort }}
1920
{{- $hostPorts := .Values.controller.daemonset.hostPorts -}}
2021
apiVersion: policy/v1beta1
@@ -41,8 +42,10 @@ spec:
4142
- max: 65535
4243
min: 1
4344
rule: MustRunAs
44-
{{- if $useHostPort }}
45+
{{- if $useHostNetwork }}
4546
hostNetwork: true
47+
{{- end }}
48+
{{- if or $useHostPort $useHostNetwork }}
4649
hostPorts:
4750
{{- range $key, $value := .Values.controller.containerPort }}
4851
- min: {{ $value }}

kubernetes-ingress/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ controller:
274274
## Controller DaemonSet configuration
275275
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
276276
daemonset:
277+
useHostNetwork: false
277278
useHostPort: false
278279
hostPorts:
279280
http: 80

0 commit comments

Comments
 (0)