Skip to content

Commit

Permalink
gazel
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedanese committed Oct 22, 2016
1 parent 990cfe1 commit 88c1ee2
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@ kubernetes.tar.gz

# This file used by some vendor repos (e.g. github.com/go-openapi/...) to store secret variables and should not be ignored
!\.drone\.sec

/bazel-*
7 changes: 7 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package(default_visibility = ["//visibility:public"])

licenses(["notice"])

load("@io_bazel_rules_go//go:def.bzl", "go_prefix")

go_prefix("k8s.io/kubernetes")
39 changes: 39 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
git_repository(
name = "io_bazel_rules_go",
commit = "e0b19317b39357823b26c7e266596c8066e8f8e6",
remote = "https://github.com/bazelbuild/rules_go.git",
)

load("@io_bazel_rules_go//go:def.bzl", "go_repositories")

go_repositories()

# for building docker base images
debs = (
(
"busybox_deb",
"51651980a993b02c8dc663a5539a4d83704e56c2fed93dd8d1b2580e61319af5",
"http://ftp.us.debian.org/debian/pool/main/b/busybox/busybox-static_1.22.0-19_amd64.deb",
),
(
"libc_deb",
"ee4d9dea08728e2c2bbf43d819c3c7e61798245fab4b983ae910865980f791ad",
"http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.19-18+deb8u6_amd64.deb",
),
(
"iptables_deb",
"7747388a97ba71fede302d70361c81d486770a2024185514c18b5d8eab6aaf4e",
"http://ftp.us.debian.org/debian/pool/main/i/iptables/iptables_1.4.21-2+b1_amd64.deb",
),
(
"iproute2_deb",
"3ce9cb1d03a2a1359cbdd4f863b15d0c906096bf713e8eb688149da2f4e350bc",
"http://ftp.us.debian.org/debian/pool/main/i/iproute2/iproute_3.16.0-2_all.deb",
),
)

[http_file(
name = name,
sha256 = sha256,
url = url,
) for name, sha256, url in debs]
59 changes: 59 additions & 0 deletions build/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package(default_visibility = ["//visibility:public"])

load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")

server_binaries = {
"kube-apiserver": "//cmd/kube-apiserver",
"kube-controller-manager": "//cmd/kube-controller-manager",
"kube-scheduler": "//plugin/cmd/kube-scheduler",
}

docker_build(
name = "busybox",
debs = [
"@busybox_deb//file",
],
symlinks = {
"/bin/sh": "/bin/busybox",
"/usr/bin/busybox": "/bin/busybox",
"/usr/sbin/busybox": "/bin/busybox",
"/sbin/busybox": "/bin/busybox",
},
)

docker_build(
name = "busybox-libc",
base = ":busybox",
debs = [
"@libc_deb//file",
],
)

docker_build(
name = "busybox-net",
base = ":busybox-libc",
debs = [
"@iptables_deb//file",
"@iproute2_deb//file",
],
)

[docker_build(
name = name,
base = ":busybox-libc",
cmd = ["/" + name],
files = [
label,
],
repository = "gcr.io/google-containers",
) for name, label in server_binaries.items()]

docker_build(
name = "kube-proxy",
base = ":busybox-net",
cmd = ["/kube-proxy"],
files = [
"//cmd/kube-proxy",
],
repository = "gcr.io/google-containers",
)
31 changes: 31 additions & 0 deletions cluster/addons/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package(default_visibility = ["//visibility:public"])

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

filegroup(
name = "addon-srcs",
srcs = glob([
"calico-policy-controller/*",
"cluster-loadbalancing/*",
"cluster-monitoring/*",
"dashboard/*",
"dns/*",
"etcd-empty-dir-cleanup/*",
"fluentd-elasticsearch/*",
"fluentd-gcp/*",
"gci/*",
"node-problem-detector/*",
"podsecuritypolicies/*",
"python-image/*",
"registry/*",
]),
)

pkg_tar(
name = "addons",
extension = "tar.gz",
files = [
":addon-srcs",
],
strip_prefix = ".",
)

0 comments on commit 88c1ee2

Please sign in to comment.