forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel: build debs for kubelet and kubeadm
- Loading branch information
1 parent
3479522
commit caa4a43
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar", "pkg_deb") | ||
load("@io_kubernetes_build//defs:deb.bzl", "k8s_deb", "deb_data") | ||
|
||
filegroup( | ||
name = "debs", | ||
srcs = [ | ||
":kubeadm.deb", | ||
":kubectl.deb", | ||
":kubelet.deb", | ||
":kubernetes-cni.deb", | ||
], | ||
) | ||
|
||
deb_data( | ||
name = "kubectl", | ||
data = [ | ||
{ | ||
"files": ["//cmd/kubectl"], | ||
"mode": "0755", | ||
"dir": "/usr/bin", | ||
}, | ||
], | ||
) | ||
|
||
deb_data( | ||
name = "kubelet", | ||
data = [ | ||
{ | ||
"files": ["//cmd/kubelet"], | ||
"mode": "0755", | ||
"dir": "/usr/bin", | ||
}, | ||
{ | ||
"files": ["kubelet.service"], | ||
"mode": "644", | ||
"dir": "/lib/systemd/system", | ||
}, | ||
], | ||
) | ||
|
||
deb_data( | ||
name = "kubeadm", | ||
data = [ | ||
{ | ||
"files": ["//cmd/kubeadm"], | ||
"mode": "0755", | ||
"dir": "/usr/bin", | ||
}, | ||
{ | ||
"files": ["kubeadm-10.conf"], | ||
"mode": "644", | ||
"dir": "/etc/systemd/system/kubelet.service.d", | ||
}, | ||
], | ||
) | ||
|
||
pkg_tar( | ||
name = "kubernetes-cni-data", | ||
package_dir = "/opt/cni", | ||
deps = ["@kubernetes_cni//file"], | ||
) | ||
|
||
k8s_deb( | ||
name = "kubectl", | ||
description = """Kubernetes Command Line Tool | ||
The Kubernetes command line tool for interacting with the Kubernetes API. | ||
""", | ||
) | ||
|
||
k8s_deb( | ||
name = "kubelet", | ||
depends = [ | ||
"iptables (>= 1.4.21)", | ||
"kubernetes-cni (>= 0.3.0.1)", | ||
"iproute2", | ||
"socat", | ||
"util-linux", | ||
"mount", | ||
"ebtables", | ||
"ethtool", | ||
], | ||
description = """Kubernetes Node Agent | ||
The node agent of Kubernetes, the container cluster manager | ||
""", | ||
) | ||
|
||
k8s_deb( | ||
name = "kubeadm", | ||
depends = [ | ||
"kubelet (>= 1.4.0)", | ||
"kubectl (>= 1.4.0)", | ||
], | ||
description = """Kubernetes Cluster Bootstrapping Tool | ||
The Kubernetes command line tool for bootstrapping a Kubernetes cluster. | ||
""", | ||
) | ||
|
||
k8s_deb( | ||
name = "kubernetes-cni", | ||
description = """Kubernetes Packaging of CNI | ||
The Container Networking Interface tools for provisioning container networks. | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Service] | ||
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true" | ||
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true" | ||
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin" | ||
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local" | ||
ExecStart= | ||
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_EXTRA_ARGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=kubelet: The Kubernetes Node Agent | ||
Documentation=http://kubernetes.io/docs/ | ||
|
||
[Service] | ||
ExecStart=/usr/bin/kubelet | ||
Restart=always | ||
StartLimitInterval=0 | ||
RestartSec=10 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |