Skip to content

cloud-provider-gcp contains several projects used to run Kubernetes in Google Cloud

License

Notifications You must be signed in to change notification settings

gauravkghildiyal/cloud-provider-gcp

This branch is 30 commits behind kubernetes/cloud-provider-gcp:master.

Folders and files

NameName
Last commit message
Last commit date
Jan 23, 2024
Feb 19, 2025
Jan 8, 2025
Feb 28, 2023
May 30, 2024
Feb 22, 2025
Sep 29, 2024
Feb 17, 2025
Feb 18, 2025
Sep 1, 2022
Feb 18, 2025
Feb 18, 2025
Feb 18, 2025
Sep 2, 2022
Dec 23, 2022
Aug 31, 2022
Dec 23, 2022
Feb 3, 2025
May 21, 2024
Jul 19, 2018
Mar 21, 2018
Nov 27, 2024
Feb 5, 2025
Mar 13, 2020
Feb 18, 2025
Jan 27, 2025
Aug 2, 2018
Feb 18, 2025
Feb 18, 2025
Feb 18, 2025
Aug 17, 2023

Repository files navigation

cloud-provider-gcp

Publishing cloud-controller-manager image

This command will build and publish cloud-controller-manager registry.k8s.io/k8s-image-staging/cloud-controller-manager:latest:

bazel run //cmd/cloud-controller-manager:publish

Environment variables IMAGE_REGISTRY, IMAGE_REPO and IMAGE_TAG can be used to override destination GCR repository and tag.

This command will build and publish example.com/my-repo/cloud-controller-manager:v1:

IMAGE_REGISTRY=example.com IMAGE_REPO=my-repo IMAGE_TAG=v1 bazel run //cmd/cloud-controller-manager:publish

Alternatively, you can run push-images tool. The tool is built from ko that does not depend on bazel, for example this command pushes image to Google Artifact Registry under project my-project and existing repository my-repo:

IMAGE_REPO=us-central1-docker.pkg.dev/my-project/my-repo IMAGE_TAG=v0 ./tools/push-images

Cross-compiling

Selecting the target platform is done with the --platforms option with bazel. This command builds release tarballs for Windows:

bazel build --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //release:release-tars

This command explicitly targets Linux as the target platform:

bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //release:release-tars

Dependency management

Dependencies are managed using Go modules (go mod subcommands).

Note that builds are done with Bazel and not the Go tool. Don't follow public Go module docs, instead use instructions in this readme.

Working within GOPATH

If you work within GOPATH, go mod will error out unless you do one of:

  • move repo outside of GOPATH (it should "just work")
  • set env var GO111MODULE=on

Add a new dependency

go get github.com/new/dependency && ./tools/update_vendor.sh

Update an existing dependency

go get -u github.com/existing/dependency && ./tools/update_vendor.sh

Update all dependencies

go get -u && ./tools/update_vendor.sh

Note that this most likely won't work due to cross-dependency issues or repos not implementing modules correctly.

Bazel

Bazel is required to build and release cloud-provider-gcp.

To install:

go get github.com/bazelbuild/bazelisk
alias bazel=bazelisk

To re-generate BUILD files:

tools/update_bazel.sh

Tagging for new cloud-controller-manager versions

To trigger a new image for cloud-controller-manager, you need to add a git tag. This needs to have the format ccm/vX.Y.Z. For example.

git tag -a ccm/v27.1.0 -m "CCM build for Kubernetes v1.27.1"

The major version X corresponds to the Kubernetes minor version. The minor version Y corresponds to the Kubernetes patch version and the patch version Z corresponds to the CCM patch version.

About

cloud-provider-gcp contains several projects used to run Kubernetes in Google Cloud

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 57.6%
  • Shell 32.9%
  • PowerShell 6.6%
  • Starlark 2.5%
  • Makefile 0.2%
  • Dockerfile 0.1%
  • sed 0.1%