Name: k3s Version: 0.5.0 Release: 1%{?dist} Summary: Lightweight Kubernetes. Easy to install, half the memory, all in a binary less than 40mb. Group: System/Management License: Apache-2.0 URL: https://k3s.io Source0: https://github.com/rancher/k3s/archive/v%{version}.tar.gz Source1: k3s-server.service Source2: k3s-agent.service Source3: server.conf Source4: agent.conf BuildRequires: golang Requires: containerd %description k3s is intended to be a fully compliant Kubernetes distribution with the following changes: * Legacy, alpha, non-default features are removed. Hopefully, you shouldn't notice the stuff that has been removed. * Removed most in-tree plugins (cloud providers and storage plugins) which can be replaced with out of tree addons. * Add sqlite3 as the default storage mechanism. etcd3 is still available, but not the default. * Wrapped in simple launcher that handles a lot of the complexity of TLS and options. * Minimal to no OS dependencies (just a sane kernel and cgroup mounts needed). k3s packages required dependencies %package hyperkube Summary: The Kubernetes server components from k3s Group: System/Management Requires: %{name} = %{version} Conflicts: kubernetes-common %description hyperkube hyperkube from k3s. hyperkube is an all-in-one binary for the Kubernetes server components. %package agent Summary: The Kubernetes server components from k3s Group: System/Management Requires: %{name} = %{version} Conflicts: kubernetes-common %description agent hyperkube from k3s. agent is an all-in-one binary for the Kubernetes server components. %prep %setup -q %build mkdir -p ./_build/src/github.com/rancher ln -s $(pwd) ./_build/src/github.com/rancher/k3s export GOPATH=$(pwd)/_build export PATH=$PATH:$(pwd)/_build/bin pushd _build/src/github.com/rancher/k3s go build go build ./vendor/k8s.io/kubernetes/cmd/hyperkube %install export GOPATH=$(pwd)/_build export PATH=$PATH:$(pwd)/_build/bin pushd _build/src/github.com/rancher/k3s go install go install ./vendor/k8s.io/kubernetes/cmd/hyperkube mkdir -p %{buildroot}%{_bindir} install -D -m 644 $(pwd)/_build/bin/k3s %{buildroot}%{_bindir}/k3s install -D -m 644 $(pwd)/_build/bin/hyperkube %{buildroot}%{_bindir}/hyperkube mkdir -p %{buildroot}%{_localstatedir}/lib/rancher/k3s mkdir -p %{buildroot}%{_localstatedir}/lib/rancher/k3s/server/manifests mkdir -p %{buildroot}%{_sysconfdir}/rancher/k3s install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rancher/k3s/server.conf install -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/rancher/k3s/agent.conf mkdir -p %{buildroot}%{_unitdir} install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/k3s-server.service install -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/k3s-agent.service mkdir -p %{buildroot}%{_sbindir} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rck3s-server ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rck3s-agent %pre %service_add_pre k3s-server.service k3s-agent.service %post %service_add_post k3s-server.service k3s-agent.service %preun %service_del_preun k3s-server.service k3s-agent.service %postun %service_del_postun k3s-server.service k3s-agent.service %files %license LICENSE %doc README.md %{_bindir}/k3s %{_localstatedir}/lib/rancher %config %{_sysconfdir}/rancher %config(noreplace) %{_sysconfdir}/rancher/k3s/agent.conf %config(noreplace) %{_sysconfdir}/rancher/k3s/server.conf %{_unitdir}/k3s-agent.service %{_unitdir}/k3s-server.service %{_sbindir}/rck3s-agent %{_sbindir}/rck3s-server %files agent %{_bindir}/k3s %{_localstatedir}/lib/rancher %config %{_sysconfdir}/rancher %config(noreplace) %{_sysconfdir}/rancher/k3s/agent.conf %{_unitdir}/k3s-agent.service %{_sbindir}/rck3s-agent %files hyperkube %{_bindir}/hyperkube %changelog