forked from ovn-kubernetes/ovn-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add packages to control systemd Two spec files, one builds a version (0.2.0) the other a commit number
- Loading branch information
Showing
10 changed files
with
315 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=ovn-kubernetes master service | ||
Requires=openvswitch.service | ||
After=openvswitch.service | ||
Requires=ovn-northd.service | ||
After=ovn-northd.service | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/sysconfig/ovn-kubernetes | ||
ExecStart=/usr/bin/ovn-kubernetes-master.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
source /etc/sysconfig/ovn-kubernetes | ||
|
||
function ovn-kubernetes-master() { | ||
echo "Enable and start ovn-kubernetes master services" | ||
/usr/bin/ovnkube \ | ||
--cluster-subnet "${cluster_cidr}" \ | ||
--init-master `hostname` \ | ||
--net-controller | ||
} | ||
|
||
ovn-kubernetes-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Provision ovn-kubernetes node service | ||
Requires=openvswitch.service | ||
After=openvswitch.service | ||
Requires=ovn-controller.service | ||
After=ovn-controller.service | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/sysconfig/ovn-kubernetes | ||
ExecStart=/usr/bin/ovn-kubernetes-node.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
source /etc/sysconfig/ovn-kubernetes | ||
|
||
function ovn-kubernetes-node() { | ||
|
||
echo "Enable and start ovn-kubernetes node services" | ||
/usr/bin/ovnkube \ | ||
--cluster-subnet "${cluster_cidr}" \ | ||
--init-node `hostname` | ||
} | ||
|
||
ovn-kubernetes-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ovn-kubernetes config - all nodes and masters | ||
|
||
# This file configures the ovn cni plugin. When completed or changed | ||
# the file must be copied to each ovn-master and each ovn-node. The | ||
# ovn-kubernetes-master and ovn-kubernetes-node daemons must be restarted. | ||
|
||
# This file and /etc/openvswitch/ovn_k8s.conf, in combination, provide | ||
# all of the configuration options. See man 5 ovn_k8s.conf | ||
|
||
# When changes are made, copy the file to each ovn-node and ovn-master | ||
# and restart ovn-kubernetes-master.service and ovn-kubernetes-node.service | ||
|
||
# cluster_cidr - this contains the clusterNetworkCIDR from | ||
# /etc/origin/master/master-config.yaml | ||
# cluster_cidr=10.128.0.0/14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,17 +18,18 @@ | |
%define _py2 python | ||
%endif | ||
|
||
Name: openvswitch-%{project} | ||
Summary: Open Virtual Networking Kubernetes Wedge | ||
Name: openvswitch-ovn-kubernetes | ||
Version: 0.2.0 | ||
Release: 1%{?dist} | ||
URL: https://www.github.com/openvswitch/ovn-kubernetes | ||
Version: 0.1.0 | ||
Release: 2%{?dist} | ||
# golang not supported | ||
ExcludeArch: ppc64 | ||
Summary: Open Virtual Networking Kubernetes Wedge | ||
|
||
License: ASL 2.0 | ||
Source0: https://github.com/openvswitch/ovn-kubernetes/archive/v%{version}.tar.gz | ||
|
||
# golang not supported | ||
ExcludeArch: ppc64 | ||
|
||
BuildRequires: %{_py2}-devel | ||
%if 0%{?fedora} > 22 || %{with build_python3} | ||
BuildRequires: python3-devel | ||
|
@@ -38,6 +39,22 @@ BuildRequires: golang | |
%description | ||
This allows kubernetes to use Open Virtual Networking (OVN) | ||
|
||
%package master | ||
Summary: ovn-kubernetes systemd for master | ||
License: ASL 2.0 | ||
#Requires: openvswitch-ovn-kubernetes systemd openvswitch | ||
|
||
%description master | ||
This allows systemd to control ovn on the master | ||
|
||
%package node | ||
Summary: ovn-kubernetes systemd for node | ||
License: ASL 2.0 | ||
#Requires: openvswitch-ovn-kubernetes systemd openvswitch | ||
|
||
%description node | ||
This allows systemd to control ovn on the node | ||
|
||
%prep | ||
%setup -q -n %{repo}-%{version} | ||
|
||
|
@@ -64,11 +81,33 @@ install -p -m 644 docs/ovn-k8s-overlay.1 %{buildroot}%{_mandir}/man1 | |
install -d -m 0750 %{buildroot}%{_mandir}/man5 | ||
install -p -m 644 docs/ovn_k8s.conf.5 %{buildroot}%{_mandir}/man5 | ||
|
||
install -p -D -m 0644 dist/files/ovn-kubernetes-master.service \ | ||
%{buildroot}%{_unitdir}/ovn-kubernetes-master.service | ||
install -p -D -m 0644 dist/files/ovn-kubernetes-node.service \ | ||
%{buildroot}%{_unitdir}/ovn-kubernetes-node.service | ||
install -p -m 755 dist/files/ovn-kubernetes-master.sh %{buildroot}%{_bindir} | ||
install -p -m 755 dist/files/ovn-kubernetes-node.sh %{buildroot}%{_bindir} | ||
install -p -D -m 0644 dist/files/ovn-kubernetes.sysconfig \ | ||
%{buildroot}%{_sysconfdir}/sysconfig/ovn-kubernetes | ||
|
||
%preun node | ||
%systemd_preun openvswitch-ovn-kubernetes-node | ||
|
||
%preun master | ||
%systemd_preun openvswitch-ovn-kubernetes-master | ||
|
||
%post node | ||
%systemd_post openvswitch-ovn-kubernetes-node | ||
|
||
%post master | ||
%systemd_post openvswitch-ovn-kubernetes-master | ||
|
||
|
||
%files | ||
%defattr(-,root,root) | ||
%license COPYING | ||
%doc CONTRIBUTING.md README.md | ||
%doc docs/config.md docs/debugging.md docs/INSTALL.K8S.md docs/INSTALL.SSL.md docs/INSTALL.UBUNTU.md | ||
%doc docs/config.md docs/debugging.md docs/INSTALL.SSL.md docs/INSTALL.UBUNTU.md | ||
%{_mandir}/man1/ovnkube.1.* | ||
%{_mandir}/man1/ovn-kube-util.1.* | ||
%{_mandir}/man1/ovn-k8s-overlay.1.* | ||
|
@@ -79,7 +118,21 @@ install -p -m 644 docs/ovn_k8s.conf.5 %{buildroot}%{_mandir}/man5 | |
%{_libexecdir}/cni/ovn-k8s-cni-overlay | ||
%config(noreplace) %{_sysconfdir}/openvswitch/ovn_k8s.conf | ||
|
||
%files node | ||
%{_unitdir}/ovn-kubernetes-node.service | ||
%{_bindir}/ovn-kubernetes-node.sh | ||
%config(noreplace) %{_sysconfdir}/sysconfig/ovn-kubernetes | ||
|
||
%files master | ||
%{_unitdir}/ovn-kubernetes-master.service | ||
%{_bindir}/ovn-kubernetes-master.sh | ||
|
||
|
||
%changelog | ||
* Fri Mar 23 2018 Phil Cameron <[email protected]> - 0.2.0-1 | ||
- Added packages for systemd packages openvswitch-ovn-kubernetes-node | ||
and openvswitch-ovn-kubernetes-master. | ||
|
||
* Thu Jan 25 2018 Phil Cameron <[email protected]> - 0.1.0-2 | ||
- Changed from referencing a commit to referencing a release | ||
in the source repo. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
%global project ovn-kubernetes | ||
%global git0 https://github.com/openvswitch/%{repo} | ||
# commit is the image that you want to build | ||
%global commit 73b46236d08ef2f38945e8f9a43f23d377540879 | ||
%global shortcommit %(c=%{commit}; echo ${c:0:7}) | ||
%global repo %{project} | ||
%global debug_package %{nil} | ||
|
||
# some distros (e.g: RHEL-7) don't define _rundir macro yet | ||
# Fedora 15 onwards uses /run as _rundir | ||
%if 0%{!?_rundir:1} | ||
%define _rundir /run | ||
%endif | ||
|
||
# define the python package prefix based on distribution version so that we can | ||
# simultaneously support RHEL-based and later Fedora versions in this spec file. | ||
%if 0%{?fedora} >= 25 | ||
%define _py2 python2 | ||
%endif | ||
|
||
%if 0%{?rhel} || 0%{?fedora} < 25 | ||
%define _py2 python | ||
%endif | ||
|
||
Name: openvswitch-ovn-kubernetes | ||
Version: %{commit} | ||
Release: 1%{?dist} | ||
URL: https://www.github.com/openvswitch/ovn-kubernetes | ||
Summary: Open Virtual Networking Kubernetes Wedge | ||
|
||
License: ASL 2.0 | ||
Source0: %{git0}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz | ||
|
||
# golang not supported | ||
ExcludeArch: ppc64 | ||
|
||
BuildRequires: %{_py2}-devel | ||
%if 0%{?fedora} > 22 || %{with build_python3} | ||
BuildRequires: python3-devel | ||
%endif | ||
BuildRequires: golang | ||
|
||
%description | ||
This allows kubernetes to use Open Virtual Networking (OVN) | ||
|
||
%package master | ||
Summary: ovn-kubernetes systemd for master | ||
License: ASL 2.0 | ||
#Requires: openvswitch-ovn-kubernetes systemd openvswitch | ||
|
||
%description master | ||
This allows systemd to control ovn on the master | ||
|
||
%package node | ||
Summary: ovn-kubernetes systemd for node | ||
License: ASL 2.0 | ||
#Requires: openvswitch-ovn-kubernetes systemd openvswitch | ||
|
||
%description node | ||
This allows systemd to control ovn on the node | ||
|
||
%prep | ||
%setup -q -n %{repo}-%{version} | ||
|
||
%build | ||
cd go-controller && make | ||
strip _output/go/bin/ovnkube | ||
strip _output/go/bin/ovn-kube-util | ||
strip _output/go/bin/ovn-k8s-overlay | ||
strip _output/go/bin/ovn-k8s-cni-overlay | ||
|
||
%install | ||
install -d -m 0750 %{buildroot}%{_bindir} | ||
install -d -m 0750 %{buildroot}%{_libexecdir}/cni | ||
install -p -m 755 go-controller/_output/go/bin/ovnkube %{buildroot}%{_bindir} | ||
install -p -m 755 go-controller/_output/go/bin/ovn-kube-util %{buildroot}%{_bindir} | ||
install -p -m 755 go-controller/_output/go/bin/ovn-k8s-overlay %{buildroot}%{_bindir} | ||
install -p -m 755 go-controller/_output/go/bin/ovn-k8s-cni-overlay %{buildroot}%{_libexecdir}/cni | ||
install -d -m 0750 %{buildroot}/etc/openvswitch | ||
install -p -m 644 go-controller/etc/ovn_k8s.conf %{buildroot}/etc/openvswitch | ||
install -d -m 0750 %{buildroot}%{_mandir}/man1 | ||
install -p -m 644 docs/ovnkube.1 %{buildroot}%{_mandir}/man1 | ||
install -p -m 644 docs/ovn-kube-util.1 %{buildroot}%{_mandir}/man1 | ||
install -p -m 644 docs/ovn-k8s-overlay.1 %{buildroot}%{_mandir}/man1 | ||
install -d -m 0750 %{buildroot}%{_mandir}/man5 | ||
install -p -m 644 docs/ovn_k8s.conf.5 %{buildroot}%{_mandir}/man5 | ||
|
||
install -p -D -m 0644 dist/files/ovn-kubernetes-master.service \ | ||
%{buildroot}%{_unitdir}/ovn-kubernetes-master.service | ||
install -p -D -m 0644 dist/files/ovn-kubernetes-node.service \ | ||
%{buildroot}%{_unitdir}/ovn-kubernetes-node.service | ||
install -p -m 755 dist/files/ovn-kubernetes-master.sh %{buildroot}%{_bindir} | ||
install -p -m 755 dist/files/ovn-kubernetes-node.sh %{buildroot}%{_bindir} | ||
install -p -D -m 0644 dist/files/ovn-kubernetes.sysconfig \ | ||
%{buildroot}%{_sysconfdir}/sysconfig/ovn-kubernetes | ||
|
||
%preun node | ||
%systemd_preun openvswitch-ovn-kubernetes-node | ||
|
||
%preun master | ||
%systemd_preun openvswitch-ovn-kubernetes-master | ||
|
||
%post node | ||
%systemd_post openvswitch-ovn-kubernetes-node | ||
|
||
%post master | ||
%systemd_post openvswitch-ovn-kubernetes-master | ||
|
||
|
||
%files | ||
%defattr(-,root,root) | ||
%license COPYING | ||
%doc CONTRIBUTING.md README.md | ||
%doc docs/config.md docs/debugging.md docs/INSTALL.SSL.md docs/INSTALL.UBUNTU.md | ||
%{_mandir}/man1/ovnkube.1.* | ||
%{_mandir}/man1/ovn-kube-util.1.* | ||
%{_mandir}/man1/ovn-k8s-overlay.1.* | ||
%{_mandir}/man5/ovn_k8s.conf.5.* | ||
%{_bindir}/ovnkube | ||
%{_bindir}/ovn-kube-util | ||
%{_bindir}/ovn-k8s-overlay | ||
%{_libexecdir}/cni/ovn-k8s-cni-overlay | ||
%config(noreplace) %{_sysconfdir}/openvswitch/ovn_k8s.conf | ||
|
||
%files node | ||
%{_unitdir}/ovn-kubernetes-node.service | ||
%{_bindir}/ovn-kubernetes-node.sh | ||
%config(noreplace) %{_sysconfdir}/sysconfig/ovn-kubernetes | ||
|
||
%files master | ||
%{_unitdir}/ovn-kubernetes-master.service | ||
%{_bindir}/ovn-kubernetes-master.sh | ||
|
||
|
||
%changelog | ||
* Fri Mar 23 2018 Phil Cameron <[email protected]> - 0.2.0-1 | ||
- Added packages for systemd packages openvswitch-ovn-kubernetes-node | ||
and openvswitch-ovn-kubernetes-master. | ||
|
||
* Thu Jan 25 2018 Phil Cameron <[email protected]> - 0.1.0-2 | ||
- Changed from referencing a commit to referencing a release | ||
in the source repo. | ||
|
||
* Fri Jan 12 2018 Phil Cameron <[email protected]> - 0.1.0-1 | ||
- Initial package for Fedora | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.