This commit is contained in:
nicolasg@microsoft.com 2020-12-17 04:16:51 -08:00
Родитель b54c2039ed
Коммит 689fe6fdff
14 изменённых файлов: 967 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,6 @@
{
"Signatures": {
"kubelet.service": "22ea9e0b85aa9db9e1accfb6c21843683425fc1af9c0a2669523e42a455dc57e",
"kubernetes-node-linux-amd64-1.16.13-hotfix.20200917.tar.gz": "143979b7e4a9f3a0ca909016456d6f982f5f3a0bf6407d114d364237c3058464"
}
}

Просмотреть файл

@ -0,0 +1,175 @@
%global debug_package %{nil}
%ifarch x86_64
%define archname amd64
%endif
%ifarch aarch64
%define archname arm64
%endif
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.16.13
Release: 1%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Microsoft Kubernetes
URL: https://mcr.microsoft.com/oss
#Source0: https://kubernetesartifacts.azureedge.net/kubernetes/v1.16.13-hotfix.20200917/binaries/kubernetes-node-linux-amd64.tar.gz
# Note that only amd64 tarball exist which is OK since kubernetes is built from source
Source0: kubernetes-node-linux-amd64-%{version}-hotfix.20200917.tar.gz
Source1: kubelet.service
BuildRequires: golang >= 1.12.9
BuildRequires: rsync
BuildRequires: which
BuildRequires: flex-devel
BuildRequires: systemd-devel
Requires: cni
Requires: cri-tools
Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables
Requires: moby-engine
Requires: socat
Requires: util-linux
Requires(postun): %{_sbindir}/groupdel
Requires(postun): %{_sbindir}/userdel
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
%description
Microsoft Kubernetes %{version}.
%package client
Summary: Client utilities
%description client
Client utilities for Microsoft Kubernetes %{version}.
%package kubeadm
Summary: Bootstrap utilities
Requires: %{name} = %{version}
Requires: moby-cli
%description kubeadm
Bootstrap utilities for Microsoft Kubernetes %{version}.
%prep
%setup -q -D -T -b 0 -n %{name}
# note: kubernetes RPM can be build from binaries provided in source0 tarball
# by doing nothing in %build and %check sections
%build
# expand kubernetes source tarball (which is included source0 tarball)
echo "+++ extract sources from tarball"
mkdir -p %{_builddir}/%{name}/src
cd %{_builddir}/%{name}/src
tar -xof %{_builddir}/%{name}/kubernetes-src.tar.gz
# build and update kubernetes components that are provided as binary
# (other/unused kubernetes componenents will not be built)
components_to_build=$(ls -1 %{_builddir}/%{name}/node/bin)
for component in ${components_to_build}; do
echo "+++ building ${component}"
make WHAT=cmd/${component}
cp -f _output/local/bin/linux/%{archname}/${component} %{_builddir}/%{name}/node/bin
done
%check
cd %{_builddir}/%{name}/src
components_to_test=$(ls -1 %{_builddir}/%{name}/node/bin)
# perform unit tests
# Note:
# - components are not unit tested the same way
# - not all components have unit
for component in ${components_to_test}; do
if [[ ${component} == "kubelet" || ${component} == "kubectl" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/${component}
elif [[ ${component} == "kube-proxy" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/proxy
else
echo "+++ no unit test available for ${component}"
fi
done
%install
# install binaries
install -m 755 -d %{buildroot}%{_bindir}
cd %{_builddir}
binaries=(kubelet kubectl kubeadm)
for bin in "${binaries[@]}"; do
echo "+++ INSTALLING ${bin}"
install -p -m 755 -t %{buildroot}%{_bindir} %{name}/node/bin/${bin}
done
# install service files
install -d -m 0755 %{buildroot}/%{_lib}/systemd/system
install -p -m 644 -t %{buildroot}%{_lib}/systemd/system %{SOURCE1}
# install config files
install -d -m 0755 %{buildroot}%{_sysconfdir}/kubernetes
install -d -m 644 %{buildroot}%{_sysconfdir}/kubernetes/manifests
# install the place the kubelet defaults to put volumes
install -dm755 %{buildroot}%{_sharedstatedir}/kubelet
install -dm755 %{buildroot}%{_var}/run/kubernetes
install -d -m 0755 %{buildroot}/%{_lib}/tmpfiles.d
cat << EOF >> %{buildroot}/%{_lib}/tmpfiles.d/kubernetes.conf
d %{_var}/run/kubernetes 0755 kube kube -
EOF
%clean
rm -rf %{buildroot}/*
%pre
if [ $1 -eq 1 ]; then
# Initial installation.
getent group kube >/dev/null || groupadd -r kube
getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
-c "Kubernetes user" kube
fi
%post
chown -R kube:kube %{_sharedstatedir}/kubelet
chown -R kube:kube %{_var}/run/kubernetes
systemctl daemon-reload
%post kubeadm
systemctl daemon-reload
systemctl stop kubelet
systemctl enable kubelet
%postun
if [ $1 -eq 0 ]; then
# Package deletion
userdel kube
groupdel kube
systemctl daemon-reload
fi
%files
%defattr(-,root,root)
%license LICENSES
%{_bindir}/kubelet
%{_lib}/tmpfiles.d/kubernetes.conf
%dir %{_sysconfdir}/kubernetes
%dir %{_sysconfdir}/kubernetes/manifests
%dir %{_sharedstatedir}/kubelet
%dir %{_var}/run/kubernetes
%{_lib}/systemd/system/kubelet.service
%files client
%defattr(-,root,root)
%{_bindir}/kubectl
%files kubeadm
%defattr(-,root,root)
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.16.13-1
- Initial version of K8s 1.16.13

Просмотреть файл

@ -0,0 +1,6 @@
{
"Signatures": {
"kubelet.service": "22ea9e0b85aa9db9e1accfb6c21843683425fc1af9c0a2669523e42a455dc57e",
"kubernetes-node-linux-amd64-1.16.15-hotfix.20200903.tar.gz": "c0e48f971e7e15c30bd5fd61d0fe608b7799d7e841020e67ccf7545ec5f52619"
}
}

Просмотреть файл

@ -0,0 +1,175 @@
%global debug_package %{nil}
%ifarch x86_64
%define archname amd64
%endif
%ifarch aarch64
%define archname arm64
%endif
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.16.15
Release: 1%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Microsoft Kubernetes
URL: https://mcr.microsoft.com/oss
#Source0: https://kubernetesartifacts.azureedge.net/kubernetes/v1.16.15-hotfix.20200903/binaries/kubernetes-node-linux-amd64.tar.gz
# Note that only amd64 tarball exist which is OK since kubernetes is built from source
Source0: kubernetes-node-linux-amd64-%{version}-hotfix.20200903.tar.gz
Source1: kubelet.service
BuildRequires: golang >= 1.12.9
BuildRequires: rsync
BuildRequires: which
BuildRequires: flex-devel
BuildRequires: systemd-devel
Requires: cni
Requires: cri-tools
Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables
Requires: moby-engine
Requires: socat
Requires: util-linux
Requires(postun): %{_sbindir}/groupdel
Requires(postun): %{_sbindir}/userdel
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
%description
Microsoft Kubernetes %{version}.
%package client
Summary: Client utilities
%description client
Client utilities for Microsoft Kubernetes %{version}.
%package kubeadm
Summary: Bootstrap utilities
Requires: %{name} = %{version}
Requires: moby-cli
%description kubeadm
Bootstrap utilities for Microsoft Kubernetes %{version}.
%prep
%setup -q -D -T -b 0 -n %{name}
# note: kubernetes RPM can be build from binaries provided in source0 tarball
# by doing nothing in %build and %check sections
%build
# expand kubernetes source tarball (which is included source0 tarball)
echo "+++ extract sources from tarball"
mkdir -p %{_builddir}/%{name}/src
cd %{_builddir}/%{name}/src
tar -xof %{_builddir}/%{name}/kubernetes-src.tar.gz
# build and update kubernetes components that are provided as binary
# (other/unused kubernetes componenents will not be built)
components_to_build=$(ls -1 %{_builddir}/%{name}/node/bin)
for component in ${components_to_build}; do
echo "+++ building ${component}"
make WHAT=cmd/${component}
cp -f _output/local/bin/linux/%{archname}/${component} %{_builddir}/%{name}/node/bin
done
%check
cd %{_builddir}/%{name}/src
components_to_test=$(ls -1 %{_builddir}/%{name}/node/bin)
# perform unit tests
# Note:
# - components are not unit tested the same way
# - not all components have unit
for component in ${components_to_test}; do
if [[ ${component} == "kubelet" || ${component} == "kubectl" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/${component}
elif [[ ${component} == "kube-proxy" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/proxy
else
echo "+++ no unit test available for ${component}"
fi
done
%install
# install binaries
install -m 755 -d %{buildroot}%{_bindir}
cd %{_builddir}
binaries=(kubelet kubectl kubeadm)
for bin in "${binaries[@]}"; do
echo "+++ INSTALLING ${bin}"
install -p -m 755 -t %{buildroot}%{_bindir} %{name}/node/bin/${bin}
done
# install service files
install -d -m 0755 %{buildroot}/%{_lib}/systemd/system
install -p -m 644 -t %{buildroot}%{_lib}/systemd/system %{SOURCE1}
# install config files
install -d -m 0755 %{buildroot}%{_sysconfdir}/kubernetes
install -d -m 644 %{buildroot}%{_sysconfdir}/kubernetes/manifests
# install the place the kubelet defaults to put volumes
install -dm755 %{buildroot}%{_sharedstatedir}/kubelet
install -dm755 %{buildroot}%{_var}/run/kubernetes
install -d -m 0755 %{buildroot}/%{_lib}/tmpfiles.d
cat << EOF >> %{buildroot}/%{_lib}/tmpfiles.d/kubernetes.conf
d %{_var}/run/kubernetes 0755 kube kube -
EOF
%clean
rm -rf %{buildroot}/*
%pre
if [ $1 -eq 1 ]; then
# Initial installation.
getent group kube >/dev/null || groupadd -r kube
getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
-c "Kubernetes user" kube
fi
%post
chown -R kube:kube %{_sharedstatedir}/kubelet
chown -R kube:kube %{_var}/run/kubernetes
systemctl daemon-reload
%post kubeadm
systemctl daemon-reload
systemctl stop kubelet
systemctl enable kubelet
%postun
if [ $1 -eq 0 ]; then
# Package deletion
userdel kube
groupdel kube
systemctl daemon-reload
fi
%files
%defattr(-,root,root)
%license LICENSES
%{_bindir}/kubelet
%{_lib}/tmpfiles.d/kubernetes.conf
%dir %{_sysconfdir}/kubernetes
%dir %{_sysconfdir}/kubernetes/manifests
%dir %{_sharedstatedir}/kubelet
%dir %{_var}/run/kubernetes
%{_lib}/systemd/system/kubelet.service
%files client
%defattr(-,root,root)
%{_bindir}/kubectl
%files kubeadm
%defattr(-,root,root)
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.16.15-1
- Initial version of K8s 1.16.15

Просмотреть файл

@ -8,7 +8,7 @@
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.17.11
Release: 3%{?dist}
Release: 4%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
@ -171,6 +171,9 @@ fi
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.17.11-4
- Rename spec file
* Wed Dec 02 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.17.11-3
- Rename ms-kubernetes-1.17.11 into kubernetes and lint spec

Просмотреть файл

@ -0,0 +1,6 @@
{
"Signatures": {
"kubelet.service": "22ea9e0b85aa9db9e1accfb6c21843683425fc1af9c0a2669523e42a455dc57e",
"kubernetes-node-linux-amd64-1.17.13.tar.gz": "ce4f8cb33e47423b1e70be248cb2b1c2edafbc338db9feb72c27f245f060ac5a"
}
}

Просмотреть файл

@ -0,0 +1,175 @@
%global debug_package %{nil}
%ifarch x86_64
%define archname amd64
%endif
%ifarch aarch64
%define archname arm64
%endif
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.17.13
Release: 1%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Microsoft Kubernetes
URL: https://mcr.microsoft.com/oss
#Source0: https://kubernetesartifacts.azureedge.net/kubernetes/v1.17.13/binaries/kubernetes-node-linux-amd64.tar.gz
# Note that only amd64 tarball exist which is OK since kubernetes is built from source
Source0: kubernetes-node-linux-amd64-%{version}.tar.gz
Source1: kubelet.service
BuildRequires: golang >= 1.13.15
BuildRequires: rsync
BuildRequires: which
BuildRequires: flex-devel
BuildRequires: systemd-devel
Requires: cni
Requires: cri-tools
Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables
Requires: moby-engine
Requires: socat
Requires: util-linux
Requires(postun): %{_sbindir}/groupdel
Requires(postun): %{_sbindir}/userdel
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
%description
Microsoft Kubernetes %{version}.
%package client
Summary: Client utilities
%description client
Client utilities for Microsoft Kubernetes %{version}.
%package kubeadm
Summary: Bootstrap utilities
Requires: %{name} = %{version}
Requires: moby-cli
%description kubeadm
Bootstrap utilities for Microsoft Kubernetes %{version}.
%prep
%setup -q -D -T -b 0 -n %{name}
# note: kubernetes RPM can be build from binaries provided in source0 tarball
# by doing nothing in %build and %check sections
%build
# expand kubernetes source tarball (which is included source0 tarball)
echo "+++ extract sources from tarball"
mkdir -p %{_builddir}/%{name}/src
cd %{_builddir}/%{name}/src
tar -xof %{_builddir}/%{name}/kubernetes-src.tar.gz
# build and update kubernetes components that are provided as binary
# (other/unused kubernetes componenents will not be built)
components_to_build=$(ls -1 %{_builddir}/%{name}/node/bin)
for component in ${components_to_build}; do
echo "+++ building ${component}"
make WHAT=cmd/${component}
cp -f _output/local/bin/linux/%{archname}/${component} %{_builddir}/%{name}/node/bin
done
%check
cd %{_builddir}/%{name}/src
components_to_test=$(ls -1 %{_builddir}/%{name}/node/bin)
# perform unit tests
# Note:
# - components are not unit tested the same way
# - not all components have unit
for component in ${components_to_test}; do
if [[ ${component} == "kubelet" || ${component} == "kubectl" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/${component}
elif [[ ${component} == "kube-proxy" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/proxy
else
echo "+++ no unit test available for ${component}"
fi
done
%install
# install binaries
install -m 755 -d %{buildroot}%{_bindir}
cd %{_builddir}
binaries=(kubelet kubectl kubeadm)
for bin in "${binaries[@]}"; do
echo "+++ INSTALLING ${bin}"
install -p -m 755 -t %{buildroot}%{_bindir} %{name}/node/bin/${bin}
done
# install service files
install -d -m 0755 %{buildroot}/%{_lib}/systemd/system
install -p -m 644 -t %{buildroot}%{_lib}/systemd/system %{SOURCE1}
# install config files
install -d -m 0755 %{buildroot}%{_sysconfdir}/kubernetes
install -d -m 644 %{buildroot}%{_sysconfdir}/kubernetes/manifests
# install the place the kubelet defaults to put volumes
install -dm755 %{buildroot}%{_sharedstatedir}/kubelet
install -dm755 %{buildroot}%{_var}/run/kubernetes
install -d -m 0755 %{buildroot}/%{_lib}/tmpfiles.d
cat << EOF >> %{buildroot}/%{_lib}/tmpfiles.d/kubernetes.conf
d %{_var}/run/kubernetes 0755 kube kube -
EOF
%clean
rm -rf %{buildroot}/*
%pre
if [ $1 -eq 1 ]; then
# Initial installation.
getent group kube >/dev/null || groupadd -r kube
getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
-c "Kubernetes user" kube
fi
%post
chown -R kube:kube %{_sharedstatedir}/kubelet
chown -R kube:kube %{_var}/run/kubernetes
systemctl daemon-reload
%post kubeadm
systemctl daemon-reload
systemctl stop kubelet
systemctl enable kubelet
%postun
if [ $1 -eq 0 ]; then
# Package deletion
userdel kube
groupdel kube
systemctl daemon-reload
fi
%files
%defattr(-,root,root)
%license LICENSES
%{_bindir}/kubelet
%{_lib}/tmpfiles.d/kubernetes.conf
%dir %{_sysconfdir}/kubernetes
%dir %{_sysconfdir}/kubernetes/manifests
%dir %{_sharedstatedir}/kubelet
%dir %{_var}/run/kubernetes
%{_lib}/systemd/system/kubelet.service
%files client
%defattr(-,root,root)
%{_bindir}/kubectl
%files kubeadm
%defattr(-,root,root)
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.17.13-1
- Initial version of K8s 1.17.13.

Просмотреть файл

@ -0,0 +1,6 @@
{
"Signatures": {
"kubelet.service": "22ea9e0b85aa9db9e1accfb6c21843683425fc1af9c0a2669523e42a455dc57e",
"kubernetes-node-linux-amd64-1.18.10.tar.gz": "85078d8322f3641606569ea77d045fc789f8663c8b83fe21aeee600492974d6c"
}
}

Просмотреть файл

@ -0,0 +1,175 @@
%global debug_package %{nil}
%ifarch x86_64
%define archname amd64
%endif
%ifarch aarch64
%define archname arm64
%endif
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.18.10
Release: 1%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Microsoft Kubernetes
URL: https://mcr.microsoft.com/oss
#Source0: https://kubernetesartifacts.azureedge.net/kubernetes/v1.18.10/binaries/kubernetes-node-linux-amd64.tar.gz
# Note that only amd64 tarball exist which is OK since kubernetes is built from source
Source0: kubernetes-node-linux-amd64-%{version}.tar.gz
Source1: kubelet.service
BuildRequires: golang >= 1.13.15
BuildRequires: rsync
BuildRequires: which
BuildRequires: flex-devel
BuildRequires: systemd-devel
Requires: cni
Requires: cri-tools
Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables
Requires: moby-engine
Requires: socat
Requires: util-linux
Requires(postun): %{_sbindir}/groupdel
Requires(postun): %{_sbindir}/userdel
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
%description
Microsoft Kubernetes %{version}.
%package client
Summary: Client utilities
%description client
Client utilities for Microsoft Kubernetes %{version}.
%package kubeadm
Summary: Bootstrap utilities
Requires: %{name} = %{version}
Requires: moby-cli
%description kubeadm
Bootstrap utilities for Microsoft Kubernetes %{version}.
%prep
%setup -q -D -T -b 0 -n %{name}
# note: kubernetes RPM can be build from binaries provided in source0 tarball
# by doing nothing in %build and %check sections
%build
# expand kubernetes source tarball (which is included source0 tarball)
echo "+++ extract sources from tarball"
mkdir -p %{_builddir}/%{name}/src
cd %{_builddir}/%{name}/src
tar -xof %{_builddir}/%{name}/kubernetes-src.tar.gz
# build and update kubernetes components that are provided as binary
# (other/unused kubernetes componenents will not be built)
components_to_build=$(ls -1 %{_builddir}/%{name}/node/bin)
for component in ${components_to_build}; do
echo "+++ building ${component}"
make WHAT=cmd/${component}
cp -f _output/local/bin/linux/%{archname}/${component} %{_builddir}/%{name}/node/bin
done
%check
cd %{_builddir}/%{name}/src
components_to_test=$(ls -1 %{_builddir}/%{name}/node/bin)
# perform unit tests
# Note:
# - components are not unit tested the same way
# - not all components have unit
for component in ${components_to_test}; do
if [[ ${component} == "kubelet" || ${component} == "kubectl" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/${component}
elif [[ ${component} == "kube-proxy" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/proxy
else
echo "+++ no unit test available for ${component}"
fi
done
%install
# install binaries
install -m 755 -d %{buildroot}%{_bindir}
cd %{_builddir}
binaries=(kubelet kubectl kubeadm)
for bin in "${binaries[@]}"; do
echo "+++ INSTALLING ${bin}"
install -p -m 755 -t %{buildroot}%{_bindir} %{name}/node/bin/${bin}
done
# install service files
install -d -m 0755 %{buildroot}/%{_lib}/systemd/system
install -p -m 644 -t %{buildroot}%{_lib}/systemd/system %{SOURCE1}
# install config files
install -d -m 0755 %{buildroot}%{_sysconfdir}/kubernetes
install -d -m 644 %{buildroot}%{_sysconfdir}/kubernetes/manifests
# install the place the kubelet defaults to put volumes
install -dm755 %{buildroot}%{_sharedstatedir}/kubelet
install -dm755 %{buildroot}%{_var}/run/kubernetes
install -d -m 0755 %{buildroot}/%{_lib}/tmpfiles.d
cat << EOF >> %{buildroot}/%{_lib}/tmpfiles.d/kubernetes.conf
d %{_var}/run/kubernetes 0755 kube kube -
EOF
%clean
rm -rf %{buildroot}/*
%pre
if [ $1 -eq 1 ]; then
# Initial installation.
getent group kube >/dev/null || groupadd -r kube
getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
-c "Kubernetes user" kube
fi
%post
chown -R kube:kube %{_sharedstatedir}/kubelet
chown -R kube:kube %{_var}/run/kubernetes
systemctl daemon-reload
%post kubeadm
systemctl daemon-reload
systemctl stop kubelet
systemctl enable kubelet
%postun
if [ $1 -eq 0 ]; then
# Package deletion
userdel kube
groupdel kube
systemctl daemon-reload
fi
%files
%defattr(-,root,root)
%license LICENSES
%{_bindir}/kubelet
%{_lib}/tmpfiles.d/kubernetes.conf
%dir %{_sysconfdir}/kubernetes
%dir %{_sysconfdir}/kubernetes/manifests
%dir %{_sharedstatedir}/kubelet
%dir %{_var}/run/kubernetes
%{_lib}/systemd/system/kubelet.service
%files client
%defattr(-,root,root)
%{_bindir}/kubectl
%files kubeadm
%defattr(-,root,root)
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.18.10-1
- Initial version of K8s 1.18.10.

Просмотреть файл

@ -8,7 +8,7 @@
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.18.8
Release: 4%{?dist}
Release: 5%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
@ -171,6 +171,9 @@ fi
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.18.8-5
- Rename spec file
* Wed Dec 02 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.18.8-4
- Rename ms-kubernetes-1.81.8 into kubernetes and lint spec

Просмотреть файл

@ -8,7 +8,7 @@
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.19.1
Release: 1%{?dist}
Release: 2%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
@ -171,5 +171,8 @@ fi
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.19.1-2
- Rename spec file
* Wed Dec 02 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.19.1-1
- Initial version of K8s 1.19.1.

Просмотреть файл

@ -0,0 +1,6 @@
{
"Signatures": {
"kubelet.service": "22ea9e0b85aa9db9e1accfb6c21843683425fc1af9c0a2669523e42a455dc57e",
"kubernetes-node-linux-amd64-1.19.3.tar.gz": "10c3c034f19c19f22c0bd1af17869b82f6d7e93cc90c6b00f3f39b974d487c3a"
}
}

Просмотреть файл

@ -0,0 +1,175 @@
%global debug_package %{nil}
%ifarch x86_64
%define archname amd64
%endif
%ifarch aarch64
%define archname arm64
%endif
Summary: Microsoft Kubernetes
Name: kubernetes
Version: 1.19.3
Release: 1%{?dist}
License: ASL 2.0
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Microsoft Kubernetes
URL: https://mcr.microsoft.com/oss
#Source0: https://kubernetesartifacts.azureedge.net/kubernetes/v1.19.3/binaries/kubernetes-node-linux-amd64.tar.gz
# Note that only amd64 tarball exist which is OK since kubernetes is built from source
Source0: kubernetes-node-linux-amd64-%{version}.tar.gz
Source1: kubelet.service
BuildRequires: golang >= 1.15.5
BuildRequires: rsync
BuildRequires: which
BuildRequires: flex-devel
BuildRequires: systemd-devel
Requires: cni
Requires: cri-tools
Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables
Requires: moby-engine
Requires: socat
Requires: util-linux
Requires(postun): %{_sbindir}/groupdel
Requires(postun): %{_sbindir}/userdel
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
%description
Microsoft Kubernetes %{version}.
%package client
Summary: Client utilities
%description client
Client utilities for Microsoft Kubernetes %{version}.
%package kubeadm
Summary: Bootstrap utilities
Requires: %{name} = %{version}
Requires: moby-cli
%description kubeadm
Bootstrap utilities for Microsoft Kubernetes %{version}.
%prep
%setup -q -D -T -b 0 -n %{name}
# note: kubernetes RPM can be build from binaries provided in source0 tarball
# by doing nothing in %build and %check sections
%build
# expand kubernetes source tarball (which is included source0 tarball)
echo "+++ extract sources from tarball"
mkdir -p %{_builddir}/%{name}/src
cd %{_builddir}/%{name}/src
tar -xof %{_builddir}/%{name}/kubernetes-src.tar.gz
# build and update kubernetes components that are provided as binary
# (other/unused kubernetes componenents will not be built)
components_to_build=$(ls -1 %{_builddir}/%{name}/node/bin)
for component in ${components_to_build}; do
echo "+++ building ${component}"
make WHAT=cmd/${component}
cp -f _output/local/bin/linux/%{archname}/${component} %{_builddir}/%{name}/node/bin
done
%check
cd %{_builddir}/%{name}/src
components_to_test=$(ls -1 %{_builddir}/%{name}/node/bin)
# perform unit tests
# Note:
# - components are not unit tested the same way
# - not all components have unit
for component in ${components_to_test}; do
if [[ ${component} == "kubelet" || ${component} == "kubectl" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/${component}
elif [[ ${component} == "kube-proxy" ]]; then
echo "+++ unit test pkg ${component}"
make test WHAT=./pkg/proxy
else
echo "+++ no unit test available for ${component}"
fi
done
%install
# install binaries
install -m 755 -d %{buildroot}%{_bindir}
cd %{_builddir}
binaries=(kubelet kubectl kubeadm)
for bin in "${binaries[@]}"; do
echo "+++ INSTALLING ${bin}"
install -p -m 755 -t %{buildroot}%{_bindir} %{name}/node/bin/${bin}
done
# install service files
install -d -m 0755 %{buildroot}/%{_lib}/systemd/system
install -p -m 644 -t %{buildroot}%{_lib}/systemd/system %{SOURCE1}
# install config files
install -d -m 0755 %{buildroot}%{_sysconfdir}/kubernetes
install -d -m 644 %{buildroot}%{_sysconfdir}/kubernetes/manifests
# install the place the kubelet defaults to put volumes
install -dm755 %{buildroot}%{_sharedstatedir}/kubelet
install -dm755 %{buildroot}%{_var}/run/kubernetes
install -d -m 0755 %{buildroot}/%{_lib}/tmpfiles.d
cat << EOF >> %{buildroot}/%{_lib}/tmpfiles.d/kubernetes.conf
d %{_var}/run/kubernetes 0755 kube kube -
EOF
%clean
rm -rf %{buildroot}/*
%pre
if [ $1 -eq 1 ]; then
# Initial installation.
getent group kube >/dev/null || groupadd -r kube
getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
-c "Kubernetes user" kube
fi
%post
chown -R kube:kube %{_sharedstatedir}/kubelet
chown -R kube:kube %{_var}/run/kubernetes
systemctl daemon-reload
%post kubeadm
systemctl daemon-reload
systemctl stop kubelet
systemctl enable kubelet
%postun
if [ $1 -eq 0 ]; then
# Package deletion
userdel kube
groupdel kube
systemctl daemon-reload
fi
%files
%defattr(-,root,root)
%license LICENSES
%{_bindir}/kubelet
%{_lib}/tmpfiles.d/kubernetes.conf
%dir %{_sysconfdir}/kubernetes
%dir %{_sysconfdir}/kubernetes/manifests
%dir %{_sharedstatedir}/kubelet
%dir %{_var}/run/kubernetes
%{_lib}/systemd/system/kubelet.service
%files client
%defattr(-,root,root)
%{_bindir}/kubectl
%files kubeadm
%defattr(-,root,root)
%{_bindir}/kubeadm
%changelog
* Thu Dec 17 2020 Nicolas Guibourge <nicolasg@microsoft.com> - 1.19.3-1
- Initial version of K8s 1.19.3.

Просмотреть файл

@ -2020,6 +2020,26 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "kubernetes",
"version": "1.16.13",
"downloadUrl": "https://kubernetesartifacts.azureedge.net/kubernetes/v1.16.13-hotfix.20200917/binaries/kubernetes-node-linux-amd64.tar.gz"
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "kubernetes",
"version": "1.16.15",
"downloadUrl": "https://kubernetesartifacts.azureedge.net/kubernetes/v1.16.15-hotfix.20200903/binaries/kubernetes-node-linux-amd64.tar.gz"
}
}
},
{
"component": {
"type": "other",
@ -2030,6 +2050,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "kubernetes",
"version": "1.17.13",
"downloadUrl": "https://kubernetesartifacts.azureedge.net/kubernetes/v1.17.13/binaries/kubernetes-node-linux-amd64.tar.gz"
}
}
},
{
"component": {
"type": "other",
@ -2040,6 +2070,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "kubernetes",
"version": "1.18.10",
"downloadUrl": "https://kubernetesartifacts.azureedge.net/kubernetes/v1.18.10/binaries/kubernetes-node-linux-amd64.tar.gz"
}
}
},
{
"component": {
"type": "other",
@ -2050,6 +2090,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "kubernetes",
"version": "1.19.3",
"downloadUrl": "https://kubernetesartifacts.azureedge.net/kubernetes/v1.19.3/binaries/kubernetes-node-linux-amd64.tar.gz"
}
}
},
{
"component": {
"type": "other",