Skip to content

Commit 8a1a5a6

Browse files
committed
Add config for k8s Services' ipFamilies and ipFamilyPolicy
1 parent aef71b2 commit 8a1a5a6

File tree

6 files changed

+40
-7
lines changed

6 files changed

+40
-7
lines changed

jupyterhub/templates/hub/service.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ metadata:
1919
{{- end }}
2020
spec:
2121
type: {{ .Values.hub.service.type }}
22-
{{- with .Values.hub.service.loadBalancerIP }}
23-
loadBalancerIP: {{ . }}
24-
{{- end }}
2522
selector:
2623
{{- include "jupyterhub.matchLabels" . | nindent 4 }}
2724
ports:
@@ -35,3 +32,13 @@ spec:
3532
{{- with .Values.hub.service.extraPorts }}
3633
{{- . | toYaml | nindent 4 }}
3734
{{- end }}
35+
{{- with .Values.hub.service.loadBalancerIP }}
36+
loadBalancerIP: {{ . }}
37+
{{- end }}
38+
{{- with .Values.hub.service.ipFamilyPolicy }}
39+
ipFamilyPolicy: {{ . }}
40+
{{- end }}
41+
{{- with .Values.hub.service.ipFamilies }}
42+
ipFamilies:
43+
{{- . | toYaml | nindent 4 }}
44+
{{- end }}

jupyterhub/templates/proxy/autohttps/service.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ spec:
2222
ports:
2323
- port: 8000
2424
targetPort: http
25+
{{- with .Values.proxy.service.ipFamilyPolicy }}
26+
ipFamilyPolicy: {{ . }}
27+
{{- end }}
28+
{{- with .Values.proxy.service.ipFamilies }}
29+
ipFamilies:
30+
{{- . | toYaml | nindent 4 }}
31+
{{- end }}
2532
{{- end }}

jupyterhub/templates/proxy/service.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ spec:
7979
ipFamilyPolicy: {{ . }}
8080
{{- end }}
8181
{{- with .Values.proxy.service.ipFamilies }}
82-
ipFamilies:
83-
{{- range $family := . }}
84-
- {{ $family }}
85-
{{- end }}
82+
ipFamilies:
83+
{{- . | toYaml | nindent 4 }}
8684
{{- end }}
8785
{{- if eq .Values.proxy.service.type "LoadBalancer" }}
8886
{{- with .Values.proxy.service.loadBalancerSourceRanges }}

jupyterhub/values.schema.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,16 @@ properties:
11271127
A public IP address the hub Kubernetes service should be exposed
11281128
on. To expose the hub directly is not recommended. Instead route
11291129
traffic through the proxy-public service towards the hub.
1130+
ipFamilyPolicy: &ipFamilyPolicy-spec
1131+
type: [string]
1132+
description: |
1133+
See the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
1134+
for more info.
1135+
ipFamilies: &ipFamilies-spec
1136+
type: array
1137+
description: |
1138+
See the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
1139+
for more info.
11301140
11311141
pdb: &pdb-spec
11321142
type: object
@@ -1744,6 +1754,8 @@ properties:
17441754
description: |
17451755
A list of IP CIDR ranges that are allowed to access the load balancer service.
17461756
Defaults to allowing everyone to access it.
1757+
ipFamilyPolicy: *ipFamilyPolicy-spec
1758+
ipFamilies: *ipFamilies-spec
17471759
https:
17481760
type: object
17491761
additionalProperties: false

jupyterhub/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ hub:
4343
nodePort:
4444
extraPorts: []
4545
loadBalancerIP:
46+
ipFamilyPolicy: ""
47+
ipFamilies: []
4648
baseUrl: /
4749
cookieSecret:
4850
initContainers: []

tools/templates/lint-and-validate-values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ hub:
7070
- name: dummy-port-2
7171
port: 8182
7272
targetPort: string-named-target-port
73+
ipFamilyPolicy: SingleStack
74+
ipFamilies:
75+
- IPv4
7376
baseUrl: /
7477
activeServerLimit: 3
7578
deploymentStrategy:
@@ -223,6 +226,10 @@ proxy:
223226
nodePorts:
224227
http:
225228
https:
229+
ipFamilyPolicy: DualStack
230+
ipFamilies:
231+
- IPv4
232+
- IPv6
226233
chp:
227234
revisionHistoryLimit: 1
228235
extraCommandLineFlags:

0 commit comments

Comments
 (0)