Skip to content

Instantly share code, notes, and snippets.

@anfernee
Last active January 4, 2023 02:12
Show Gist options
  • Save anfernee/7ae71a1c96825566618d76ca327dff74 to your computer and use it in GitHub Desktop.
Save anfernee/7ae71a1c96825566618d76ca327dff74 to your computer and use it in GitHub Desktop.

THE PR

The PR contains 2 commits: one fix to the datapath; the other e2e test which tests both the fix and the basic funtionatlity. The problem is the basic functionality part fails the e2e test. However, it is only reproducible in e2e test, not in dev cluster. We also included the same functionality in Anthos. I haven't figured out the reason.

Prerequisite

You would need a Linux machine (Ubuntu is fine), and install virtualbox on the machine.

How to start a dev cluster

First I export these environment variables, then run the start.sh script:

export K8S=1
export NWORKERS=2
export VM_MEMORY=4096
export NETNEXT=true
export NO_BUILD=1
./contrib/vagrant/start.sh

It will start one master node and two worker nodes in the cluster, you can use the following command to check vm status and ssh into the cluster node.

vagrant status
vagrant ssh <node-name>

Inside the node /home/vagrant/go/src/github.com/cilium/cilium is mounted as ssh client to the cilium root folder in your machine, so any change to your codebase will be here in the VM as well. Very convenient. I recommend building from host machine. Building within the dev machine doesn't work (I have lock fs problem in a nfs client).

# in VM
sudo make install
sudo make install-bpf

e2e test

To kick off the e2e test:

cd test
sudo NETNEXT=1 KUBEPROXY=0 K8S_NODES=3 NO_CILIUM_ON_NODE="k8s3" ginkgo -v --focus="K8sEgressGatewayTest" -- -cilium.provision=true -cilium.testScope="k8s" -cilium.holdEnvironment=true -cilium.skipLogs=true

When the test failed, it will hold the process and the environment for you to debug.

Verifier Test

KUBEPROXY=0 K8S_NODES=1 ginkgo1 -v --focus="K8sDatapathVerifier" -- -cilium.provision=true -cilium.testScope="k8s" -cilium.holdEnvironment=true -cilium.skipLogs=true

Reference

https://docs.cilium.io/en/v1.9/contributing/testing/e2e/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment