Skip to content

How to build a Go project that relies on kubernetes client using Bazel

Notifications You must be signed in to change notification settings

microclusters/k8s-bazel-go-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

k8s-bazel-go-example

This is a very simple Go client for kubernetes that uses Bazel for builds.

It exists to:

  • be a reliable reference of a combination of repository versions that we know works for building docker Go clients
  • show it can be done. Libraries don't have BUILD.bazel files but they don't need to because bazel's go_repository understands how to build most Go projects.
  • easily reproduce various problems that make k8s.io/client-go unbuildable with Bazel. See the Issues for details.

WORKSPACE

Normally Bazel-friendly repositories wouldn't shipt their own WORKSPACE files, but in this case we're intentionally making it self-contained. You may want to use it as a reference for your own WORKSPACE.

How to build

  1. Install Bazel.build
  2. Run `$ bazel build :kubernetes

The first build will take a very long time because all remote dependencies have to be fetched and build. But repeated builds should be very fast.

This is going to get stale over time

PRs for updating the repository commits to known-working are welcomed.

See also

About

How to build a Go project that relies on kubernetes client using Bazel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published