diff --git a/_constraints b/_constraints deleted file mode 100644 index a6a4866..0000000 --- a/_constraints +++ /dev/null @@ -1,7 +0,0 @@ - - - - 6 - - - diff --git a/_service b/_service deleted file mode 100644 index 340c7c6..0000000 --- a/_service +++ /dev/null @@ -1,16 +0,0 @@ - - - git - git@github.com:coreos/flannel.git - .git - flannel - 0.9.1 - v0.9.1 - enable - - - *.tar - xz - - - diff --git a/flannel-0.11.0.tar.gz b/flannel-0.11.0.tar.gz new file mode 100644 index 0000000..bcbe6bf --- /dev/null +++ b/flannel-0.11.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:476c886ddc06a8afcf54e181ac55579224c6be424089567a0b8d9e93dd08a053 +size 6443391 diff --git a/flannel-0.9.1.tar.xz b/flannel-0.9.1.tar.xz deleted file mode 100644 index fbf4dfe..0000000 --- a/flannel-0.9.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b4beb5f5b477ae8b7efc6d7c63db075afef0ae04a03a427160191aaf75244ab -size 5114448 diff --git a/flannel-docker.conf b/flannel-docker.conf deleted file mode 100644 index 839d473..0000000 --- a/flannel-docker.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=-/run/flannel/docker diff --git a/flannel-tmpfiles.conf b/flannel-tmpfiles.conf deleted file mode 100644 index 02ace2f..0000000 --- a/flannel-tmpfiles.conf +++ /dev/null @@ -1 +0,0 @@ -d /run/flannel 0755 root root - diff --git a/flannel.changes b/flannel.changes index ec510f2..b54dd13 100644 --- a/flannel.changes +++ b/flannel.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Tue Apr 9 11:45:05 CEST 2019 - kukuk@suse.de + +- Require minimal set of used network utilities + +------------------------------------------------------------------- +Mon Apr 8 13:56:16 CEST 2019 - kukuk@suse.de + +- Add flannel-k8s-yaml sub-package with the yaml file to deploy + flannel. + +------------------------------------------------------------------- +Mon Apr 8 13:24:07 CEST 2019 - kukuk@suse.de + +- Update to flannel 0.11.0 +- Drop standalone support, it's only for containers +- Drop use-32-prefix-udp-backend.patch, included upstream + ------------------------------------------------------------------- Wed Dec 19 16:55:33 UTC 2018 - clee@suse.com diff --git a/flannel.spec b/flannel.spec index 89f17a4..34fd6d3 100644 --- a/flannel.spec +++ b/flannel.spec @@ -1,7 +1,7 @@ # # spec file for package flannel # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017, 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,37 +15,31 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - #Compat macro for new _fillupdir macro introduced in Nov 2017 %if ! %{defined _fillupdir} %define _fillupdir /var/adm/fillup-templates %endif Name: flannel -Version: 0.9.1 +Version: 0.11.0 Release: 0 Summary: An etcd backed network fabric for containers License: Apache-2.0 Group: System/Management Url: https://github.com/coreos/flannel -Source: %{name}-%{version}.tar.xz -Source1: flanneld.sysconf -Source2: flanneld.service -Source3: flannel-docker.conf -Source4: flannel-tmpfiles.conf -Patch1: use-32-prefix-udp-backend.patch +Source: %{name}-%{version}.tar.gz +Requires: iproute2 +# arp is used: +Requires: net-tools-deprecated +Requires: iptables BuildRequires: golang-packaging -BuildRequires: systemd -BuildRequires: xz BuildRequires: golang(API) >= 1.11 # go1.11.3 contains sec. fixes bsc#1118897(CVE-2018-16873) bsc#1118897(CVE-2018-16873) bsc#1118899(CVE-2018-16875) BuildRequires: go1.11 >= 1.11.3 -Requires(post): %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build ExcludeArch: s390 %{go_nostrip} %{go_provides} -%{?systemd_requires} %description flannel is a virtual network that gives a subnet to each host for use with @@ -55,9 +49,26 @@ Platforms like Google's Kubernetes assume that each container (pod) has a unique, routable IP inside the cluster. The advantage of this model is that it reduces the complexity of doing port mapping. +This package contains the binary to be included into a container image + +%package k8s-yaml +Summary: Kubernetes yaml file to run flannel container +Group: System/Management +BuildArch: noarch + +%description k8s-yaml +This package contains the yaml file requried to download and run the +flannel container in a kubernetes cluster. + +flannel is a virtual network that gives a subnet to each host for use with +container runtimes. + +Platforms like Google's Kubernetes assume that each container (pod) has a +unique, routable IP inside the cluster. The advantage of this model is that it +reduces the complexity of doing port mapping. + %prep %setup -q -%patch1 -p1 %build gofmt -w -r "x -> \"%{version}\"" version/version.go @@ -68,56 +79,31 @@ gofmt -w -r "x -> \"%{version}\"" version/version.go %{goinstall} rm -rf %{buildroot}/%{_libdir}/go/contrib -# Service -install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/docker.service.d/flannel.conf - -install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/flanneld.service -install -d %{buildroot}/%{_sbindir} -ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcflanneld - -# Sysconfig -install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.flanneld -install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf +# Install provided yaml file to download and run the flannel container +mkdir -p %{buildroot}%{_datadir}/k8s-yaml/flannel +install -m 0644 Documentation/kube-flannel.yml %{buildroot}%{_datadir}/k8s-yaml/flannel/kube-flannel.yaml +sed -i -e 's|image: quay.io/coreos/flannel:.*|image: registry.opensuse.org/home/kukuk/container/container/kubic/flannel:%{version}|g' %{buildroot}%{_datadir}/k8s-yaml/flannel/kube-flannel.yaml # Additional install -D -p -m 0755 dist/mk-docker-opts.sh %{buildroot}%{_libexecdir}/flannel/mk-docker-opts.sh # Move +mkdir -p %{buildroot}%{_sbindir} mv %{buildroot}%{_bindir}/flannel %{buildroot}%{_sbindir}/flanneld -%pre -%service_add_pre flanneld.service - -%post -%service_add_post flanneld.service -%{_bindir}/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf -%{fillup_only -n flanneld} - -%preun -%service_del_preun flanneld.service - -%postun -%service_del_postun flanneld.service - %files %defattr(-,root,root) -%doc CONTRIBUTING.md README.md DCO NOTICE +%doc README.md DCO NOTICE %license LICENSE %{_sbindir}/flanneld -# Service -%dir %{_unitdir}/docker.service.d -%{_unitdir}/docker.service.d/flannel.conf -%{_unitdir}/flanneld.service -%{_sbindir}/rcflanneld - -# Sysconfig -%{_fillupdir}/sysconfig.flanneld -%{_tmpfilesdir}/%{name}.conf -%attr(0750,root,root) %dir %ghost %{_rundir}/%{name} - # Additional %dir %{_libexecdir}/flannel %{_libexecdir}/flannel/mk-docker-opts.sh +%files k8s-yaml +%dir %{_datarootdir}/k8s-yaml +%dir %{_datarootdir}/k8s-yaml/flannel +%{_datarootdir}/k8s-yaml/flannel/kube-flannel.yaml + %changelog diff --git a/flanneld.service b/flanneld.service deleted file mode 100644 index 52534ad..0000000 --- a/flanneld.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Flanneld overlay address etcd agent -After=network.target -After=network-online.target -Wants=network-online.target -After=etcd.service -Before=docker.service - -[Service] -Type=notify -EnvironmentFile=/etc/sysconfig/flanneld -EnvironmentFile=-/etc/sysconfig/docker-network -ExecStart=/usr/sbin/flanneld -etcd-endpoints=${FLANNEL_ETCD_ENDPOINTS} -etcd-prefix=${FLANNEL_ETCD_KEY} $FLANNEL_OPTIONS -ExecStartPost=/usr/lib/flannel/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/docker -Restart=on-failure - -[Install] -WantedBy=multi-user.target -RequiredBy=docker.service diff --git a/flanneld.sysconf b/flanneld.sysconf deleted file mode 100644 index 43f4e66..0000000 --- a/flanneld.sysconf +++ /dev/null @@ -1,7 +0,0 @@ -# Flanneld configuration options - -# etcd url location. Point this to the server where etcd runs -FLANNEL_ETCD_ENDPOINTS="http://127.0.0.1:2379" - -# Any additional options that you want to pass -#FLANNEL_OPTIONS="" diff --git a/use-32-prefix-udp-backend.patch b/use-32-prefix-udp-backend.patch deleted file mode 100644 index e639242..0000000 --- a/use-32-prefix-udp-backend.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ed425bdd6fefacb0f06b35fa8f4caedf042dc84d Mon Sep 17 00:00:00 2001 -From: "Cel A. Skeggs" -Date: Thu, 1 Feb 2018 17:49:12 -0500 -Subject: [PATCH] backend/udp: Use a /32 prefix for the flannel0 interface - -This avoids the kernel's creation of broadcast routes, which prevent -communication from the host with the zeroth subnet to containers on any -other hosts. ---- - backend/udp/udp_network.go | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/backend/udp/udp_network.go b/backend/udp/udp_network.go -index 1f9752f8..242ebf49 100644 ---- a/backend/udp/udp_network.go -+++ b/backend/udp/udp_network.go -@@ -153,9 +153,15 @@ func configureIface(ifname string, ipn ip.IP4Net, mtu int) error { - return fmt.Errorf("failed to lookup interface %v", ifname) - } - -- err = netlink.AddrAdd(iface, &netlink.Addr{IPNet: ipn.ToIPNet(), Label: ""}) -+ // Ensure that the device has a /32 address so that no broadcast routes are created. -+ // This IP is just used as a source address for host to workload traffic (so -+ // the return path for the traffic has an address on the flannel network to use as the destination) -+ ipnLocal := ipn -+ ipnLocal.PrefixLen = 32 -+ -+ err = netlink.AddrAdd(iface, &netlink.Addr{IPNet: ipnLocal.ToIPNet(), Label: ""}) - if err != nil { -- return fmt.Errorf("failed to add IP address %v to %v: %v", ipn.String(), ifname, err) -+ return fmt.Errorf("failed to add IP address %v to %v: %v", ipnLocal.String(), ifname, err) - } - - err = netlink.LinkSetMTU(iface, mtu)