-
Notifications
You must be signed in to change notification settings - Fork 803
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
.yaml refresher #625
.yaml refresher #625
Conversation
I am a sucker for consistent style, so + 💯 for this! :) Do you want to split this into (many) smaller PRs, roughly one per bullet point maybe? This might reduce the amount of rebasing and trying to keep up with changes to the charts made by others. From experience if there isn't a linter nudging people to stick to a particular style, things drift apart over time. So I'd support an effort to add a linter or somehow automate fixing up the style. |
@betatim thanks for the encouragement! =D I've mostly considered breaking the PR up to make it easier for code review for others. I'm currently trying to figure out how to do things properly for a small amount of .yaml files, when that is done I'll know better how to proceed I think. It might become quite easy to make several PR's for various bullet points if I manage to setup some linter to automate various parts for me. I'll look into linter usage in the kubernetes/charts! |
Research
|
ce39408
to
035bd8f
Compare
Part of PR jupyterhub#625.
01bd1b8
to
a3b09af
Compare
Part of PR jupyterhub#625.
I'm thinking I should document preliminary code conventions for this repo, but not confident on where it would be suitable to document it. Within CONTRIBUTING.md? Suggestions? |
I think it's a good idea! +1 to |
bb6cc2e
to
761f0c8
Compare
Part of PR jupyterhub#625.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this very much! Left some minor comments. Needs testing to make sure we don't break people upgrading from last released version of the chart.
Thank you very much for doing this work! It's important for the long term health of the project!
|
||
It might take a few minutes for it to appear! | ||
|
||
Note that this is still an alpha release! If you have questions, feel free to | ||
1. Come chat with us at https://gitter.im/jupyterhub/jupyterhub | ||
2. File issues at https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues | ||
1. Read the guide at https://z2jh.jupyter.org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this addition!
jupyterhub/templates/_helpers.tpl
Outdated
@@ -0,0 +1,54 @@ | |||
{{- /* | |||
- component: | |||
- A: .componentLabel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand a bit more on the A / B /C and what they mean?
@@ -1,30 +1,32 @@ | |||
apiVersion: extensions/v1beta1 | |||
apiVersion: apps/v1beta2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make sure that upgrading from an older version of the chart continues to work after this change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I wonder how Helm behaves, I figure the old deployment will be deleted fully and then recreated, but it should not be an issue I think.
- Would you suggest we simply test on some deployment as a way to make sure this works before merging?
spec: | ||
podSelector: | ||
matchLabels: | ||
app: jupyterhub | ||
component: singleuser-server | ||
{{- $_ := merge (dict "componentLabel" "singleuser-server") . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand a bit on what this is doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes check out the text I added to #625 (comment) under "Passing merged scopes to templates", it might sometimes be overkill, but often it is a nice practice.
For example, when we had the daemonset template and passed a dictionary with two keys, one key was called "name" and one was called "top", with this technique, you could pass a scope that merges the name
key/value into the current scope/dict and removing the need to utilize .top.Release.Name instead of simply .Release.Name within the helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing @yuvipanda I find it really motivating ❤️
Was made as preparation for [z2jh#625](jupyterhub/zero-to-jupyterhub-k8s#625).
0d1be17
to
a369ce4
Compare
Part of PR jupyterhub#625.
Was made as preparation for [z2jh#625](jupyterhub/zero-to-jupyterhub-k8s#625).
dbb2e70
to
02debad
Compare
@@ -0,0 +1,58 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about using pipenv for that, at least to garentee the reproductibility in ci?
pipenv install yamllint
wget https://github.com/garethr/kubeval/releases/download/0.6.0/kubeval-darwin-amd64.tar.gz
tar xf kubeval-darwin-amd64.tar.gz
cp kubeval $(pipenv --venv)/bin
So that, pipenv run yamllint
or pipenv run kubeval
will always run, inside the ci or in the user's env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks @gsemet for taking time to review! I've a lot to learn regarding execution environments, I'll start by considering this!
My TODO list
- Read up on pipenv and figure out differences with venv and virtualenv.
- Ensure a robust execution environment~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shebang here is already correct. While individuals are free to use pipenv, on CI since we already have an env, pip install
is all that should be used.
@consideRatio I'm excited to get this landed, since it will inevitably conflict with many new PRs and I don't want you to have to spend your whole life rebasing and resolving conflicts! What are the next steps and how can we help get this finished? |
@minrk thanks for the encouragement! I will try to split out some details related to the kubespawners labels that is keeping me from removing WIP. Then, some pre-merge testing would be great since i influence so much code with this! I test this on my cluster but would appreciate if someone else also tried it. It might take a week until that though, im on a climbing vacation without easy access to my linux-computer at home where i code. |
Was made as preparation for [z2jh#625](jupyterhub/zero-to-jupyterhub-k8s#625).
02debad
to
c7a7574
Compare
5750ca1
to
4a728c5
Compare
Beautiful!!! Thanks @consideRatio |
What's left to do on this PR? Just have a few pairs of eyeballs take a look at it? |
this looks great :) |
This is really great! I was able to do a deploy of master and upgrade to this and it all went smoothly (I did have to do My notes: 2018-06-06 Starting from v0.7-f7fa978
config.yaml: hub:
cookieSecret: "..."
proxy:
secretToken: "..."
https:
hosts:
- test-k8s.jovyan.org
letsencrypt:
contactEmail: my@email.com Login and start a user, so that we are doing the upgrade with running users. Upgrade, in zero-to-jupyterhub:
Run the upgrade:
This fails (as expected) because not everything can upgrade with a patch:
Now, re-run upgrade with Success! Verify:
|
Thanks @consideRatio 🎉 ☀️ |
About
The PR's size
Making many separate PRs would have been good for the ability to review them. I had that ambition initially but realized that making many PRs each affecting a lot of files and the same files over and over was hard and I gave up on that, I'm hoping it won't cause too much trouble - sorry in advance!
In this PR
I have aimed make the
.yaml
consistent in various ways.nindent
introduced){{- }}
)include
replacetemplate
)#
vs{{/* */}}
)merge (dict "key1" "val1") .
)helm lint
yamllint
like kubernetes/chartsyamllint
(lint-chart-values.yaml
)kubeval
tools/lint.py
)CONTRIBUTING.md
)Related
Issues and PR's
#538 #622 #624 helm#3811 helm#3470 helm#3837 helm#3854 kubespawner#159 kubespawner#161
Documentation
Refactored from PR