Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,42 @@ | ||
// For format details, see https://containers.dev | ||
{ | ||
"name": "Kubernetes environment from dev container", | ||
// Image to pull when not building from scratch. See .devcontainer/build/devcontainer.json | ||
// and .github/devcontainer-build-and-push.yml for the instructions on how this image is built | ||
"image": "registry.k8s.io/build-image/kube-cross:v1.29.0-go1.21.3-bullseye.0", | ||
// Setup the go environment and mount into the dev container at the expected location | ||
"workspaceFolder": "/go/src/k8s.io/kubernetes", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/k8s.io/kubernetes,type=bind,consistency=cached", | ||
// Ensure that the host machine has enough resources to build and test Kubernetes | ||
// "hack/verify-typecheck.sh" test requires more CPUs, ensure you have larger machine type (e.g. 16 cores) to pass this test | ||
"hostRequirements": { | ||
"cpus": 4 | ||
}, | ||
// Copy over welcome message and install pyyaml | ||
"onCreateCommand": "bash .devcontainer/setup.sh", | ||
// for Kubernetes testing, suppress extraneous forwarding messages | ||
"otherPortsAttributes": { | ||
"onAutoForward": "silent" | ||
}, | ||
"remoteUser": "root" | ||
// Configure tool-specific properties. | ||
// "customizations": { | ||
// }, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
"name": "Kubernetes environment from dev container", | ||
|
||
// For details about this image: | ||
// https://github.com/kubernetes/release/tree/master/images/build/cross | ||
"image": "registry.k8s.io/build-image/kube-cross:v1.30.0-go1.22.2-bullseye.0", | ||
|
||
// Setup the go environment and mount into the dev container at the expected location | ||
"workspaceFolder": "/go/src/k8s.io/kubernetes", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/k8s.io/kubernetes,type=bind,consistency=cached", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/python:1": {} | ||
}, | ||
|
||
// Ensure that the host machine has enough resources to build and test Kubernetes | ||
// "hack/verify-typecheck.sh" test requires more CPUs, ensure you have larger machine type (e.g. 16 cores) to pass this test if you use codespaces | ||
// https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#hardware-requirements | ||
"hostRequirements": { | ||
"memory": "8gb", | ||
"storage": "50gb" | ||
}, | ||
|
||
// Copy over welcome message and setup upstream | ||
"onCreateCommand": "./.devcontainer/setup.sh", | ||
|
||
// for Kubernetes testing, suppress extraneous forwarding messages | ||
"otherPortsAttributes": { | ||
"onAutoForward": "silent" | ||
}, | ||
|
||
// Add etcd path to PATH | ||
"remoteEnv": { | ||
"PATH": "${containerEnv:PATH}:${containerEnv:GOPATH}/src/k8s.io/kubernetes/third_party/etcd" | ||
}, | ||
|
||
"remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
👋 Welcome to Kubernetes contribution in a dev container! | ||
Works in GitHub Codespaces, VS Code, or in docker using the devcontainer cli | ||
Works in GitHub Codespaces, VS Code, or in docker using the devcontainer cli. | ||
|
||
See https://www.kubernetes.dev/docs/onboarding/ for guidance on contributing to Kuberentes | ||
See https://www.kubernetes.dev/docs/onboarding/ for guidance on contributing to Kubernetes. | ||
|
||
This debian dev container image satisfies https://github.com/kubernetes/community/blob/master/contributors/devel/development.md and includes: | ||
This dev container environment satisfies the requirements found at https://github.com/kubernetes/community/blob/master/contributors/devel/development.md. and includes: | ||
- kubernetes/kubernetes repository | ||
- Docker | ||
- go | ||
- kubectl, etcd, kubetest2, and kind | ||
For details about dev containers and the debian dev container base image see https://containers.dev and https://github.com/devcontainers/images/tree/main/src/base-debian. | ||
The configuration for the dev container is in the .github/.devcontainer folder. (will be moved to prow) | ||
- Go | ||
- build-essential/rsync/jq/gcloud/PyYAML/etcd | ||
- kind/kubetest2 | ||
|
||
For details about dev containers and the container image, see https://containers.dev and https://github.com/kubernetes/release/tree/master/images/build/cross. | ||
The configuration for the dev container is in the .github/.devcontainer folder. | ||
🎵 By default in Codespaces this environment uses a 4-core machine. Some tests may require a larger machine. In Codespaces you can change the machine type. | ||
See https://docs.github.com/en/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace | ||
|
||
⚙️ If you are working in Codespaces on your own fork, this environment is automatically configured to support the GitHub | ||
workflow https://www.kubernetes.dev/docs/guide/github-workflow/ (omit the clone step) | ||
↪️ Otherwise Codespaces will automatically fork the repository for you when you make your first push | ||
⚙️ If you are working in Codespaces on your own fork, this environment is automatically configured to support the GitHub workflow https://www.kubernetes.dev/docs/guide/github-workflow/. (omit the clone step) | ||
↪️ Otherwise Codespaces will automatically fork the repository for you when you make your first push. | ||
|
||
🔍 To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1). | ||
|
||
🤖 Run e2e test command example: | ||
kubetest2 kind -v 2 \ | ||
--build \ | ||
--up \ | ||
--down \ | ||
--test=ginkgo \ | ||
-- \ | ||
--use-built-binaries \ | ||
--focus-regex='\[Conformance\]' | ||
|
||
🔍 To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1). | ||
For details about kubetest2, see https://github.com/kubernetes-sigs/kubetest2. |