Skip to content

Commit 697b1d0

Browse files
committed
Add config for k8s Services' ipFamilies and ipFamilyPolicy
1 parent 05839d7 commit 697b1d0

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:
@@ -38,3 +35,13 @@ spec:
3835
{{- with .Values.hub.service.extraPorts }}
3936
{{- . | toYaml | nindent 4 }}
4037
{{- end }}
38+
{{- with .Values.hub.service.loadBalancerIP }}
39+
loadBalancerIP: {{ . }}
40+
{{- end }}
41+
{{- with .Values.hub.service.ipFamilyPolicy }}
42+
ipFamilyPolicy: {{ . }}
43+
{{- end }}
44+
{{- with .Values.hub.service.ipFamilies }}
45+
ipFamilies:
46+
{{- . | toYaml | nindent 4 }}
47+
{{- 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
@@ -1150,6 +1150,16 @@ properties:
11501150
A public IP address the hub Kubernetes service should be exposed
11511151
on. To expose the hub directly is not recommended. Instead route
11521152
traffic through the proxy-public service towards the hub.
1153+
ipFamilyPolicy: &ipFamilyPolicy-spec
1154+
type: [string]
1155+
description: |
1156+
See the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
1157+
for more info.
1158+
ipFamilies: &ipFamilies-spec
1159+
type: array
1160+
description: |
1161+
See the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
1162+
for more info.
11531163
11541164
pdb: &pdb-spec
11551165
type: object
@@ -1774,6 +1784,8 @@ properties:
17741784
description: |
17751785
A list of IP CIDR ranges that are allowed to access the load balancer service.
17761786
Defaults to allowing everyone to access it.
1787+
ipFamilyPolicy: *ipFamilyPolicy-spec
1788+
ipFamilies: *ipFamilies-spec
17771789
https:
17781790
type: object
17791791
additionalProperties: false

jupyterhub/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ hub:
4444
appProtocol:
4545
extraPorts: []
4646
loadBalancerIP:
47+
ipFamilyPolicy: ""
48+
ipFamilies: []
4749
baseUrl: /
4850
cookieSecret:
4951
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:
@@ -226,6 +229,10 @@ proxy:
226229
externalIPs:
227230
- 123.123.123.123
228231
- 123.123.123.124
232+
ipFamilyPolicy: DualStack
233+
ipFamilies:
234+
- IPv4
235+
- IPv6
229236
chp:
230237
revisionHistoryLimit: 1
231238
extraCommandLineFlags:

0 commit comments

Comments
 (0)