Skip to content
Merged
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
4 changes: 4 additions & 0 deletions charts/jupyterhub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ user pods, optional user PVCs, Gateway API, Ingress, dual-stack Service,
NetworkPolicy, ExternalSecret, ServiceMonitor, PodDisruptionBudget, schema, and
Helm tests.

NetworkPolicy supports `networkPolicy.extraEgress` for appending Hub egress
rules without replacing the default DNS, HTTPS, same-namespace, and
`networkPolicy.hub.egress` rules.

## Install

```bash
Expand Down
17 changes: 9 additions & 8 deletions charts/jupyterhub/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{{/* SPDX-License-Identifier: Apache-2.0 */}}
JupyterHub deployed successfully!

ACCESS:
1. Access
kubectl port-forward svc/{{ include "jupyterhub.proxyName" . }} -n {{ .Release.Namespace }} 8080:{{ .Values.service.port }}
Open: http://localhost:8080{{ .Values.hub.baseUrl }}

SERVICES:
2. Services
Proxy: {{ include "jupyterhub.proxyName" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
Proxy API: {{ include "jupyterhub.proxyApiName" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.proxyApiPort }}
Hub: {{ include "jupyterhub.hubName" . }}.{{ .Release.Namespace }}.svc.cluster.local:8081

AUTHENTICATION:
3. Authentication
Auth type: {{ .Values.auth.type }}
{{- if and (eq .Values.auth.type "dummy") (not .Values.auth.dummyPassword) }}
Dummy password: empty
{{- else if eq .Values.auth.type "dummy" }}
Dummy password: configured
{{- end }}

PERSISTENCE:
4. Persistence
{{- if .Values.hub.persistence.enabled }}
Hub PVC: {{ include "jupyterhub.hubDataClaimName" . }}
{{- else }}
Expand All @@ -30,7 +30,7 @@ PERSISTENCE:
Single-user PVCs: disabled
{{- end }}

NETWORKING:
5. Networking
{{- if .Values.ingress.enabled }}
Ingress: enabled
Class: {{ .Values.ingress.ingressClassName | default "(cluster default)" }}
Expand All @@ -43,21 +43,22 @@ NETWORKING:
{{- else }}
Gateway API: disabled
{{- end }}
NetworkPolicy: {{ ternary "enabled" "disabled" .Values.networkPolicy.enabled }}

OPERATIONS:
6. Operations
Run Helm tests:
helm test {{ .Release.Name }} -n {{ .Release.Namespace }}

Inspect pods:
kubectl get pods -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
kubectl logs -n {{ .Release.Namespace }} deploy/{{ include "jupyterhub.hubName" . }}

SECURITY REMINDERS:
7. Security Reminders
1. Do not expose DummyAuthenticator publicly without auth.dummyPassword.
2. Use a real authenticator through hub.extraConfig for production.
3. Keep the proxy token in an existing Secret or ExternalSecret for GitOps.

DOCUMENTATION:
8. Documentation
Chart: https://helmforge.dev/docs/charts/jupyterhub
Source: https://github.com/helmforgedev/charts/tree/main/charts/jupyterhub
JupyterHub: https://jupyter.org/hub
Expand Down
2 changes: 1 addition & 1 deletion charts/jupyterhub/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
port: 443
- to:
- podSelector: {}
{{- with .Values.networkPolicy.hub.egress }}
{{- with (concat .Values.networkPolicy.hub.egress .Values.networkPolicy.extraEgress) }}
{{- toYaml . | nindent 4 }}
{{- end }}
---
Expand Down
10 changes: 10 additions & 0 deletions charts/jupyterhub/tests/networkpolicy-extra-egress-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
networkPolicy:
enabled: true
extraEgress:
- to:
- ipBlock:
cidr: 10.60.0.0/16
ports:
- protocol: TCP
port: 443
15 changes: 15 additions & 0 deletions charts/jupyterhub/tests/networkpolicy_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,18 @@ tests:
- protocol: TCP
port: 5432
documentIndex: 1

- it: should append extra Hub egress rules
values:
- networkpolicy-extra-egress-values.yaml
asserts:
- contains:
path: spec.egress
content:
to:
- ipBlock:
cidr: 10.60.0.0/16
ports:
- protocol: TCP
port: 443
documentIndex: 1
10 changes: 9 additions & 1 deletion charts/jupyterhub/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@
}
},
"gateway": { "type": "object", "additionalProperties": true },
"networkPolicy": { "type": "object", "additionalProperties": true },
"networkPolicy": {
"type": "object",
"additionalProperties": true,
"properties": {
"enabled": { "type": "boolean" },
"hub": { "type": "object", "additionalProperties": true },
"extraEgress": { "type": "array", "items": { "type": "object" } }
}
},
"serviceAccount": { "type": "object", "additionalProperties": true },
"rbac": { "type": "object", "additionalProperties": true },
"metrics": {
Expand Down
2 changes: 2 additions & 0 deletions charts/jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ networkPolicy:
hub:
# -- Additional Hub egress rules appended after the default DNS, HTTPS, and same-namespace rules. Use this for external PostgreSQL/MySQL databases or private endpoints.
egress: []
# -- Additional Hub egress rules appended after networkPolicy.hub.egress.
extraEgress: []

serviceAccount:
# -- Create a dedicated ServiceAccount.
Expand Down