Skip to content

Commit 7d3caa3

Browse files
authored
Merge branch 'main' into pr/add-changelog-for-2.0.0
2 parents d01f3d6 + d9bb67b commit 7d3caa3

File tree

17 files changed

+79
-68
lines changed

17 files changed

+79
-68
lines changed

.github/workflows/vuln-scan.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
# Action reference: https://github.com/aquasecurity/trivy-action
8888
- name: Scan latest published image
8989
id: scan_1
90-
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
90+
uses: aquasecurity/trivy-action@81b9a6f5abb1047d697af7a3ca18c13f55a97315
9191
with:
9292
image-ref: ${{ steps.image.outputs.spec }}
9393
format: json # ref: https://github.com/aquasecurity/trivy#save-the-results-as-json
@@ -110,7 +110,7 @@ jobs:
110110
- name: Scan rebuilt image
111111
id: scan_2
112112
if: steps.rebuild.outcome == 'success'
113-
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
113+
uses: aquasecurity/trivy-action@81b9a6f5abb1047d697af7a3ca18c13f55a97315
114114
with:
115115
image-ref: rebuilt-image
116116
format: json # ref: https://github.com/aquasecurity/trivy#save-the-results-as-json
@@ -169,7 +169,7 @@ jobs:
169169
170170
- name: Describe vulnerabilities
171171
if: steps.rebuild.outcome == 'success'
172-
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
172+
uses: aquasecurity/trivy-action@81b9a6f5abb1047d697af7a3ca18c13f55a97315
173173
with:
174174
image-ref: rebuilt-image
175175
format: table

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
repos:
2222
# Autoformat: Python code, syntax patterns are modernized
2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v2.37.1
24+
rev: v2.37.3
2525
hooks:
2626
- id: pyupgrade
2727
args:

docs/source/administrator/upgrading/upgrade-1-to-2.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Default permissions are mostly unchanged, but a few have:
6666
- Servers' own API tokens have limited permissions by default, which can be expanded by defining the `server` role. The previous behavior was the maximum permission of `inherit`.
6767
- `admin_access` as a concept is removed, so disabling it has no effect. In 2.0, admins by definition can do everything, including access servers. To limit user permissions, assign them to roles which have only the needed permissions.
6868

69+
KubeSpawner has replaced the [`kubernetes`] library with [`kubernetes_asyncio`](https://github.com/tomplus/kubernetes_asyncio).
70+
If you have extended the JupyterHub image and you rely on the kubernetes library you will need to modify your extensions.
71+
6972
See
7073
[Notable dependencies updated](notable-dependencies-200)
7174
for more information on other upgraded hub components.
@@ -75,17 +78,15 @@ for more information on other upgraded hub components.
7578
The default singleuser server is [JupyterLab](https://jupyterlab.readthedocs.io/), running on [Jupyter server](https://jupyter-server.readthedocs.io/en/latest/).
7679
To switch back to Jupyter Notebook either configure/rebuild your singleuser image to default to notebook, or see [the documentation on user interfaces](user-interfaces)
7780

78-
## Default to using the container image's command instead of `jupyterhub-singleuser` [#2449](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/pull/2449)
81+
## KubeSpawner prevents privilege escalation such as sudo by default
7982

80-
Z2JH now launches the container's default command (as set e.g. by `CMD` in a `Dockerfile`) instead of overriding it.
81-
This ensures that containers that use a custom start command to configure their environment, such as some
82-
[Jupyter Docker Stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/)
83-
images, will work without any changes.
84-
To restore the old behaviour set:
83+
By default processes cannot escalate their privileges.
84+
For example, a user cannot use sudo to switch to root.
85+
If you have configured sudo or some other privilege escalation method inside your singleuser image you must set `singleuser.allowPrivilegeEscalation: true`.
8586

8687
```yaml
8788
singleuser:
88-
cmd: jupyterhub-singleuser
89+
allowPrivilegeEscalation: true
8990
```
9091

9192
If you want to add custom arguments to the command, you must specify the full command and any arguments in `singleuser.cmd`, for example:

docs/source/jupyterhub/customizing/user-environment.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ image containing useful tools and libraries for data science, complete these ste
4444
# https://github.com/jupyter/docker-stacks/tree/HEAD/datascience-notebook/Dockerfile
4545
name: jupyter/datascience-notebook
4646
tag: latest
47+
# `cmd: null` allows the custom CMD of the Jupyter docker-stacks to be used
48+
# which performs further customization on startup.
49+
cmd: null
4750
```
4851
4952
```{note}
@@ -244,10 +247,9 @@ FROM jupyter/minimal-notebook:latest
244247
RUN pip install --no-cache-dir astropy
245248

246249
# set the default command of the image,
247-
# if the parent image will not launch a jupyterhub singleuser server.
248-
# The JupyterHub "Docker stacks" do not need to be overridden.
249-
# Set either here or in `singleuser.cmd` in your values.yaml
250-
# CMD ["jupyterhub-singleuser"]
250+
# if you want to launch more complex startup than the default `juptyerhub-singleuser`.
251+
# To launch an image's custom CMD instead of the default `jupyterhub-singleuser`
252+
# set `singleuser.cmd: null` in your config.yaml.
251253
```
252254

253255
```{note}
@@ -529,25 +531,33 @@ this is best done in the ENTRYPOINT of the image,
529531
and not in the CMD, so that overriding the command does not skip your preparation.
530532
```
531533

532-
By default, zero-to-jupyterhub will launch the default CMD that is specified in your chosen image,
533-
respecting any startup customization that image may have.
534-
If the image doesn't launch `jupyterhub-singleuser` by default,
535-
you will additionally need to specify `singleuser.cmd`
536-
in your `values.yaml` as the command to launch,
537-
so that it ultimately launches `jupyterhub-singleuser`.
538-
The simplest version:
534+
By default, zero-to-jupyterhub will launch the command `jupyterhub-singleuser`.
535+
If you have an image (such as `jupyter/scipy-notebook` and other Jupyter Docker stacks)
536+
that defines a CMD with startup customization and ultimately launches `jupyterhub-singleuser`,
537+
you can chose to launch the image's default CMD instead by setting:
539538

540539
```yaml
541540
singleuser:
542-
cmd: jupyterhub-singleuser
541+
cmd: null
543542
```
544543
545-
```{versionchanged} 2.0
546-
Prior to 2.0, the default behavior of zero-to-jupyterhub was to launch `jupyterhub-singleuser` explicitly,
547-
ignoring what was in the image.
548-
The default command is now whatever the image runs by default.
544+
Alternately, you can specify an explicit custom command as a string or list of strings:
545+
546+
```yaml
547+
singleuser:
548+
cmd:
549+
- /usr/local/bin/custom-command
550+
- "--flag"
551+
- "--other-flag"
549552
```
550553
554+
:::{note}
555+
Docker has `ENTRYPOINT` and `CMD`,
556+
which k8s calls `command` and `args`.
557+
zero-to-jupyterhub always respects the ENTRYPOINT of the image,
558+
and setting `singleuser.cmd` only overrides the CMD.
559+
:::
560+
551561
## Disable specific JupyterLab extensions
552562

553563
Sometimes you want to temporarily disable a JupyterLab extension on a JupyterHub

docs/source/jupyterhub/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ can try with `nano config.yaml`.
107107
a different terminal:
108108

109109
```
110-
kubectl get pod --namespace jhub
110+
kubectl get pod --namespace <k8s-namespace>
111111
```
112112

113113
To remain sane we recommend that you enable autocompletion for kubectl

docs/source/kubernetes/microsoft/step-zero-azure-autoscale.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ If you prefer to use the Azure portal see the [Azure Kubernetes Service quicksta
263263
264264
This should take a few minutes and provide you with a working Kubernetes cluster!
265265
266-
9. If you're using the Azure CLI locally, install [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/), a tool
266+
9. If you're using the Azure CLI locally, install [kubectl](https://kubernetes.io/docs/reference/kubectl/), a tool
267267
for accessing the Kubernetes API from the commandline:
268268
269269
```

docs/source/kubernetes/microsoft/step-zero-azure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ If you prefer to use the Azure portal see the [Azure Kubernetes Service quicksta
227227
228228
This should take a few minutes and provide you with a working Kubernetes cluster!
229229
230-
8. If you're using the Azure CLI locally, install [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/), a tool
230+
8. If you're using the Azure CLI locally, install [kubectl](https://kubernetes.io/docs/reference/kubectl/), a tool
231231
for accessing the Kubernetes API from the commandline:
232232
233233
```

docs/source/kubernetes/ovh/step-zero-ovh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(ovh)=
22

3-
# Kubernetes on [OVHcloud](https://www.ovh.ie/) (OVH)
3+
# Kubernetes on [OVHcloud](https://www.ovhcloud.com/) (OVH)
44

5-
[OVHcloud](https://www.ovh.com/) is a leader in the hosted private cloud services space in Europe.
5+
[OVHcloud](https://www.ovhcloud.com/) is a leader in the hosted private cloud services space in Europe.
66

77
They offer a managed Kubernetes service as well as a managed private registry for Docker images.
88

docs/source/resources/community.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ kubectl --namespace=<NAMESPACE> get pod -o <json|yaml|wide|name...>
111111
```
112112

113113
You can find more information on what kinds of output you can generate at
114-
[the kubectl information page](https://kubernetes.io/docs/reference/kubectl/overview/).
114+
[the kubectl information page](https://kubernetes.io/docs/reference/kubectl/).
115115
(click and search for the text "Output Options")
116116

117117
This is a community maintained list of organizations / people using the Zero to

images/network-tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM alpine:3
22

3-
# VULN_SCAN_TIME=2022-04-11_01:44:28
3+
# VULN_SCAN_TIME=2022-07-25_05:26:46
44

55
RUN apk add --no-cache iptables

0 commit comments

Comments
 (0)