node/README.md
This repository contains the source for the calico/node container.
For users who want to learn more about the project or get started with Calico, see the documentation on docs.projectcalico.org.
Contributions to this code are welcome! Before starting, make sure you've read the Calico contributor guide.
The entire build can be run within a container, which means the only dependencies you'll need are a functioning Docker installation.
The code in this repository can be built and tested using the Makefile.
make calico/node will produce the calico/node docker image.For more information, see make help.
Tests for this repo are divided into the following categories:
fv: Package scoped testsst: System integration testsk8s-test: Kubernetes integration testsAssuming you have installed the necessary dependencies (see below for details), you can run any of the above categories using:
make <target>
Where target is one of fv, st, or k8s-test. You can also use test, which aggregates fv and st.
If you want to be able to run tests locally, you will need to install:
For st system integration tests, node uses:
For fv packaged scoped tests, node uses:
You will also need to install Ginkgo explicitly:
go get -u github.com/Masterminds/glide
go get -u github.com/onsi/ginkgo/ginkgo
For k8s-test Kubernetes tests, you will need to have kubectl setup on your machine. Go here for instructions on setting up kubectl for your environment.
If you want to run tests for a specific package for more iterative development, you can filter down into a subset of tests using the following parameters:
st tests, use ST_TO_RUNk8s-test tests, use K8ST_TO_RUNFor example, the following only runs tests within the bgp subfolder of the st category:
make st ST_TO_RUN="tests/st/bgp/"
To only run tests from a single file (e.g. test_bgp.py), use the following:
make st ST_TO_RUN="tests/st/bgp/test_bgp.py"
To only run a single test within a test file use the below syntax:
make st ST_TO_RUN="tests/st/bgp/test_bgp.py:TestReadiness.test_readiness_multihost"
The above examples should apply in the same fashion if you are using K8ST_TO_RUN instead for the k8s-test category.
There are a number of possible avenues you can use to debug failing tests.
DEBUG_FAILURES with the Makefilemake st DEBUG_FAILURES=true
st testsst are wrapped by debug_failures(fn) function found in ./tests/st/utils/utils.pypdb.set_trace() library function, allows you to halt executing and step into the containers involved in the test for debuggingtime.sleep(x))Below is a listing of userspace tools packaged into the node container. The list is not exhaustive, but highlights some of the key dependencies required for node to operate correctly.
/usr/sbin/arp
net-tools/usr/sbin/conntrack
conntrack/bin/ip
iproute2/usr/sbin/iptables
iptables-legacy → xtables-legacy-multi (divergence introduced in iptables v1.8.2)iptables/usr/sbin/iptables-restore
iptables-legacy-restore → xtables-legacy-multi (divergence introduced in iptables v1.8.2)iptables/usr/sbin/iptables-save
iptables-legacy-save → xtables-legacy-multi (divergence introduced in iptables v1.8.2)iptables/usr/sbin/ip6tables
ip6tables-legacy → xtables-legacy-multi (divergence introduced in iptables v1.8.2)iptables/usr/sbin/ip6tables-restore
ip6tables-legacy-restore → xtables-legacy-multi (divergence introduced in iptables v1.8.2)iptables/usr/sbin/ip6tables-save
ip6tables-legacy-save → xtables-legacy-multi (divergence introduced in iptables v1.8.2)iptables/bin/ps
procps/bin/kmod
depmod, insmod, lsmod, modinfo, modprobe, rmmokmod/sbin/runit
runit/usr/sbin/runsvchdir
runitCalico binaries are licensed under the Apache v2.0 license, with the exception of some GPL licensed eBPF programs.
Calico imports packages with a number of apache-compatible licenses. For more information, see licenses. In addition, the base container image contains pre-packaged software with a variety of licenses.