Open13
Kubernetesコントリビューション
ピン留めされたアイテム
まずはこれを一通り読む
開発にあたっての基本情報
PRの流れ関連
その他お役立ち情報
- https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md
- https://github.com/kubernetes/community/blob/master/contributors/guide/contributing.md
- https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md
- https://github.com/kubernetes/community/blob/master/contributors/guide/review-guidelines.md
- contextual logging: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md
テスト関連
update & verify
自動生成系はこれでOK
make update
verifyは下記でできる
make verify
ただクッソ時間かかるので基本は↓みたいな感じで必要なやつだけ実行すると良さげ
make verify WHAT="gofmt typecheck"
- issueやPRでのやり取りにおける合意形成した内容を忘れないようにする
- TODO やり取りの際に意図とかをもう少し気軽に確認できるようにしたい
- PRのマージまでは時間がかかることが多いので、それに伴ってrebaseによるコンフリクトも多く発生するが、それは頑張って解消するしかなさそう
kube-cross
TODO: kube-crossの用途
$ docker history --format=json --no-trunc registry.k8s.io/build-image/kube-cross:v1.30.0-go1.22.2-bullseye.0 | jq .
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:57:29+09:00",
"CreatedBy": "ENTRYPOINT []",
"CreatedSince": "2 weeks ago",
"ID": "sha256:2c8b152ffe12eea09eaca5508c32440bf26249c0db2b226c02e6ca73a4311606",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:57:29+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c apt-get -qqy remove wget && apt-get clean && rm -rf -- /var/lib/apt/lists/* # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "594kB"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:57:17+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c for i in {1..5}; do GOPROXY=\"direct\" go install golang.org/x/tools/cmd/cover@latest && break || sleep 15; done && for i in {1..5}; do GOPROXY=\"direct\" go install golang.org/x/tools/cmd/goimports@latest && break || sleep 15; done && go clean -cache # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "186MB"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:50:14+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c mkdir $TMPDIR && chmod a+rwx $TMPDIR && chmod o+t $TMPDIR # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:50:14+09:00",
"CreatedBy": "ENV TMPDIR=/tmp.k8s",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:50:14+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') && if [ ${targetArch} = \"amd64\" ]; then ZIPNAME=\"protoc-${PROTOBUF_VERSION}-linux-x86_64.zip\"; elif [ ${targetArch} = \"arm64\" ]; then ZIPNAME=\"protoc-${PROTOBUF_VERSION}-linux-aarch_64.zip\"; elif [ ${targetArch} = \"ppc64le\" ]; then ZIPNAME=\"protoc-${PROTOBUF_VERSION}-linux-ppcle_64.zip\"; elif [ ${targetArch} = \"s390x\" ]; then ZIPNAME=\"protoc-${PROTOBUF_VERSION}-linux-s390_64.zip\"; fi && mkdir /tmp/protoc && cd /tmp/protoc && wget \"https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${ZIPNAME}\" && unzip \"${ZIPNAME}\" && chmod -R +rX /tmp/protoc && cp -pr bin /usr/local && cp -pr include /usr/local && rm -rf /tmp/protoc && protoc --version # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "8.26MB"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:50:12+09:00",
"CreatedBy": "ENV PROTOBUF_VERSION=23.4",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:50:12+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') && if [ ${targetArch} = \"ppc64le\" ] || [ ${targetArch} = \"s390x\" ]; then echo \"deb http://ports.ubuntu.com/ubuntu-ports/ xenial main\" > /etc/apt/sources.list.d/ports.list && apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 3B4FE6ACC0B21F32 && apt-get update && apt-get install -y build-essential; fi # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:50:12+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') && if [ ${targetArch} = \"arm64\" ]; then echo \"deb http://ports.ubuntu.com/ubuntu-ports/ xenial main\" > /etc/apt/sources.list.d/ports.list && apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 3B4FE6ACC0B21F32 && apt-get update && apt-get install -y build-essential gcc-x86-64-linux-gnu; fi # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "542MB"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:47:50+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') && if [ ${targetArch} = \"amd64\" ]; then echo \"deb http://archive.ubuntu.com/ubuntu xenial main universe\" > /etc/apt/sources.list.d/cgocrosscompiling.list && apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 3B4FE6ACC0B21F32 && apt-get update && apt-get install -y build-essential mingw-w64 && for platform in ${KUBE_DYNAMIC_CROSSPLATFORMS}; do apt-get install -y crossbuild-essential-${platform}; done fi # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:47:49+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c apt-get -q update && apt-get install -qqy apt-utils file jq patch rsync unzip iproute2 # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "35.1MB"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:46:59+09:00",
"CreatedBy": "RUN |2 TARGETPLATFORM=linux/arm64 DEBIAN_FRONTEND=noninteractive /bin/sh -c targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') && if [ ${targetArch} = \"amd64\" ]; then for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done && go clean -cache; fi # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:46:59+09:00",
"CreatedBy": "ENV KUBE_CROSSPLATFORMS=linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x darwin/amd64 windows/amd64 windows/386",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:46:59+09:00",
"CreatedBy": "ENV KUBE_DYNAMIC_CROSSPLATFORMS=arm64 armhf i386 ppc64el s390x",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:46:59+09:00",
"CreatedBy": "ENV GOARM=7",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:46:59+09:00",
"CreatedBy": "ARG DEBIAN_FRONTEND=noninteractive",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-05T01:46:59+09:00",
"CreatedBy": "ARG TARGETPLATFORM",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "WORKDIR /go",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "RUN /bin/sh -c mkdir -p \"$GOPATH/src\" \"$GOPATH/bin\" && chmod -R 1777 \"$GOPATH\" # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "COPY /usr/local/go/ /usr/local/go/ # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "220MB"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "ENV PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "ENV GOPATH=/go",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "ENV GOTOOLCHAIN=local",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "ENV GOLANG_VERSION=1.22.2",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "buildkit.dockerfile.v0",
"CreatedAt": "2024-04-04T01:03:48+09:00",
"CreatedBy": "RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends g++ gcc libc6-dev make pkg-config ; rm -rf /var/lib/apt/lists/* # buildkit",
"CreatedSince": "2 weeks ago",
"ID": "<missing>",
"Size": "209MB"
}
{
"Comment": "",
"CreatedAt": "2024-03-12T10:26:18+09:00",
"CreatedBy": "/bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends git mercurial openssh-client subversion procps ; rm -rf /var/lib/apt/lists/*",
"CreatedSince": "5 weeks ago",
"ID": "<missing>",
"Size": "150MB"
}
{
"Comment": "",
"CreatedAt": "2024-03-12T10:26:03+09:00",
"CreatedBy": "/bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends ca-certificates curl gnupg netbase wget ; rm -rf /var/lib/apt/lists/*",
"CreatedSince": "5 weeks ago",
"ID": "<missing>",
"Size": "28.3MB"
}
{
"Comment": "",
"CreatedAt": "2024-03-12T09:45:44+09:00",
"CreatedBy": "/bin/sh -c #(nop) CMD [\"bash\"]",
"CreatedSince": "5 weeks ago",
"ID": "<missing>",
"Size": "0B"
}
{
"Comment": "",
"CreatedAt": "2024-03-12T09:45:43+09:00",
"CreatedBy": "/bin/sh -c #(nop) ADD file:7cb312b5f676a37f5c3172be6eb95e30986e5da0dcf21985d2176f8a9a037012 in / ",
"CreatedSince": "5 weeks ago",
"ID": "<missing>",
"Size": "118MB"
}
hack
golancilint関連
$ make verify # verify全般実行
$ ./hack/verify-golangci-lint.sh # golangcilint実行
hack/logcheck.conf を更新した場合の反映
$ ./hack/update-golangci-lint-config.sh
stagingディレクトリ以下を変更した場合にvendorに反映する方法
$ ./hack/update-vendor.sh
よく使うコマンド
upstreamの取り込み
$ git fetch upstream
$ git rebase upstream/master
kube-crossコンテナでmakeなどの各種コマンドなどを実行する(ローカルでうまくいかないときに実行する)
$ ./build/run.sh <コマンド>
$ ./build/run.sh make verify
Macでgo installなどがうまくいかない場合
GOOSを指定する
$ GOOS=darwin ./hack/verify-golangci-lint.sh
指定パッケージのユニットテストの実行方法
make test WHAT=pkg/volume/util/
ツール類
Kubernetesプロジェクトに対するコントリビューションが見れるサイト
CNCF所属?のリポジトリのissueを横断的に探せるやつ
devstat(コントリビューション数とか見れるやつ)
prow status(主に自分のPR一覧を見たりprow command探したり)
sig-storage
- https://kubernetes.slack.com/archives/C09QZFCE5
- https://github.com/kubernetes/community/blob/master/sig-storage/README.md
- https://docs.google.com/document/d/1n-dXXvCbHsPfO1yrKwT1qoC80KhsxHYKbRdChdzqeXY/edit
- https://docs.google.com/document/d/1_hvq3nleqQEYatH9V_Gfep39jMzaFJRSN2ioA0PFq-Q/edit#heading=h.3rbq49w08x2v
- https://github.com/orgs/kubernetes-csi/projects/52/views/3
- https://github.com/orgs/kubernetes-csi/projects/70/views/2
- https://github.com/orgs/kubernetes/projects/146/views/1
api-review
複数モジュールに渡るバージョン管理
これでやってるみたい
kubernetes test tarball
ローカル環境でe2eテストを実行する方法
複数モジュール間のバージョン統一管理
zeitgeistというツールを作ってこいつで管理してるとのこと