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

Calico: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Giuseppe Lavagetto
imported>Giuseppe Lavagetto
No edit summary
Line 51: Line 51:
/srv/calico-cni $ gbp buildpackage
/srv/calico-cni $ gbp buildpackage
...
...
</syntaxhighlight>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
</syntaxhighlight>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.
 
=== calico-k8s-policy-controller ===
Configure your repository to have an upstream to track the calico upstream:<syntaxhighlight lang="bash">
$ git remote show upstream
* remote upstream
  Fetch URL: https://github.com/projectcalico/k8s-policy.git
  Push  URL: https://github.com/projectcalico/k8s-policy.git
  HEAD branch: master
 
</syntaxhighlight>Then checkout a branch for the desired tag<syntaxhighlight lang="bash">
git remote update
git checkout -b 0.6.0 v0.6.0
# Fix the Dockerfile
git cherry-pick fbf840d180e4b70f56f02e9d616adf9ed9cd8523
git push origin 0.6.0
</syntaxhighlight>Finally, rebuild the docker container (this can be managed via the build-calico script)

Revision as of 06:55, 22 May 2017

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.

calico-k8s-policy-controller

Configure your repository to have an upstream to track the calico upstream:

$ git remote show upstream
* remote upstream
  Fetch URL: https://github.com/projectcalico/k8s-policy.git
  Push  URL: https://github.com/projectcalico/k8s-policy.git
  HEAD branch: master

Then checkout a branch for the desired tag

git remote update
git checkout -b 0.6.0 v0.6.0
# Fix the Dockerfile
git cherry-pick fbf840d180e4b70f56f02e9d616adf9ed9cd8523
git push origin 0.6.0

Finally, rebuild the docker container (this can be managed via the build-calico script)