Skip to content

Commit

Permalink
Allow to disable proxy pod and service creation
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Oct 14, 2022
1 parent a7b7227 commit 80838c0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
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

0 comments on commit 80838c0

Please sign in to comment.