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>JMeybohm
m (sudo -i for pushing calico images)
imported>JMeybohm
No edit summary
Line 6: Line 6:
Because of that, you will need to set [[HTTP proxy]] variables for internet access on the build host.
Because of that, you will need to set [[HTTP proxy]] variables for internet access on the build host.


The general process to follow is:*Check out {{Gitweb|project=operations/debs/calico}} on your workstation
The general process to follow is:
*Check out {{Gitweb|project=operations/debs/calico}} on your workstation
*Decide if you want to package a new master (production) or future (potential next production) version
*Decide if you want to package a new master (production) or future (potential next production) version
*Create a patch to bump the debian changelog
*Create a patch to bump the debian changelog
Line 31: Line 32:
https_proxy=http://webproxy.$(hostname -d):8080 DIST=<dist> pdebuild
https_proxy=http://webproxy.$(hostname -d):8080 DIST=<dist> pdebuild
</syntaxhighlight>
</syntaxhighlight>
== Updating helm charts ==
There are two helm charts that might need updating, depending on the changes in a newly packaged calico version:
* {{Gitweb|project=operations/deployment-charts|file=charts/calico}}
* {{Gitweb|project=operations/deployment-charts|file=charts/calico-crds}}
==Publishing==
==Publishing==


Line 55: Line 63:
rm -rf $tmpd
rm -rf $tmpd
</syntaxhighlight>
</syntaxhighlight>
==Updating==
*Update debian packages calicoctl and calico-cni on kubernetes nodes using [[Debdeploy]]
*Update <code>image.tag</code> version in <code>helmfile.d/admin_ng/values/<Cluster>/calico-values.yaml</code>
**Deploy to the cluster(s) that you want updated

Revision as of 15:15, 6 January 2021

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

Packaging

We don't actually build calico but package it's components from upstream binary releases.

Because of that, you will need to set HTTP proxy variables for internet access on the build host.

The general process to follow is:

  • Check out operations/debs/calico on your workstation
  • Decide if you want to package a new master (production) or future (potential next production) version
  • Create a patch to bump the debian changelog
export NEW_VERSION=3.16.5 # Calico version you want to package
dch -v ${NEW_VERSION}-1 -D unstable "Update to v${NEW_VERSION}"
git commit debian/changelog

# If you're packaging a new future version, make sure to submit the patch to the correct branch
git review future
git checkout future # If you want to build a new version not directly to be released to production

# Ensure you allow networking in pbuilder
# This option needs to be in the file, an environment variable will *not* work!
echo "USENETWORKING=yes" >> ~/.pbuilderrc

# Build the package
https_proxy=http://webproxy.$(hostname -d):8080 DIST=<dist> pdebuild

Updating helm charts

There are two helm charts that might need updating, depending on the changes in a newly packaged calico version:

Publishing

The Debian Packages

# On apt1001, copy the packages from the build host
rsync -vaz deneb.codfw.wmnet::pbuilder-result/<dist>-amd64/calico*<PACKAGE VERSION>* .

# If you want to import a new production version, import to component main
sudo -i reprepro -C main --ignore=wrongdistribution include <dist>-wikimedia /path/to/<PACKAGE>.changes

# If you want to import a test/pre-production version, import to component calico-future
sudo -i reprepro -C component/calico-future --ignore=wrongdistribution include <dist>-wikimedia /path/to/<PACKAGE>.changes

The Docker Images

Calico also includes a bunch of docker images which need to be published into our docker registry. To simplify the process, the packaging generates a debian package named "calico-images" that includes the images as well as a script to publish them:

# On the build host, extract the calico-images debian package
tmpd=$(mktemp -d)
dpkg -x /var/cache/pbuilder/result/<dist>-amd64/calico-images_<PACKAGE_VERSION>_amd64.deb $tmpd

# Load and push the images
sudo -i CALICO_IMAGE_DIR=${tmpd}/usr/share/calico ${tmpd}/usr/share/calico/push-calico-images.sh
rm -rf $tmpd

Updating

  • Update debian packages calicoctl and calico-cni on kubernetes nodes using Debdeploy
  • Update image.tag version in helmfile.d/admin_ng/values/<Cluster>/calico-values.yaml
    • Deploy to the cluster(s) that you want updated