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

Allow to disable proxy pod and service creation #2904

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions jupyterhub/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,12 @@ properties:
type: object
additionalProperties: false
properties:
enabled:
type: boolean
description: |
Default `true`.

If `false`, disables proxy pod and service creation. Can be used with some existing external proxy, or with kubespawner.proxy.KubeIngressProxy class
chp:
type: object
additionalProperties: false
Expand Down
6 changes: 6 additions & 0 deletions jupyterhub/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
kubectl --namespace={{ .Release.Namespace }} logs --previous <name of pod>
{{- println }}

{{- if .Values.proxy.enabled }}
{{- if eq .Values.proxy.service.type "LoadBalancer" }}
- Verify an external IP is provided for the k8s Service {{ $proxy_service }}.

Expand Down Expand Up @@ -84,6 +85,11 @@

Try insecure HTTP access: http://localhost:8080
{{- end }}
{{- end }}
You disabled proxy pod and service creation. This means that your proxy should be set up manually.

Please follow documentation of
current proxy class (see c.Jupyterhub.proxy_class setting), e.g. KubeIngressProxy
{{- end }}
{{- println }}

Expand Down
3 changes: 3 additions & 0 deletions jupyterhub/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $enabled := .Values.proxy.enabled -}}
{{- if $enabled }}
{{- $manualHTTPS := and .Values.proxy.https.enabled (eq .Values.proxy.https.type "manual") -}}
{{- $manualHTTPSwithsecret := and .Values.proxy.https.enabled (eq .Values.proxy.https.type "secret") -}}
apiVersion: apps/v1
Expand Down Expand Up @@ -176,3 +178,4 @@ spec:
{{- with .Values.proxy.chp.extraPodSpec }}
{{- . | toYaml | nindent 6 }}
{{- end }}
{{- end }}
15 changes: 9 additions & 6 deletions jupyterhub/templates/proxy/service.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{- $enabled := .Values.proxy.https.enabled -}}
{{- $autoHTTPS := and $enabled (and (eq .Values.proxy.https.type "letsencrypt") .Values.proxy.https.hosts) -}}
{{- $manualHTTPS := and $enabled (eq .Values.proxy.https.type "manual") -}}
{{- $manualHTTPSwithsecret := and $enabled (eq .Values.proxy.https.type "secret") -}}
{{- $offloadHTTPS := and $enabled (eq .Values.proxy.https.type "offload") -}}
{{- $enabled := .Values.proxy.enabled -}}
{{- if $enabled }}
{{- $httpsEnabled := .Values.proxy.https.enabled -}}
{{- $autoHTTPS := and $httpsEnabled (and (eq .Values.proxy.https.type "letsencrypt") .Values.proxy.https.hosts) -}}
{{- $manualHTTPS := and $httpsEnabled (eq .Values.proxy.https.type "manual") -}}
{{- $manualHTTPSwithsecret := and $httpsEnabled (eq .Values.proxy.https.type "secret") -}}
{{- $offloadHTTPS := and $httpsEnabled (eq .Values.proxy.https.type "offload") -}}
{{- $valid := or $autoHTTPS (or $manualHTTPS (or $manualHTTPSwithsecret $offloadHTTPS)) -}}
{{- $HTTPS := and $enabled $valid -}}
{{- $HTTPS := and $httpsEnabled $valid -}}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -78,3 +80,4 @@ spec:
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ rbac:
# proxy relates to the proxy pod, the proxy-public service, and the autohttps
# pod and proxy-http service.
proxy:
enabled: true
secretToken:
annotations: {}
deploymentStrategy:
Expand Down
1 change: 1 addition & 0 deletions tools/templates/lint-and-validate-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ rbac:
create: true

proxy:
enabled: true
service:
extraPorts:
- name: ssh
Expand Down