mirror of https://github.com/kubernetes/kops.git
add support for devcontainer
This commit is contained in:
parent
0300a3b858
commit
86d5fb595f
|
@ -0,0 +1,26 @@
|
|||
// For format details, see https://containers.dev
|
||||
{
|
||||
"name": "Kops 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/kops",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/k8s.io/kops,type=bind,consistency=cached",
|
||||
// Ensure that the host machine has enough resources to build and test Kops
|
||||
"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": [],
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2023 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eux
|
||||
|
||||
# Copies over welcome message
|
||||
cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
|
||||
|
||||
git remote add upstream https://github.com/kubernetes/kops.git
|
||||
# Never push to upstream master
|
||||
git remote set-url --push upstream no_push
|
|
@ -0,0 +1,20 @@
|
|||
👋 Welcome to Kops contribution in a dev container!
|
||||
Works in GitHub Codespaces, VS Code, or in docker using the devcontainer cli
|
||||
|
||||
See https://kops.sigs.k8s.io/contributing/ for guidance on contributing to Kops
|
||||
|
||||
This debian dev container image satisfies 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.
|
||||
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
|
||||
|
||||
🔍 To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1).
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
# Vscode files
|
||||
.vscode
|
||||
.devcontainer
|
||||
|
||||
# Emacs save files
|
||||
*~
|
||||
|
|
Loading…
Reference in New Issue