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

values.schema.json ships with chart and configuration reference now covers all options #2033

Merged
merged 43 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d05132c
Add FIXME note about userPlaceholder resources
consideRatio Feb 13, 2021
7027dd6
Remove unused hub.publicURL config
consideRatio Feb 13, 2021
230c6bc
Add scheduling.userPlaceholder.resources default value
consideRatio Feb 13, 2021
0d6d8cc
schema: don't require proxy.secretToken
consideRatio Feb 13, 2021
4e6e3ee
schema: remove entry about deprecated schedulerStrategy
consideRatio Feb 13, 2021
e03b247
Add boilerplate schema entries with DESCRIBE ME comments
consideRatio Feb 13, 2021
8bf079a
Specify a specific json schema version
consideRatio Feb 13, 2021
90df806
schema: make root objects required
consideRatio Feb 13, 2021
cd66cf6
schema: refactor type from yaml to json array
consideRatio Feb 13, 2021
e90a185
schema: add resources anchor
consideRatio Feb 13, 2021
4c26b07
schema: add image anchor references
consideRatio Feb 13, 2021
49a11dd
schema: add containerSecurityContext anchors
consideRatio Feb 13, 2021
5990488
schema: add liveness-/readinessProbe anchors
consideRatio Feb 13, 2021
303a3f9
schema: small details iteration
consideRatio Feb 13, 2021
4c7e9e0
schema: worked through several describe me fields
consideRatio Feb 13, 2021
bbe8c13
schema: add cull entry
consideRatio Feb 13, 2021
ca88b75
schema: document global
consideRatio Feb 13, 2021
864b32e
schema: image-puller's pause container
consideRatio Feb 13, 2021
3e8cbf3
schema: all but singleuser.storage remain to describe
consideRatio Feb 13, 2021
a1a0990
schema: initial full manual passthrough of values/schema 1:1 mapping
consideRatio Feb 14, 2021
97e8c50
docs: fix myst syntax about notes
consideRatio Feb 14, 2021
c39f7af
schema: last fixes following script validation
consideRatio Feb 14, 2021
15a61ec
Relocate validate schema script to tools
consideRatio Feb 14, 2021
f51dd2e
Remove misplaced logic from schema validation script
consideRatio Feb 14, 2021
7650379
schema-validation-script: refactor for tools folder
consideRatio Feb 14, 2021
19c4433
schema: add missing entry for hub.uid
consideRatio Feb 14, 2021
906ec1f
tool: add tool to compare schema/values content
consideRatio Feb 14, 2021
8b58e80
tool: add script to generate values.schema.json from schema.yaml
consideRatio Feb 15, 2021
b6619a4
schema: give string / integer not in lists be allowed to be null
consideRatio Feb 15, 2021
9c5ff08
schema: allow null for some but not all values
consideRatio Feb 15, 2021
cf6c8c2
ci: generate values.schema.json and run schema tests
consideRatio Feb 15, 2021
962dc50
tools/ci: don't forget to install pyyaml
consideRatio Feb 15, 2021
1f20b3f
tool: generate-json-schema, emit completion message
consideRatio Feb 15, 2021
4f30f41
schema: fix storageClassName details
consideRatio Feb 15, 2021
5668891
ci: correctly helm lint with lint-and-validate-values.yaml
consideRatio Feb 15, 2021
c525ee8
schema: accept null pullPolicy
consideRatio Feb 15, 2021
d5a5c1e
schema tools: avoid use of os.chdir
consideRatio Feb 15, 2021
d7188a2
docs: handle if/then in schema logic
consideRatio Feb 17, 2021
dbdd49a
microfix: ensure consistent behavior for baseUrl
consideRatio Feb 17, 2021
dfca9b5
schema: require key/cert when proxy.https.type=manual
consideRatio Feb 17, 2021
c1eae4e
values/schema: prefer null strings over blank strings
consideRatio Feb 17, 2021
b76335a
schema: remove too ambitious FIXME
consideRatio Feb 17, 2021
6c2a38a
fix: accept user-placeholder resources
consideRatio Feb 17, 2021
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
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ jobs:
env:
GITHUB_REPOSITORY: "${{ github.repository }}"
run: |
./tools/generate-json-schema.py
./ci/publish
40 changes: 39 additions & 1 deletion .github/workflows/test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
workflow_dispatch:

jobs:
lint_and_validate:
lint_and_validate_rendered_templates:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -50,6 +50,39 @@ jobs:
run: tools/templates/lint-and-validate.py --strict
continue-on-error: true

lint_and_validate_templates_with_schema:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
. ci/common
setup_helm
pip install pyyaml

- name: Generate values.schema.json
run: tools/generate-json-schema.py

- name: Helm lint (values.yaml)
run: helm lint ./jupyterhub

- name: Helm lint (lint-and-validate-values.yaml)
run: helm lint ./jupyterhub --values tools/templates/lint-and-validate-values.yaml

# FIXME: We can probably emit a GitHub workflow warning if these fail
# instead having them show as green without a warning or similar
- name: Helm lint --strict (values.yaml)
run: helm lint --strict ./jupyterhub
continue-on-error: true

- name: Helm lint --strict (lint-and-validate-values.yaml)
run: helm lint --strict ./jupyterhub
continue-on-error: true
consideRatio marked this conversation as resolved.
Show resolved Hide resolved

test:
runs-on: ubuntu-20.04
timeout-minutes: 20
Expand Down Expand Up @@ -138,6 +171,11 @@ jobs:
pip3 install --no-cache-dir -r dev-requirements.txt
chartpress

# Generate values.schema.json from schema.yaml
- name: Generate values.schema.json from schema.yaml
run: |
tools/generate-json-schema.py

# Validate rendered helm templates against the k8s api-server with the
# dedicated lint-and-validate-values.yaml config.
- name: "Helm template --validate (with lint and validate config)"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Zero to JupyterHub Kubernetes ###
jupyterhub/values.schema.json
tools/templates/rendered-templates/
bin/
.vagrant/
Expand Down
2 changes: 1 addition & 1 deletion doc/source/administrator/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource](https://kubernetes.io/docs/concepts/services-networking/ingress/) to
expose JupyterHub using an [Ingress
controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/).

```note
```{note}
Not all k8s clusters are setup with an Ingress controller by default. If you need to
install one manually, we recommend using
[ingress-nginx](https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md#using-helm).
Expand Down
4 changes: 4 additions & 0 deletions doc/source/administrator/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ provides more information on the dangers presented by this attack.
This Helm chart blocks access to this metadata in two ways by default, but you
only need one.

(block-metadata-netpol)=

### Block metadata with a NetworkPolicy enforced by a NetworkPolicy controller

If you have _NetworkPolicy controller_ such as Calico in the Kubernetes cluster,
Expand All @@ -263,6 +265,8 @@ it will enforce the NetworkPolicy resource created by this chart
We recommend relying on this approach if you you had a NetworkPolicy controller,
and then you can disable the other option.

(block-metadata-iptables)=

### Block metadata with a privileged initContainer running `iptables`

If you can't rely on the NetworkPolicy approach to block access to the metadata
Expand Down
3 changes: 3 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def parse_schema(d, md=[], depth=0, pre=""):
Generate markdown headers from a passed python dictionary created by
parsing a schema.yaml file.
"""
if "then" in d:
d = d["then"]

if "properties" in d:
depth += 1
# Create markdown headers for each schema level
Expand Down
1 change: 0 additions & 1 deletion jupyterhub/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# Here are files that we intentionally ignore to avoid them being packaged,
# because we don't want to reference them from our templates anyhow.
schema.yaml
validate.py

# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
Expand Down
Loading