Skip to content

Commit

Permalink
Add CNI plugins and helm binary to torcx package
Browse files Browse the repository at this point in the history
  • Loading branch information
mback2k committed Jan 23, 2021
1 parent 72e064e commit 334a10b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
build: torcx.tgz torcx.squashfs


cni.tar.gz:
wget -q https://github.com/containernetworking/plugins/releases/download/v0.9.0/cni-plugins-linux-amd64-v0.9.0.tgz -O cni.tar.gz

cni: cni.tar.gz
mkdir -p rootfs/opt/cni/bin
tar -zxf cni.tar.gz -C rootfs/opt/cni/bin/


kube-node.tar.gz:
wget -q https://dl.k8s.io/v1.20.2/kubernetes-node-linux-amd64.tar.gz -O kube-node.tar.gz

kube-node: kube-node.tar.gz
tar -xzf kube-node.tar.gz


torcx: kube-node
helm.tar.gz:
wget -q https://get.helm.sh/helm-v3.5.0-linux-amd64.tar.gz -O helm.tar.gz

helm: helm.tar.gz
tar -xzf helm.tar.gz


torcx: cni kube-node helm
mkdir -p rootfs/bin
cp -ar kubernetes/node/bin/* rootfs/bin/
cp -a linux-amd64/helm rootfs/bin/

torcx.tgz: torcx
tar -C rootfs -czf torcx.tgz .
Expand Down
6 changes: 4 additions & 2 deletions rootfs/.torcx/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"bin": [
"/bin/kube-proxy",
"/bin/kubelet",
"/bin/kubectl"
"/bin/kubectl",
"/bin/helm"
],
"units": [
"/lib/systemd/system/kube-proxy.service",
"/lib/systemd/system/kubelet.service"
"/lib/systemd/system/kubelet.service",
"/lib/systemd/system/opt-cni.mount"
]
}
}
1 change: 1 addition & 0 deletions rootfs/lib/systemd/system/kube-proxy.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ After=torcx.target
Description=Kubernetes Kube-Proxy Server
After=network.target
Requires=network.target
RequiresMountsFor=/opt/cni

[Service]
EnvironmentFile=/run/metadata/torcx
Expand Down
1 change: 1 addition & 0 deletions rootfs/lib/systemd/system/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ After=torcx.target
Description=Kubernetes Kubelet Server
After=containerd.service
Requires=containerd.service
RequiresMountsFor=/opt/cni

[Service]
EnvironmentFile=/run/metadata/torcx
Expand Down
12 changes: 12 additions & 0 deletions rootfs/lib/systemd/system/opt-cni.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Container Network Interface
After=torcx.target
Conflicts=umount.target
Requires=torcx.target
RequiresMountsFor=/opt

[Mount]
What=/run/torcx/unpack/kube-node/opt/cni
Where=/opt/cni
Type=none
Options=bind

0 comments on commit 334a10b

Please sign in to comment.