Skip to content
Project Calico's per-host agent Felix, responsible for programming routes and security policy.
Branch: master
Clone or download
fasaxc Merge pull request #2042 from fasaxc/fix-bpf-licenses
Include explicit license in BPF programs.
Latest commit d1200f5 Jun 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add CODEOWNERS file Sep 12, 2018
bpf Fix XDP test hash. Jun 14, 2019
buildinfo Fix up Golang imports after moving go files. Jan 26, 2017
calc Added code and test to enable vxlan MAC if present in node spec. Jun 3, 2019
check-licenses license-checker: Fix licenses of the new dependencies Apr 11, 2019
cmd/calico-felix Allow others to import and run Felix May 31, 2018
config Revert "bpf, config, dataplane: Add a cgroup-v2 subdir parameter" Jun 12, 2019
conntrack Enable test reports for all tests and save reports with different fil… Sep 12, 2018
daemon Add UT May 2, 2019
dataplane Revert "bpf, config, dataplane: Add a cgroup-v2 subdir parameter" Jun 12, 2019
debian Delete historical packaging changelogs Oct 29, 2018
dispatcher Replace log.Fatal with log.Panic in most cases. Aug 31, 2017
docker-build-images bpf: Implement bpftool library in Go for Felix Apr 11, 2019
docker-image Fixes for FV tests after switching image May 7, 2019
docs Bring calc graph diagram up to date. Aug 31, 2017
etc Improve calico-diags redaction. Apr 26, 2018
fv fv: Address review issues Jun 12, 2019
git-hooks Merge pull request #1991 from kinvolk/kinvolk/fast-blacklist Apr 12, 2019
hashutils Enable test reports for all tests and save reports with different fil… Sep 12, 2018
ifacemonitor Applying code review recommenations: do all validation and compiling … Mar 18, 2019
ip VXLAN dataplane and calculation graph changes Apr 5, 2019
ipsets dataplane: make blocking traffic more performant for some kind of pol… Apr 11, 2019
iptables Filter the source of VXLAN traffic to calico nodes only. Apr 17, 2019
jitter Enable test reports for all tests and save reports with different fil… Sep 12, 2018
k8sfv Enable test reports for all tests and save reports with different fil… Sep 12, 2018
labelindex Enable test reports for all tests and save reports with different fil… Sep 12, 2018
logutils Removed windows code to cleanup code base. Mar 14, 2019
markbits Enable test reports for all tests and save reports with different fil… Sep 12, 2018
multidict Enable test reports for all tests and save reports with different fil… Sep 12, 2018
policysync Enable test reports for all tests and save reports with different fil… Sep 12, 2018
proto VXLAN dataplane and calculation graph changes Apr 5, 2019
report Enable test reports for all tests and save reports with different fil… Sep 12, 2018
routetable VXLAN dataplane and calculation graph changes Apr 5, 2019
rpm Avoid changing tracked files; ignore generated packaging Oct 29, 2018
rules Add support for NATOutgoingAddress option Jun 6, 2019
statusrep Avoid ambiguous meaning for empty Region field Jan 17, 2019
stringutils Enable test reports for all tests and save reports with different fil… Sep 12, 2018
testutils Move go code up to main directory. Jan 26, 2017
throttle Enable test reports for all tests and save reports with different fil… Sep 12, 2018
usagerep Enable test reports for all tests and save reports with different fil… Sep 12, 2018
utils Fix tilde heuristic for initial 'v' Apr 23, 2019
versionparse versionparse, iptables: Move version parsing to a separate package Apr 11, 2019
.fossa.yml Add foss checks make target Dec 24, 2018
.gitignore Makefile: improve bpf builds Jun 12, 2019
CHANGES.md Version 2.0.0-beta.3 Nov 7, 2016
CONTRIBUTING.md Cleanup README, CONTRIBUTING and unused file. Jan 27, 2017
LICENSE Project Calico version 0.1 Jun 26, 2014
Makefile Fix that packr can make a non-goimported file. Jun 14, 2019
README.md Fix README typo. Oct 24, 2018
RELEASING.md Delete historical packaging changelogs Oct 29, 2018
glide.lock Automated Typha pin update Jun 13, 2019
glide.yaml Automated Typha pin update Jun 13, 2019
install-git-hooks Add commit hook that checks copyright and license. Jun 23, 2016

README.md

Build Status Coverage Status Slack Status IRC Channel

Project Calico

Note that the documentation in this repo is targeted at Calico contributors.

Documentation for Calico users is here:
http://docs.projectcalico.org

This repository contains the source code for Project Calico's per-host daemon, Felix.

How can I get support for contributing to Project Calico?

The best place to ask a question or get help from the community is the calico-users #slack. We also have an IRC channel.

Who is behind Project Calico?

Tigera, Inc. is the company behind Project Calico and is responsible for the ongoing management of the project. However, it is open to any members of the community – individuals or organizations – to get involved and contribute code.

Contributing

Thanks for thinking about contributing to Project Calico! The success of an open source project is entirely down to the efforts of its contributors, so we do genuinely want to thank you for even thinking of contributing.

Before you do so, you should check out our contributing guidelines in the CONTRIBUTING.md file, to make sure it's as easy as possible for us to accept your contribution.

How do I build Felix?

Felix mostly uses Docker for builds. We develop on Ubuntu 16.04 but other Linux distributions should work (there are known Makefile issues that prevent building on OS X).
To build Felix, you will need:

  • A suitable linux box.
  • To check out the code into your GOPATH.
  • Docker >=1.12
  • GNU make.
  • Plenty of disk space (since the builds use some heavyweight full-OS containers in order to build debs and RPMs).

Then, as a one-off, run

make update-tools

which will install a couple more go tools that we haven't yet containerised.

Then, to build the calico-felix binary:

make build

or, the calico/felix docker image:

make image

Other architectures

When you run make build or make image, it creates the felix binary or docker image for linux on your architecture. The outputs are as follows:

  • Binary: bin/calico-felix-${ARCH}, e.g. bin/calico-felix-amd64 or bin/calico-felix-arm64
  • Image: calico/felix:${TAG}-${ARCH}, e.g. calico/felix:3.0.0-amd64 or calico/felix:latest-ppc64le

When you are running on amd64, you can build the binaries and images for other platforms by setting the ARCH variable. For example:

$ make build ARCH=arm64 # OR
$ make image ARCH=ppc64le

If you wish to make all of the binaries or images, use the standard calico project targets build-all and image-all:

$ make build-all # OR
$ make image-all

Note that the image and image-all targets have the build targets as a depedency.

How can I run Felix's unit tests?

To run all the UTs:

make ut

To start a ginkgo watch, which will re-run the relevant UTs as you update files:

make ut-watch

To get coverage stats:

make cover-report

or

make cover-browser

How can I run a subset of the go unit tests?

If you want to be able to run unit tests for specific packages for more iterative development, you'll need to install

  • GNU make
  • go >=1.10

then run make update-tools to install ginkgo, which is the test tool used to run Felix's unit tests.

There are several ways to run ginkgo. One option is to change directory to the package you want to test, then run ginkgo. Another is to use ginkgo's watch feature to monitor files for changes:

cd go
ginkgo watch -r

Ginkgo will re-run tests as files are modified and saved.

How do I build packages/run Felix?

Docker

After building the docker image (see above), you can run Felix and log to screen with, for example:

docker run --privileged \
           --net=host \
           -v /run:/run \
           -e FELIX_LOGSEVERITYSCREEN=INFO \
           calico/felix

Notes:

  • --privileged is required because Felix needs to execute iptables and other privileged commands.
  • --net=host is required so that Felix can manipulate the routes and iptables tables in the host namespace (outside its container).
  • -v /run:/run is required so that Felix shares the global iptables file lock with other processes; this allows Felix and other daemons that manipulate iptables to avoid clobbering each other's updates.
  • -e FELIX_LOGSEVERITYSCREEN=INFO tells Felix to log at info level to stderr.

Debs and RPMs

The Makefile has targets for building debs and RPMs for different platforms. By using docker, the build does not need to be run on the target platform.

make deb
make rpm

The packages (and source packages) are output to the dist directory.

You can’t perform that action at this time.