Port kubernetes-unversioned package from CentOS to Debian

We now support multiple kubernetes versions,
and the common configuration/environment
files have been moved to a new package named
kubernetes-unversioned in CentOS
https://review.opendev.org/c/starlingx/integ/+/804243.

This commit will port kubernetes-unversioned to Debian.

- Did build-pkg
- Did build-img
- Verified if the package was installed correctly
- Verified the permissions of the installed files

Story: 2009101
Task: 44008
Change-Id: I65a9817d7f09736919453c0e81221f1fa1c590f5
Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
This commit is contained in:
Mihnea Saracin 2021-11-19 12:32:52 +02:00
parent 205b6e48b2
commit e73a8b35d5
14 changed files with 165 additions and 0 deletions

View File

@ -40,6 +40,7 @@ kubernetes/etcd
kubernetes/helm
kubernetes/k8s-pod-recovery
kubernetes/kubernetes-1.21.3
kubernetes/kubernetes-unversioned
kubernetes/plugins/isolcpus-device-plugin
kubernetes/runc
ldap/ldapscripts

View File

@ -0,0 +1,5 @@
kubernetes-unversioned (1.0-1) unstable; urgency=medium
* Initial release
-- Mihnea Saracin <mihnea.saracin@opendev.org> Mon, 15 Nov 2021 16:09:12 +0000

View File

@ -0,0 +1,16 @@
Source: kubernetes-unversioned
Section: admin
Priority: optional
Maintainer: StarlingX Developers <StarlingX-discuss@lists.StarlingX.io>
Build-Depends: debhelper-compat (= 13), libsystemd-dev
Standards-Version: 4.4.1
Homepage: https://www.starlingx.io
Rules-Requires-Root: no
Package: kubernetes-unversioned
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
systemd
Description: Kubernetes unversioned common config and current version symlinks
This package contains kubernetes config files and current version symlinks

View File

@ -0,0 +1,22 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: kubernetes-unversioned
Source: https://opendev.org/starlingx/integ/src/branch/master/kubernetes/kubernetes-unversioned
Files: *
Copyright: (c) 2021 Wind River Systems, Inc
(c) Others (See individual files for more details)
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.

View File

@ -0,0 +1,3 @@
[Manager]
DefaultCPUAccounting=yes
DefaultMemoryAccounting=yes

View File

@ -0,0 +1,6 @@
etc/systemd/system/kubelet.service.d
usr/share/bash-completion/completions
usr/local/kubernetes/current/stage1
usr/local/kubernetes/current/stage2
var/lib/kubelet
run/kubernetes

View File

@ -0,0 +1,7 @@
usr/lib/systemd/system/kubelet.service
etc/kubernetes/config
etc/kubernetes/kubelet
etc/kubernetes/kubelet.kubeconfig
etc/kubernetes/proxy
etc/systemd/system.conf.d/kubernetes-accounting.conf
usr/lib/tmpfiles.d/kubernetes.conf

View File

@ -0,0 +1,6 @@
/usr/local/kubernetes/current/stage1/usr/bin/kubeadm /usr/bin/kubeadm
/usr/local/kubernetes/current/stage2/usr/bin/kubelet /usr/bin/kubelet
/usr/local/kubernetes/current/stage2/usr/bin/kubelet-cgroup-setup.sh /usr/bin/kubelet-cgroup-setup.sh
/usr/local/kubernetes/current/stage2/usr/bin/kubectl /usr/bin/kubectl
/usr/local/kubernetes/current/stage2/etc/systemd/system/kubelet.service.d/kubeadm.conf /etc/systemd/system/kubelet.service.d/kubeadm.conf
/usr/local/kubernetes/current/stage2/usr/share/bash-completion/completions/kubectl /usr/share/bash-completion/completions/kubectl

View File

@ -0,0 +1,6 @@
usr/bin/kubeadm
usr/bin/kubelet
usr/bin/kubelet-cgroup-setup.sh
usr/bin/kubectl
etc/systemd/system/kubelet.service.d/kubeadm.conf
usr/share/bash-completion/completions/kubectl

View File

@ -0,0 +1,15 @@
diff --git a/init/systemd/kubelet.service b/init/systemd/kubelet.service
index 1082bba..1fae395 100644
--- a/init/systemd/kubelet.service
+++ b/init/systemd/kubelet.service
@@ -1,8 +1,8 @@
[Unit]
Description=Kubernetes Kubelet Server
Documentation=https://kubernetes.io/docs/concepts/overview/components/#kubelet https://kubernetes.io/docs/reference/generated/kubelet/
-After=docker.service
-Requires=docker.service
+Wants=network-online.target
+After=network-online.target
[Service]
WorkingDirectory=/var/lib/kubelet

View File

@ -0,0 +1 @@
kubelet-service-remove-docker-dependency.patch

View File

@ -0,0 +1,67 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
_k8s_name := kubernetes
_bindir := /usr/bin
_curr_stage1 := /usr/local/kubernetes/current/stage1
_curr_stage2 := /usr/local/kubernetes/current/stage2
DEBIAN_DESTDIR := $(CURDIR)/debian/tmp
stage_link = ln -v -sf ${1}${2}/${3} ${DEBIAN_DESTDIR}${2}/${3}
%:
dh $@ --builddirectory=contrib
override_dh_auto_build:
mkdir -pv contrib
cp -rv init contrib
override_dh_install:
# Current staged directories
install -v -m 755 -d ${DEBIAN_DESTDIR}${_curr_stage1}
install -v -m 755 -d ${DEBIAN_DESTDIR}${_curr_stage2}
# Symlink targets
install -v -m 755 -d ${DEBIAN_DESTDIR}${_bindir}
install -v -m 755 -d ${DEBIAN_DESTDIR}/etc/systemd/system/kubelet.service.d
install -v -m 755 -d ${DEBIAN_DESTDIR}/usr/share/bash-completion/completions
$(call stage_link,${_curr_stage1},${_bindir},kubeadm)
$(call stage_link,${_curr_stage2},/etc/systemd/system/kubelet.service.d,kubeadm.conf)
$(call stage_link,${_curr_stage2},/usr/share/bash-completion/completions,kubectl)
$(call stage_link,${_curr_stage2},${_bindir},kubelet-cgroup-setup.sh)
$(call stage_link,${_curr_stage2},${_bindir},kubelet)
$(call stage_link,${_curr_stage2},${_bindir},kubectl)
# install environment files
install -v -d -m 0755 ${DEBIAN_DESTDIR}/etc/${_k8s_name}
install -v -m 644 -t ${DEBIAN_DESTDIR}/etc/${_k8s_name} contrib/init/systemd/environ/config
install -v -m 644 -t ${DEBIAN_DESTDIR}/etc/${_k8s_name} contrib/init/systemd/environ/kubelet
install -v -m 644 -t ${DEBIAN_DESTDIR}/etc/${_k8s_name} contrib/init/systemd/environ/kubelet.kubeconfig
install -v -m 644 -t ${DEBIAN_DESTDIR}/etc/${_k8s_name} contrib/init/systemd/environ/proxy
# install config files
install -v -d -m 0755 ${DEBIAN_DESTDIR}/usr/lib/tmpfiles.d
install -v -p -m 0644 -t ${DEBIAN_DESTDIR}/usr/lib/tmpfiles.d contrib/init/systemd/tmpfiles.d/kubernetes.conf
mkdir -p ${DEBIAN_DESTDIR}/run
install -v -d -m 0755 ${DEBIAN_DESTDIR}/run/${_k8s_name}/
# install service files
install -v -d -m 0755 ${DEBIAN_DESTDIR}/usr/lib/systemd/system
install -v -m 0644 -t ${DEBIAN_DESTDIR}/usr/lib/systemd/system contrib/init/systemd/kubelet.service
# install the place the kubelet defaults to put volumes (/var/lib/kubelet)
install -v -d ${DEBIAN_DESTDIR}/var/lib/kubelet
# enable CPU and Memory accounting
install -v -d -m 0755 ${DEBIAN_DESTDIR}/etc/systemd/system.conf.d
install -v -p -m 0644 -t ${DEBIAN_DESTDIR}/etc/systemd/system.conf.d debian/kubernetes-accounting.conf
dh_install
override_dh_usrlocal:
override_dh_auto_test:

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,9 @@
debname: kubernetes-unversioned
debver: 1.0-1
dl_path:
name: kubernetes-contrib-v1.18.1.tar.gz
url: https://github.com/kubernetes-retired/contrib/tarball/89f6948e24578fed2a90a87871b2263729f90ac3
md5sum: 9aa15af65ed89a7167b9520573bbdcd7
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true