k3s/build/debs/BUILD

271 lines
6.7 KiB
Python
Raw Normal View History

package(default_visibility = ["//visibility:public"])
load("@io_k8s_repo_infra//defs:deb.bzl", "deb_data", "k8s_deb")
load("@io_k8s_repo_infra//defs:build.bzl", "release_filegroup")
load("@io_k8s_repo_infra//defs:pkg.bzl", "pkg_tar")
load(
"//build:platforms.bzl",
"CLIENT_PLATFORMS",
"NODE_PLATFORMS",
"SERVER_PLATFORMS",
"for_platforms",
)
load("//build:workspace.bzl", "CNI_VERSION", "CRI_TOOLS_VERSION")
2017-01-04 22:14:02 +00:00
# We do not include kube-scheduler, kube-controller-manager,
# kube-apiserver, and kube-proxy in this list even though we
# produce debs for them. We recommend that they be run in docker
# images. We use the debs that we produce here to build those
# images.
2017-04-28 19:38:27 +00:00
release_filegroup(
name = "debs",
conditioned_srcs = for_platforms(
default = [],
for_client = [":kubectl-{ARCH}.deb"],
for_node = [
":cri-tools-{ARCH}.deb",
":kubeadm-{ARCH}.deb",
":kubelet-{ARCH}.deb",
":kubernetes-cni-{ARCH}.deb",
],
only_os = "linux",
),
)
# Create aliases from the non-arch names to the arch-specific names for backwards compatibility
alias(
name = "kubectl",
actual = select(for_platforms(
for_client = ":kubectl-{ARCH}",
only_os = "linux",
)),
)
[alias(
name = pkg,
actual = select(for_platforms(
for_node = ":%s-{ARCH}" % pkg,
only_os = "linux",
)),
) for pkg in [
"cri-tools",
"kubeadm",
"kubelet",
"kubernetes-cni",
]]
2017-01-04 22:14:02 +00:00
[deb_data(
name = "kubectl",
2017-01-04 22:14:02 +00:00
data = [
{
"files": ["//cmd/kubectl"],
2017-01-04 22:14:02 +00:00
"mode": "0755",
"dir": "/usr/bin",
},
],
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
) for arch in CLIENT_PLATFORMS["linux"]]
2017-01-04 22:14:02 +00:00
[[deb_data(
name = binary,
data = [
{
"files": ["//cmd/" + binary],
"mode": "0755",
"dir": "/usr/bin",
},
],
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
) for binary in [
"cloud-controller-manager",
"kube-apiserver",
"kube-controller-manager",
"kube-proxy",
"kube-scheduler",
]] for arch in SERVER_PLATFORMS["linux"]]
[deb_data(
name = "kubelet",
data = [
{
"files": ["//cmd/kubelet"],
"mode": "0755",
"dir": "/usr/bin",
},
{
"files": ["kubelet.service"],
"mode": "644",
"dir": "/lib/systemd/system",
},
],
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
) for arch in NODE_PLATFORMS["linux"]]
[deb_data(
name = "kubeadm",
data = [
{
"files": ["//cmd/kubeadm"],
"mode": "0755",
"dir": "/usr/bin",
},
{
"files": ["10-kubeadm.conf"],
"mode": "644",
"dir": "/etc/systemd/system/kubelet.service.d",
},
2018-10-25 15:57:24 +00:00
{
"files": ["kubeadm.conf"],
"mode": "644",
"dir": "/usr/lib/modules-load.d",
},
{
"files": ["50-kubeadm.conf"],
"mode": "644",
"dir": "/etc/sysctl.d",
},
],
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
) for arch in NODE_PLATFORMS["linux"]]
[pkg_tar(
name = "kubernetes-cni-data-%s" % goarch,
2017-10-25 15:17:38 +00:00
package_dir = "/opt/cni/bin",
2019-02-12 00:12:23 +00:00
tags = ["manual"],
deps = ["@kubernetes_cni_%s//file" % goarch],
) for goarch in NODE_PLATFORMS["linux"]]
[pkg_tar(
name = "cri-tools-data-%s" % goarch,
package_dir = "/usr/bin",
2019-02-12 00:12:23 +00:00
tags = ["manual"],
deps = ["@cri_tools_%s//file" % goarch],
) for goarch in NODE_PLATFORMS["linux"]]
[k8s_deb(
name = "cloud-controller-manager",
description = "Kubernetes Cloud Controller Manager",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in SERVER_PLATFORMS["linux"]]
[k8s_deb(
name = "kubectl",
description = """Kubernetes Command Line Tool
The Kubernetes command line tool for interacting with the Kubernetes API.
""",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in CLIENT_PLATFORMS["linux"]]
[k8s_deb(
2017-01-04 22:14:02 +00:00
name = "kube-apiserver",
description = "Kubernetes API Server",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in SERVER_PLATFORMS["linux"]]
2017-01-04 22:14:02 +00:00
[k8s_deb(
2017-01-04 22:14:02 +00:00
name = "kube-controller-manager",
description = "Kubernetes Controller Manager",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in SERVER_PLATFORMS["linux"]]
2017-01-04 22:14:02 +00:00
[k8s_deb(
2017-01-04 22:14:02 +00:00
name = "kube-scheduler",
description = "Kubernetes Scheduler",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in SERVER_PLATFORMS["linux"]]
2017-01-04 22:14:02 +00:00
[k8s_deb(
2017-01-04 22:14:02 +00:00
name = "kube-proxy",
depends = [
"iptables (>= 1.4.21)",
"iproute2",
],
description = "Kubernetes Service Proxy",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in NODE_PLATFORMS["linux"]]
2017-01-04 22:14:02 +00:00
[k8s_deb(
name = "kubelet",
depends = [
"conntrack",
"ebtables",
"ethtool",
"iproute2",
"iptables (>= 1.4.21)",
"kubernetes-cni (>= %s)" % CNI_VERSION,
"mount",
"socat",
"util-linux",
],
description = """Kubernetes Node Agent
The node agent of Kubernetes, the container cluster manager
""",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in NODE_PLATFORMS["linux"]]
[k8s_deb(
name = "kubeadm",
depends = [
"kubelet (>= 1.8.0)",
"kubectl (>= 1.8.0)",
"kubernetes-cni (>= %s)" % CNI_VERSION,
"cri-tools (>= 1.11.0)",
],
description = """Kubernetes Cluster Bootstrapping Tool
The Kubernetes command line tool for bootstrapping a Kubernetes cluster.
""",
goarch = arch,
postinst = "postinst",
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version_file = "//build:os_package_version",
) for arch in NODE_PLATFORMS["linux"]]
[k8s_deb(
name = "kubernetes-cni",
description = """Kubernetes Packaging of CNI
The Container Networking Interface tools for provisioning container networks.
""",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version = CNI_VERSION,
) for arch in NODE_PLATFORMS["linux"]]
2017-01-03 22:40:41 +00:00
[k8s_deb(
name = "cri-tools",
description = """Container Runtime Interface tools (crictl)""",
goarch = arch,
2019-02-12 00:12:23 +00:00
tags = ["manual"],
version = CRI_TOOLS_VERSION,
) for arch in NODE_PLATFORMS["linux"]]
2017-01-03 22:40:41 +00:00
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)