-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be5a5b7
commit e69f446
Showing
11 changed files
with
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubernetes |
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 @@ | ||
kubernetes |
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,6 @@ | ||
type = process | ||
env-file = /var/lib/kubernetes/kube-apiserver-flags.env | ||
command = /usr/bin/kube-apiserver | ||
depends-on = network.target | ||
depends-on = local.target | ||
logfile = /var/log/kube-apiserver.log |
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,6 @@ | ||
type = process | ||
env-file = /var/lib/kubernetes/kube-controller-manager-flags.env | ||
command = /usr/bin/kube-controller-manager | ||
depends-on = network.target | ||
depends-on = local.target | ||
logfile = /var/log/kube-controller-manager.log |
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,6 @@ | ||
type = process | ||
env-file = /var/lib/kubernetes/kube-proxy-flags.env | ||
command = /usr/bin/kube-proxy | ||
depends-on = network.target | ||
depends-on = local.target | ||
logfile = /var/log/kube-proxy.log |
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,6 @@ | ||
type = process | ||
env-file = /var/lib/kubernetes/kube-scheduler-flags.env | ||
command = /usr/bin/kube-scheduler | ||
depends-on = network.target | ||
depends-on = local.target | ||
logfile = /var/log/kube-scheduler.log |
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 @@ | ||
type = process | ||
pid-file = /run/kubelet.pid | ||
env-file = /var/lib/kubelet/kubeadm-flags.env | ||
command = /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --cgroup-driver=cgroupfs --config=/var/lib/kubelet/config.yaml | ||
depends-on = network.target | ||
depends-on = local.target | ||
logfile = /var/log/kubelet.log |
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 @@ | ||
br_netfilter |
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 @@ | ||
net.ipv4.ip_forward = 1 |
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 @@ | ||
d /var/lib/kubelet 0755 root root - |
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,106 @@ | ||
pkgname = "kubernetes" | ||
pkgver = "1.31.1" | ||
pkgrel = 0 | ||
build_style = "makefile" | ||
make_env = { | ||
"FORCE_HOST_GO": "y", | ||
} | ||
make_build_env = {"GOLDFLAGS": "-extldflags=-static"} | ||
hostmakedepends = ["bash", "go", "rsync"] | ||
makedepends = [ | ||
"libatomic-chimera-devel-static", | ||
"libunwind-devel-static", | ||
"musl-devel-static", | ||
] | ||
depends = [ | ||
"conntrack-tools", | ||
"cri-tools", | ||
"ethtool", | ||
"iproute2", | ||
"iptables", | ||
"socat", | ||
] | ||
pkgdesc = "Container scheduling and management platform" | ||
maintainer = "tulilirockz <tulilirockz@outlook.com>" | ||
license = "Apache-2.0" | ||
url = "https://kubernetes.io" | ||
source = f"https://github.com/kubernetes/kubernetes/archive/refs/tags/v{pkgver}.tar.gz" | ||
sha256 = "83094915698a9c24f93d1ffda3f17804a4024d3b65eabf681e77a62b35137208" | ||
tool_flags = {"GOFLAGS": ["-buildmode=pie", "-v", "-tags=providerless"]} | ||
# check: depends on networking, cross: needs host binary to generate completions | ||
options = ["!check", "!cross"] | ||
_cli = ["kubeadm", "kubectl"] | ||
_supported_completions = ["bash", "zsh"] | ||
_services = [ | ||
"kube-apiserver", | ||
"kube-controller-manager", | ||
"kube-proxy", | ||
"kube-scheduler", | ||
"kubelet", | ||
] | ||
|
||
|
||
def init_build(self): | ||
from cbuild.util import golang | ||
|
||
self.make_env.update(golang.get_go_env(self)) | ||
|
||
|
||
def post_build(self): | ||
for completion in _supported_completions: | ||
for cli in _cli: | ||
with open(f"{self.cwd}/{cli}.{completion}", "w") as o: | ||
self.do( | ||
f"_output/local/bin/linux/{self.profile().goarch}/{cli}", | ||
"completion", | ||
completion, | ||
stdout=o, | ||
) | ||
|
||
|
||
def install(self): | ||
for binary in [*_cli, *_services]: | ||
with self.pushd("_output/local/go/bin"): | ||
self.install_bin(binary) | ||
for service in _services: | ||
self.install_service(self.files_path / service) | ||
for completion in _supported_completions: | ||
for cli in _cli: | ||
self.install_completion(f"{cli}.{completion}", completion, name=cli) | ||
self.install_file( | ||
self.files_path / "sysctl.conf", | ||
"usr/lib/sysctl.d", | ||
name="30-kubernetes.conf", | ||
) | ||
self.install_file( | ||
self.files_path / "modprobe.conf", | ||
"usr/lib/modprobe.d", | ||
name="99-kubernetes.conf", | ||
) | ||
self.install_tmpfiles(self.files_path / "tmpfiles.conf") | ||
self.install_dir("etc/kubernetes") | ||
|
||
|
||
@subpackage("kubectl") | ||
def _(self): | ||
self.subdesc = "Kubernetes management CLI" | ||
return [ | ||
"usr/bin/kubectl", | ||
"usr/share/zsh/site-functions/_kubectl", | ||
"usr/share/bash-completion/completions/kubectl", | ||
] | ||
|
||
|
||
@subpackage("kubernetes-recommends") | ||
def _(self): | ||
self.depends = [ | ||
"cri-o", | ||
] | ||
self.subdesc = "recommended dependencies" | ||
self.install_if = [self.parent] | ||
self.options = ["empty"] | ||
return [] | ||
|
||
|
||
def post_install(self): | ||
self.install_license("LICENSE") |