From e1888d018c2eac1222bf47ab5d485cb71d748fad Mon Sep 17 00:00:00 2001 From: GeorgeRaven Date: Sat, 23 Sep 2023 18:17:51 +0100 Subject: [PATCH] Added kubeadm to automation --- kubeadm-bin/.SRCINFO | 24 +++++++++++++++++++++++ kubeadm-bin/10-kubeadm.conf | 11 +++++++++++ kubeadm-bin/PKGBUILD | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 kubeadm-bin/.SRCINFO create mode 100644 kubeadm-bin/10-kubeadm.conf create mode 100644 kubeadm-bin/PKGBUILD diff --git a/kubeadm-bin/.SRCINFO b/kubeadm-bin/.SRCINFO new file mode 100644 index 00000000..7599a769 --- /dev/null +++ b/kubeadm-bin/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = kubeadm-bin + pkgdesc = Kubernetes.io kubeadm binary + pkgver = 1.28.0 + pkgrel = 1 + url = http://kubernetes.io + arch = x86_64 + arch = armv7l + arch = armv7h + arch = aarch64 + license = apache + depends = kubelet-bin + depends = conntrack-tools + depends = iptables + depends = iproute2 + depends = util-linux + depends = crictl + provides = kubeadm + conflicts = kubeadm + source = 10-kubeadm.conf + source = kubeadm-bin-1.28.0-amd64::https://storage.googleapis.com/kubernetes-release/release/v1.28.0/bin/linux/amd64/kubeadm + b2sums = 074744d327227c32661befcff7651209438090fbd75890ad3b5a32ada1fbdf8901dbd132c7093ed353901f1ea7505c97089a5a89a104f57cb7f53a342eecc7e8 + b2sums = 87d6abbebdf568b4c362750faa3a2138d748f62a5f67c95a23f531b9096dda29f45f95b7f42d009b5f0bfadde9691b0879f111e9a5b5b0fb7a94d1802eecdfd2 + +pkgname = kubeadm-bin diff --git a/kubeadm-bin/10-kubeadm.conf b/kubeadm-bin/10-kubeadm.conf new file mode 100644 index 00000000..dce41fdd --- /dev/null +++ b/kubeadm-bin/10-kubeadm.conf @@ -0,0 +1,11 @@ +# Note: This dropin only works with kubeadm and kubelet v1.11+ +[Service] +Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf" +Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml" +# This is a file that "kubeadm init" and "kubeadm join" generate at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically +EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env +# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use +# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file. +EnvironmentFile=-/etc/default/kubelet +ExecStart= +ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS diff --git a/kubeadm-bin/PKGBUILD b/kubeadm-bin/PKGBUILD new file mode 100644 index 00000000..4cfee14b --- /dev/null +++ b/kubeadm-bin/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: George Raven +# Contributor: Paul Nicholson +# Contributor: Wes Jackson + +pkgname=kubeadm-bin +pkgdesc="Kubernetes.io kubeadm binary" +pkgver=1.28.0 +pkgrel=1 +arch=('x86_64' 'armv7l' 'armv7h' 'aarch64') +url="http://kubernetes.io" +license=('apache') +depends=('kubelet-bin' 'conntrack-tools' 'iptables' 'iproute2' 'util-linux' 'crictl') +conflicts=('kubeadm') +provides=('kubeadm') +source=( + "10-kubeadm.conf" +) +b2sums=('074744d327227c32661befcff7651209438090fbd75890ad3b5a32ada1fbdf8901dbd132c7093ed353901f1ea7505c97089a5a89a104f57cb7f53a342eecc7e8' + '87d6abbebdf568b4c362750faa3a2138d748f62a5f67c95a23f531b9096dda29f45f95b7f42d009b5f0bfadde9691b0879f111e9a5b5b0fb7a94d1802eecdfd2') + +# if CARCH is not set default to x86_64 +# https://stackoverflow.com/a/11362364/11164973 +: "${CARCH:=x86_64}" + +case "$CARCH" in + x86_64) _pkgarch="amd64" + ;; + arm*) _pkgarch="arm" + ;; + aarch64) _pkgarch="arm64" + ;; +esac + +source+=(${pkgname}-${pkgver}-${_pkgarch}::"https://storage.googleapis.com/kubernetes-release/release/v${pkgver}/bin/linux/${_pkgarch}/kubeadm") + +package() { + install -D -m0644 "10-kubeadm.conf" "${pkgdir}/usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf" + install -D -m0755 "${pkgname}-${pkgver}-${_pkgarch}" "${pkgdir}/usr/bin/kubeadm" +}