You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Calico

From Wikitech-static
Revision as of 06:56, 17 May 2017 by imported>Giuseppe Lavagetto (→‎calico/node and calicoctl)
Jump to navigation Jump to search

Calico is a virtual network infrastructure that we use to manage kubernetes networking.

Building

Following the integration guide there are a few things we need to rebuild, in order to stick to our policy of "internal builds only":

- the calico/node container - the calicoctl cli tool (which gets built as part of the calico/node build pipeline) - the calico-cni CNI plugins - the base cni plugins we'll be using

The next few sections will detail how to do each of these things.

calicoctl (and calico/node)

We keep a cloned/modified repository at operations/calico-containers. Please note that calico has renamed their repo to "calicoctl" in the meanwhile.

Download the needed version using the debian/repack scipt, then import it using gbp

# In the directory where you cloned calico-containers
/srv/calico $ debian/repack 1.2.1
...
/srv/calico $ gpb import-orig ../calico-containers-1.2.1.tar.xz
....
/srv/calico $ dch -v "1.2.1-1~wmf1"
/srv/calico $ git add debian/changelog && git commit -m "Updating debian version"
# Now build calicoctl; this will also apply the needed patches to the dockerfiles
/srv/calico $ gbp buildpackage
...
/srv/calico $ make calico-node node-test-containerized

The resulting calico-node container will need to be tagged appropriately and pushed to the registry.

calico-cni

Download the needed version using the debian/repack script, then import it using gbp

# In the directory where you cloned operations/calico-cni
/srv/calico-cni $ debian/repack 1.8.3
Downloading calico-cni-1.8.3
Repackaged in /srv/calico-cni-1.8.3.tar.xz
Cleaned up the working directory '/tmp/tmp.Yj51DNj'
/srv/calico-cni $ gbp import-orig ../calico-cni-1.8.3.tar.xz
What is the upstream version? [1.8.3] 
gbp:info: Importing '../calico-cni-1.8.3.tar.xz' to branch 'upstream'...
gbp:info: Source package is calico-cni
gbp:info: Upstream version is 1.8.3
gbp:info: Merging to 'master'
gbp:info: Successfully imported version 1.8.3 of ../calico-cni-1.8.3.tar.xz
/srv/calico-cni $ dch -v "1.8.3-1~wmf1"
/srv/calico-cni $ git add debian/changelog
/srv/calico-cni $ git commit -m 'Updating debian version'
[master a9c31a1] Updating debian version
 1 file changed, 6 insertions(+)
/srv/calico-cni $ gbp buildpackage
...

Please note that this will result in a "dirty" package as we're downloading all go dependencies directly and not "the debian way". This might change once the number of natively supported libraries becomes larger