Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config for k8s Services' ipFamilies and ipFamilyPolicy #3485

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions jupyterhub/templates/hub/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ metadata:
{{- end }}
spec:
type: {{ .Values.hub.service.type }}
{{- with .Values.hub.service.loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
Comment on lines -22 to -24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor: I moved this so it was positioned as it was in the other k8s Service templates

selector:
{{- include "jupyterhub.matchLabels" . | nindent 4 }}
ports:
Expand All @@ -35,3 +32,13 @@ spec:
{{- with .Values.hub.service.extraPorts }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- with .Values.hub.service.loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.hub.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ . }}
{{- end }}
{{- with .Values.hub.service.ipFamilies }}
ipFamilies:
{{- . | toYaml | nindent 4 }}
{{- end }}
7 changes: 7 additions & 0 deletions jupyterhub/templates/proxy/autohttps/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ spec:
ports:
- port: 8000
targetPort: http
{{- with .Values.proxy.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ . }}
{{- end }}
{{- with .Values.proxy.service.ipFamilies }}
ipFamilies:
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions jupyterhub/templates/proxy/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ spec:
{{- with .Values.proxy.service.loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.proxy.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ . }}
{{- end }}
{{- with .Values.proxy.service.ipFamilies }}
ipFamilies:
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- if eq .Values.proxy.service.type "LoadBalancer" }}
{{- with .Values.proxy.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
Expand Down
12 changes: 12 additions & 0 deletions jupyterhub/values.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,16 @@ properties:
A public IP address the hub Kubernetes service should be exposed
on. To expose the hub directly is not recommended. Instead route
traffic through the proxy-public service towards the hub.
ipFamilyPolicy: &ipFamilyPolicy-spec
type: [string]
description: |
See the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
for more info.
ipFamilies: &ipFamilies-spec
type: array
description: |
See the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
for more info.

pdb: &pdb-spec
type: object
Expand Down Expand Up @@ -1744,6 +1754,8 @@ properties:
description: |
A list of IP CIDR ranges that are allowed to access the load balancer service.
Defaults to allowing everyone to access it.
ipFamilyPolicy: *ipFamilyPolicy-spec
ipFamilies: *ipFamilies-spec
https:
type: object
additionalProperties: false
Expand Down
2 changes: 2 additions & 0 deletions jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ hub:
nodePort:
extraPorts: []
loadBalancerIP:
ipFamilyPolicy: ""
ipFamilies: []
baseUrl: /
cookieSecret:
initContainers: []
Expand Down
7 changes: 7 additions & 0 deletions tools/templates/lint-and-validate-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ hub:
- name: dummy-port-2
port: 8182
targetPort: string-named-target-port
ipFamilyPolicy: SingleStack
ipFamilies:
- IPv4
baseUrl: /
activeServerLimit: 3
deploymentStrategy:
Expand Down Expand Up @@ -223,6 +226,10 @@ proxy:
nodePorts:
http:
https:
ipFamilyPolicy: DualStack
ipFamilies:
- IPv4
- IPv6
chp:
revisionHistoryLimit: 1
extraCommandLineFlags:
Expand Down
Loading