Skip to content

Commit 10b21e7

Browse files
authored
Merge pull request #3485 from mike-matera/main
Add config for k8s Services' `ipFamilies` and `ipFamilyPolicy`
2 parents 82891d3 + 1ccab70 commit 10b21e7

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ spec:
7575
{{- with .Values.proxy.service.loadBalancerIP }}
7676
loadBalancerIP: {{ . }}
7777
{{- end }}
78+
{{- with .Values.proxy.service.ipFamilyPolicy }}
79+
ipFamilyPolicy: {{ . }}
80+
{{- end }}
81+
{{- with .Values.proxy.service.ipFamilies }}
82+
ipFamilies:
83+
{{- . | toYaml | nindent 4 }}
84+
{{- end }}
7885
{{- if eq .Values.proxy.service.type "LoadBalancer" }}
7986
{{- with .Values.proxy.service.loadBalancerSourceRanges }}
8087
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: 4 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: []
@@ -199,6 +201,8 @@ proxy:
199201
externalIPs: []
200202
loadBalancerIP:
201203
loadBalancerSourceRanges: []
204+
ipFamilyPolicy: ""
205+
ipFamilies: []
202206
# chp relates to the proxy pod, which is responsible for routing traffic based
203207
# on dynamic configuration sent from JupyterHub to CHP's REST API.
204208
chp:

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)