Skip to content

Commit

Permalink
Merge branch 'kubernetes-sigs:main' into feature-2160-add-images-subc…
Browse files Browse the repository at this point in the history
…ommand
  • Loading branch information
curtbushko authored Aug 3, 2023
2 parents 2adbcd2 + f6964c9 commit eab6fdb
Show file tree
Hide file tree
Showing 216 changed files with 11,558 additions and 2,287 deletions.
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ labels: kind/bug

**What happened**:

<!-- If creating a cluster failed, please run the create cluster command again with the `--retain` flag to prevent cleanup on failure, then run `kind export logs` to dump the cluster logs before cleaning up manually with `kind delete cluster`. Then attach the logs from the path printed by `kind export logs` to this issue as a zip or tarball archive. This will aid us greatly in diagnosing the failure. When `kubeadm init` / `kubeadm join` fail, there are many possible cases and the kubeadm logs typically don't contain enough details vs the full cluster logs. Thanks!-->

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:
**How to reproduce it (as _minimally_ and precisely as possible)**:

**Anything else we need to know?**:

**Environment:**

- kind version: (use `kind version`):
- Kubernetes version: (use `kubectl version`):
- Docker version: (use `docker info`):
- Runtime info: (use `docker info` or `podman info`):
- OS (e.g. from `/etc/os-release`):

- Kubernetes version: (use `kubectl version`):
- Any proxies or other special environment settings?:
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "area/dependency"
- "release-note-none"
- "ok-to-test"
open-pull-requests-limit: 10
19 changes: 11 additions & 8 deletions .github/workflows/cgroup2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ on:
pull_request:
branches:
- main
paths-ignore:
- 'site/**'

permissions:
contents: read

jobs:
docker:
name: Cgroup v2
# nested virtualization is only available on macOS hosts
runs-on: macos-10.15
runs-on: macos-12
timeout-minutes: 30
strategy:
fail-fast: false
Expand All @@ -24,7 +29,7 @@ jobs:
JOB_NAME: "cgroup2-${{ matrix.provider }}-${{ matrix.rootless }}"
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Boot Fedora
run: |
Expand All @@ -42,21 +47,19 @@ jobs:
- name: Set up Rootless Docker
if: ${{ matrix.provider == 'docker' && matrix.rootless == 'rootless' }}
run: |
# Disable SELinux for Rootless Docker, until the following PRs gets merged into Docker CE:
# - https://github.com/moby/moby/pull/42199 ("dockerd-rootless.sh: avoid /run/xtables.lock EACCES on SELinux hosts")
# - https://github.com/moby/moby/pull/42334 ("rootless: disable overlay2 if running with SELinux")
"$HELPER" sudo setenforce 0
# Disable the rootful daemon
"$HELPER" sudo systemctl disable --now docker
# Install the systemd unit
"$HELPER" dockerd-rootless-setuptool.sh install
# Modify the client config to use the rootless daemon by default
"$HELPER" docker context use rootless
- name: Set up Rootless Podman
if: ${{ matrix.provider == 'podman' && matrix.rootless == 'rootless' }}
run: |
# Restart the user session to ensure the cgroup delegation
# ref: https://github.com/kubernetes-sigs/kind/pull/2754#issuecomment-1124027063
"$HELPER" sudo loginctl terminate-user vagrant || true
# We have modprobe ip6_tables in Vagrantfile, but it seems we have to modprobe it once again
"$HELPER" sudo modprobe ip6_tables
Expand Down Expand Up @@ -84,7 +87,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs
11 changes: 8 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- main
paths-ignore:
- 'site/**'

permissions:
contents: read

jobs:
docker:
Expand All @@ -21,14 +26,14 @@ jobs:
IP_FAMILY: ${{ matrix.ipFamily }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install kind
run: sudo make install INSTALL_DIR=/usr/local/bin

- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
Expand Down Expand Up @@ -82,7 +87,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- main
paths-ignore:
- 'site/**'

permissions:
contents: read

jobs:
podman:
Expand All @@ -25,7 +30,7 @@ jobs:
PODMAN_VERSION: "stable"
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0

Expand All @@ -34,7 +39,7 @@ jobs:

- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
Expand Down Expand Up @@ -105,7 +110,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.5
1.20.4
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ REPO_ROOT:=${CURDIR}
OUT_DIR=$(REPO_ROOT)/bin
# record the source commit in the binary, overridable
COMMIT?=$(shell git rev-parse HEAD 2>/dev/null)
# count the commits since the last release
COMMIT_COUNT?=$(shell git describe --tags | rev | cut -d- -f2 | rev)
################################################################################
# ========================= Setup Go With Gimme ================================
# go version to use for build etc.
Expand Down Expand Up @@ -54,7 +56,9 @@ KIND_BINARY_NAME?=kind
# - reproducible builds: -trimpath and -ldflags=-buildid=
# - smaller binaries: -w (trim debugger data, but not panics)
# - metadata: -X=... to bake in git commit
KIND_BUILD_FLAGS?=-trimpath -ldflags="-buildid= -w -X=sigs.k8s.io/kind/pkg/cmd/kind/version.GitCommit=$(COMMIT)"
KIND_VERSION_PKG:=sigs.k8s.io/kind/pkg/cmd/kind/version
KIND_BUILD_LD_FLAGS:=-X=$(KIND_VERSION_PKG).gitCommit=$(COMMIT) -X=$(KIND_VERSION_PKG).gitCommitCount=$(COMMIT_COUNT)
KIND_BUILD_FLAGS?=-trimpath -ldflags="-buildid= -w $(KIND_BUILD_LD_FLAGS)"
################################################################################
# ================================= Building ===================================
# standard "make" target -> builds
Expand Down Expand Up @@ -82,10 +86,8 @@ test:
################################################################################
# ================================= Cleanup ====================================
# standard cleanup target
# TODO: remove the vendor part in the future. We no longer populate vendor
clean:
rm -rf "$(OUT_DIR)/"
rm -rf "$(REPO_ROOT)/vendor/"
################################################################################
# ============================== Auto-Update ===================================
# update generated code, gofmt, etc.
Expand Down
6 changes: 2 additions & 4 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# See the OWNERS docs at https://go.k8s.io/owners

reviewers:
- amwat
- aojea
- BenTheElder
- krzyzacy
- munnerz
- neolit123
approvers:
- amwat
- aojea
- BenTheElder
emeritus_approvers:
- amwat
- munnerz
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
kind is a tool for running local Kubernetes clusters using Docker container "nodes".
kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.

If you have [go] ([1.11+][go-supported]) and [docker] installed `GO111MODULE="on" go get sigs.k8s.io/kind@v0.11.0 && kind create cluster` is all you need!
If you have [go] 1.16+ and [docker] or [podman] installed `go install sigs.k8s.io/kind@v0.20.0 && kind create cluster` is all you need!

![](site/static/images/kind-create-cluster.png)

Expand All @@ -23,12 +23,9 @@ kind bootstraps each "node" with [kubeadm][kubeadm]. For more details see [the d

For a complete [install guide] see [the documentation here][install guide].

You can install kind with `GO111MODULE="on" go get sigs.k8s.io/kind@v0.11.0`.
You can install kind with `go install sigs.k8s.io/kind@v0.20.0`.

**NOTE**: please use the latest go to do this, ideally go 1.13 or greater.

**NOTE**: `go get` should not be run from a Go [modules] enabled project directory,
as go get inside a modules enabled project updates dependencies / behaves differently. Try for example `cd $HOME` first.
**NOTE**: please use the latest go to do this. KIND is developed with the latest stable go, see [`.go-version`](./.go-version) for the exact version we're using.

This will put `kind` in `$(go env GOPATH)/bin`. If you encounter the error
`kind: command not found` after installation then you may need to either add that directory to your `$PATH` as
Expand All @@ -45,9 +42,12 @@ into your `$PATH`:
On Linux:

```console
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.0/kind-$(uname)-amd64"
# For AMD64 / x86_64
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-$(uname)-amd64
# For ARM64
[ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-$(uname)-arm64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind
sudo mv ./kind /usr/local/bin/kind
```

On macOS via Homebrew:
Expand All @@ -65,15 +65,18 @@ sudo port selfupdate && sudo port install kind
On macOS via Bash:

```console
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.10.0/kind-darwin-amd64
# For Intel Macs
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-darwin-amd64
# For M1 / ARM Macs
[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-darwin-arm64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind
```

On Windows:

```powershell
curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.11.0/kind-windows-amd64
curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.20.0/kind-windows-amd64
Move-Item .\kind-windows-amd64.exe c:\some-dir-in-your-PATH\kind.exe
# OR via Chocolatey (https://chocolatey.org/packages/kind)
Expand Down Expand Up @@ -114,7 +117,7 @@ The maintainers of this project are reachable via:
- [filing an issue] against this repo
- The Kubernetes [SIG-Testing Mailing List]

Current maintainers are [@BenTheElder], [@munnerz], [@aojea], and [@amwat] - feel free to
Current maintainers are [@aojea] and [@BenTheElder] - feel free to
reach out if you have any questions!

Pull Requests are very welcome!
Expand All @@ -141,6 +144,7 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
[go]: https://golang.org/
[go-supported]: https://golang.org/doc/devel/release.html#policy
[docker]: https://www.docker.com/
[podman]: https://podman.io/
[community page]: https://kubernetes.io/community/
[Kubernetes Code of Conduct]: code-of-conduct.md
[Go Report Card Badge]: https://goreportcard.com/badge/sigs.k8s.io/kind
Expand All @@ -160,7 +164,7 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
[filing an issue]: https://github.com/kubernetes-sigs/kind/issues/new
[Kubernetes Slack]: http://slack.k8s.io/
[#kind]: https://kubernetes.slack.com/messages/CEKK1KTN2/
[1.0 roadmap]: https://kind.sigs.k8s.io/docs/contributing/1.0-roadmap
[1.0 roadmap]: https://kind.sigs.k8s.io/docs/contributing/1.0-roadmap
[install docker]: https://docs.docker.com/install/
[@BenTheElder]: https://github.com/BenTheElder
[@munnerz]: https://github.com/munnerz
Expand All @@ -169,3 +173,4 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
[contributor guide]: https://kind.sigs.k8s.io/docs/contributing/getting-started
[releases]: https://github.com/kubernetes-sigs/kind/releases
[install guide]: https://kind.sigs.k8s.io/docs/user/quick-start/#installation
[modules]: https://github.com/golang/go/wiki/Modules
4 changes: 2 additions & 2 deletions cmd/kind/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package app

import (
"io/ioutil"
"io"
"os"

"github.com/spf13/pflag"
Expand Down Expand Up @@ -45,7 +45,7 @@ func Run(logger log.Logger, streams cmd.IOStreams, args []string) error {
// if we are in quiet mode, we want to suppress all status output
// only streams.Out should be written to (program output)
logger = log.NoopLogger{}
streams.ErrOut = ioutil.Discard
streams.ErrOut = io.Discard
}
// actually run the command
c := kind.NewCommand(logger, streams)
Expand Down
19 changes: 9 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
module sigs.k8s.io/kind

go 1.14
go 1.16

require (
github.com/BurntSushi/toml v0.3.1
github.com/BurntSushi/toml v1.0.0
github.com/alessio/shellescape v1.4.1
github.com/evanphx/json-patch/v5 v5.2.0
github.com/mattn/go-isatty v0.0.12
github.com/pelletier/go-toml v1.8.1
github.com/evanphx/json-patch/v5 v5.6.0
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2
github.com/mattn/go-isatty v0.0.14
github.com/pelletier/go-toml v1.9.4
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.1.1
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
k8s.io/apimachinery v0.20.2
sigs.k8s.io/yaml v1.2.0
gopkg.in/yaml.v3 v3.0.1
sigs.k8s.io/yaml v1.3.0
)
Loading

0 comments on commit eab6fdb

Please sign in to comment.