mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
d15eb6aab6
Modified installer produces a k3s-server and k3s-agent systemd service, with env files located in /etc/rancher/k3s. The k3s-server service may be started without modification but k3s-agent requires a token and url modification to the /etc/rancher/k3s/k3s-agent.env file for functionality. The k3s-server service will conflict with the k3s-agent service, so both may not be started at the same time. Creates ./package/rpm/ repo dir for rpm specific resources and relocates k3s.spec.
72 lines
1.7 KiB
RPMSpec
72 lines
1.7 KiB
RPMSpec
# vim: sw=4:ts=4:et
|
|
|
|
%define install_path /usr/bin
|
|
%define util_path %{_datadir}/k3s
|
|
%define install_sh %{util_path}/setup/install.sh
|
|
%define uninstall_sh %{util_path}/setup/uninstall.sh
|
|
|
|
Name: k3s
|
|
Version: %{k3s_version}
|
|
Release: %{k3s_release}%{?dist}
|
|
Summary: Lightweight Kubernetes
|
|
|
|
Group: System Environment/Base
|
|
License: ASL 2.0
|
|
URL: http://k3s.io
|
|
|
|
BuildRequires: systemd
|
|
Requires(post): k3s-selinux >= %{k3s_policyver}
|
|
|
|
%description
|
|
The certified Kubernetes distribution built for IoT & Edge computing.
|
|
|
|
%install
|
|
install -d %{buildroot}%{install_path}
|
|
install dist/artifacts/%{k3s_binary} %{buildroot}%{install_path}/k3s
|
|
install -d %{buildroot}%{util_path}/setup
|
|
install package/rpm/install.sh %{buildroot}%{install_sh}
|
|
|
|
%post
|
|
# do not overwrite env file if present
|
|
export INSTALL_K3S_UPGRADE=true
|
|
export INSTALL_K3S_BIN_DIR=%{install_path}
|
|
export INSTALL_K3S_SKIP_DOWNLOAD=true
|
|
export INSTALL_K3S_SKIP_ENABLE=true
|
|
export INSTALL_K3S_DEBUG=true
|
|
export UNINSTALL_K3S_SH=%{uninstall_sh}
|
|
|
|
(
|
|
# install server service
|
|
INSTALL_K3S_NAME=server \
|
|
%{install_sh}
|
|
|
|
# install agent service
|
|
INSTALL_K3S_SYMLINK=skip \
|
|
INSTALL_K3S_BIN_DIR_READ_ONLY=true \
|
|
K3S_TOKEN=example-token \
|
|
K3S_URL=https://example-k3s-server:6443/ \
|
|
%{install_sh} agent
|
|
|
|
# save debug log of the install
|
|
) >%{util_path}/setup/install.log 2>&1
|
|
|
|
%systemd_post k3s-server.service
|
|
%systemd_post k3s-agent.service
|
|
exit 0
|
|
|
|
%postun
|
|
# do not run uninstall script on upgrade
|
|
if [ $1 = 0 ]; then
|
|
%{uninstall_sh}
|
|
rm -rf %{util_path}
|
|
fi
|
|
exit 0
|
|
|
|
%files
|
|
%{install_path}/k3s
|
|
%{install_sh}
|
|
|
|
%changelog
|
|
* Mon Mar 2 2020 Erik Wilson <erik@rancher.com> 0.1-1
|
|
- Initial version
|