-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
103 additions
and
42 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,46 @@ | ||
// 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", | ||
"remoteUser": "root", | ||
|
||
// 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", | ||
|
||
// Install the features based on the software required for Kubernetes development | ||
// https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#installing-required-software | ||
// https://containers.dev/features | ||
"features": { | ||
// The first-run-notice.txt is displayed by a script within | ||
// ghcr.io/devcontainers/features/common-utils:2 | ||
// Although it might be installed by other features, | ||
// we are explicitly installing it to ensure it's included | ||
"ghcr.io/devcontainers/features/common-utils:2": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/python:1": {} | ||
}, | ||
|
||
// Setup the dev container environment | ||
"onCreateCommand": "./.devcontainer/setup.sh", | ||
|
||
// Add etcd & _output/bin path to PATH | ||
"remoteEnv": { | ||
"PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/third_party/etcd:${containerWorkspaceFolder}/_output/bin" | ||
}, | ||
|
||
// Configure the hostRequirements based on the Kubernetes Hardware Requirements | ||
// https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#hardware-requirements | ||
"hostRequirements": { | ||
"memory": "8gb", | ||
"storage": "50gb" | ||
}, | ||
|
||
// for Kubernetes testing, suppress extraneous forwarding messages | ||
"otherPortsAttributes": { | ||
"onAutoForward": "silent" | ||
} | ||
} |
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,34 @@ | ||
👋 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) | ||
🎵 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. | ||
- 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 8-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 found at 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: | ||
$ make | ||
$ KUBETEST2_RUN_DIR=$(pwd)/_output/local/go/bin/ kubetest2 kind -v 2 \ | ||
--build \ | ||
--up \ | ||
--down \ | ||
--test=ginkgo \ | ||
-- \ | ||
--parallel 4 \ | ||
--focus-regex='TTLAfterFinished' | ||
|
||
🔍 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/community/blob/master/contributors/devel/sig-testing/e2e-tests-kubetest2.md and https://github.com/kubernetes-sigs/kubetest2. |