-
Notifications
You must be signed in to change notification settings - Fork 345
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
[docs][chuck] Example YAML generation using ksonnet and kubecfg #58
Conversation
Oh I also updated docs accordingly, let me know if you have any changes in mind. |
Makefile
Outdated
# Note the only reason we are creating this is because upstream | ||
# does not yet publish a released e2e container | ||
# https://github.com/kubernetes/kubernetes/issues/47920 | ||
|
||
EXAMPLE_FILES = $(wildcard examples/ksonnet/components/*.jsonnet) | ||
EXAMPLE_OUTPUT = examples/quickstart/aggregate.yaml $(patsubst examples/ksonnet/components/%.jsonnet,examples/quickstart/components/%.yaml,$(EXAMPLE_FILES)) | ||
KSONNET_BUILD_IMAGE = ksonnet:test # TODO: CHANGE ONCE NEW KSONNET IMAGE IS PUSHED |
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.
reminder to self
local configmaps = import "examples/ksonnet/components/10-configmaps.jsonnet"; | ||
local pod = import "examples/ksonnet/components/20-pod.jsonnet"; | ||
|
||
rbac + configmaps + pod |
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.
does kubecfg take a k8s v1.List object and turn it into ---
delimited yaml objects? :mindblown:
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.
heh I was so pleasantly surprised with all of kubecfg's functionality
README.md
Outdated
@@ -32,19 +32,31 @@ This guide executes a Sonobuoy run on your cluster, and records the following re | |||
|
|||
* *You should have `kubectl` installed.* If not, follow the instructions for [installing via Homebrew (MacOS)][6] or [building the binary (Linux)][7]. | |||
|
|||
* *You should have `docker` installed (minimum 17.05).* Docker images are used to generate the YAML examples, based on your cluster's RBAC settings. |
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.
Why the 17.05 requirement?
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.
@ncdc I saw that on Docker multi-stage build page (https://docs.docker.com/engine/userguide/eng-image/multistage-build/), but if that version is a potential blocker for folks, I can repurpose the Dockerfile?
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.
err clarification: the Dockerfile for ksonnet
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.
Oh, you're doing multistage builds. I know Fedora's newest is 1.13 (still on the previous versioning scheme). Might be an issue.
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 ok, thanks for the heads up---the ksonnet PR is on hold til Alex gets back tomorrow, but if I finish the Ark PR, I'll come back and try to take out that dependency
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're not doing multi-stage builds yet, please remove the requirement.
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 my bad -- the 17.05 req is for building images, not running them. The ksonnet image has a multi-stage build but since we're pulling from a public image registry it should be fine. I'll remove this.
Were you able to test the quickstart files without RBAC enabled? |
@chuckha yup I disabled RBAC, sonobuoy worked fine (as long as I didn't include the manifests for RBAC components). |
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.
This looks good to me!
@abiogenesis-now please rebase and we can go ahead and merge. |
will rebase soon! |
@timothysc @kensimon rebased, but |
Looks like the For your screenshot, I'd need more context for that error, a 409 happens when you're uploading something twice. |
👍 let me know if it's easier/simpler to somehow rename this remote branch (is that possible without having to recreate the PR?) thanks! Will try to dig up some more useful logs |
run tests |
Bah, I hit the "Update branch" button in github hoping it would give me an option to rebase, but it created a merge commit (which breaks the signoff checker.) @abiogenesis-now could you rebase? |
👍 can do, also making some small docs revisions so please hold also I'm no longer encountering the 409 error I screenshotted above--I'm not sure if I accidentally had too many sonobuoy instances running (???) from improper cleanup or some such thing. Confirmed that this code works on my quickstart cluster and my non-RBAC cluster. |
Closes issue #5. - Adds jsonnet to generate the quickstart examples - Removes the YAML - Adds the generated JSON - Docs are updated to reflect JSON files vs YAML - Adds a Makefile target, `generate-examples` Signed-off-by: Chuck Ha <[email protected]>
Signed-off-by: Jessica Yao <[email protected]>
@kensimon This is done on my end, feel free to merge if it looks good to you and the build passes! |
[docs][chuck] Example YAML generation using ksonnet and kubecfg Signed-off-by: Jesse Hamilton [email protected]
[docs][chuck] Example YAML generation using ksonnet and kubecfg Signed-off-by: Jesse Hamilton [email protected] Signed-off-by: Jesse Hamilton [email protected]
This is heavily based off of @chuckha 's PR #52. (See the latest commit for the changes that I made).
cc @timothysc @kensimon PTAL
It is dependent on the pending merge of another PR I made yesterday (ksonnet/ksonnet-lib#67), which adds
kubecfg
to theksonnet-lib
Docker image. (The new image will also need to be pushed to the public registry).This PR incorporates that new
kubecfg
functionality to:$RBAC_ENABLED
) to determine if RBAC resource definitions should be included in the generated YAML files.It also fixes some minor bugs from Chuck's commit, and I have confirmed that it works on clusters with and without RBAC apigroups enabled.