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
Support Dev Containers / Github Codespaces #121561
base: master
Are you sure you want to change the base?
Conversation
Hi @Sharpz7. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
This PR replaces #120551 and addresses the feedback I left in #120551 (review) (adding an owners file) I verified that it works and I was successfully able to build kubernetes. /assign dims cblecker |
and I forgot to lgtm in my last comment 🤦 /lgtm |
LGTM label has been added. Git tree hash: 5a5e75f1eff9969fb9271d0d73c0f9715d7f2951
|
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.
Some questions before we move forward
/hold
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Sharpz7 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@cblecker just a general catch-all for your points. They are all valid, devcontainers is such a wide standard that anything is possible. But, I would argue that things like our own Docker Image, and building kubectl from source, slow down the build significantly. There is a trade-off here between speed, closeness to ground-truth, and number of files (and how many locations those files are in). I think the idea is this would be the initial run, and then we would improve what we do overtime. For now, I think this is mostly okay - you can follow the guides easily. |
@Sharpz7 The tradeoff that I'm considering here is sustainability. I would rather us have something that is slow, but that keeps updated over time as opposed to something that is fast but needs regular maintenance to keep it up to date. I'm all for iterating over time to improve things, but I'd rather it be "hey this always works, but is slow.. maybe we can make it faster" rather than "hey this stopped working.. oh someone needs to go PR in a change to update an image/version/etc to make it useful again". |
Since we are optimising:
|
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.
Attempted to run this and it's failing. The build image is normally wrapped with a bunch of bash to ensure the right variables are passed in.
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.
Using kube-cross
is as simple as pointing to the image in the container registry. The local features are not needed as kube-cross
already has everything except pyyaml.
.devcontainer/local-features/kubectl-kind/devcontainer-feature.json
Outdated
Show resolved
Hide resolved
.devcontainer/local-features/kubetest2/devcontainer-feature.json
Outdated
Show resolved
Hide resolved
I think using https://containers.dev/implementors/json_reference/#variables-in-devcontainerjson might be the way we can configure for the correct go version and Kubernetes version, but I am not sure. Thoughts @craiglpeters ? |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Changelog suggestion -Adds the code/configs to allow for users to use dev-containers when developing k8s. This brings support for GitHub Codespaces, EnvBuilder, the devcontainer-cli and more.
+Added support for using a [devcontainer](https://containers.dev/) when developing Kubernetes. (Markdown works, and we can rely on people to click the link if they want to learn more). |
Hello, I've created a new PR with permission from @craiglpeters . |
Based on: https://github.com/craiglpeters/kubernetes-devcontainer
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support for devcontainers. Right now, it will take a significant amount of time to build - but ideally I would want to also create an image that is built as part of this, maybe in its own repo, that could then be pulled to speed up build times.
Also a wider discussion on whether you would want to support devcontainers all over k8s should probably happen.
kubernetes/test-infra#30454
kubernetes/test-infra#30511 (comment)
Right now, I have added a custom golang install feature that can take advantage of.go-version
being present, but maybe there is a more elegant solution we can use?I tried this and it didn't work - my bet is the devcontainer is being created before the repo is present so the version cannot be found. This means we now have the version stated in two places... not ideal.
Which issue(s) this PR fixes:
Fixes #113019
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/kind feature
/assign @Sharpz7
/sig architecture
/sig contributor-experience
cc @craiglpeters