https://github.com/cilium/cilium
Revision dcf89059d00bcde91aacc0c4849b89bc1bcea966 authored by John Fastabend on 17 February 2021, 00:44:56 UTC, committed by John Fastabend on 21 February 2021, 06:54:30 UTC
In the default mode encryption picks the outer IP headers to use
based on the destination IP of the packet to be encrypted. This
works because we create a IPSec rule that matches the destination
IP of the packet using the node CIDR IP used to allocate IPs for
that node. This allows us to scale rules with number of nodes
instead of number of pods.

However, in modes where a global IP pool is used for any pods we
no longer have a subnet -> pod mapping that we use above. To
handle this case, instead of adding a rule per pod, we rewrite
the srcIP,dstIP after encryption using the ipcache. The ipcache
has the pod->node mapping so we can use this reliable. Then we
do a fib lookup to rewrite the src/dst MAC and redirect out the
correct egress interface.

But, we have a bug where nodeEncrypt routing rules are added
even if encryptNode is not enabled. Additionally, when encryptNode
is enabled we add wrong and possibly conflicting rules from the
normal path.

To fix ensure we only add encryptNode routes correctlyy from the
subnetEncryption path with ipv4-pod-subnets is enabled.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
1 parent 42eb1ed
History
Tip revision: dcf89059d00bcde91aacc0c4849b89bc1bcea966 authored by John Fastabend on 17 February 2021, 00:44:56 UTC
cilium: encryption fix, ipv4-pod-subnets without encryptnode fails
Tip revision: dcf8905
File Mode Size
_static
cmdref
concepts
configuration
contributing
gettingstarted
images
operations
policy
.dockerignore -rw-r--r-- 69 bytes
.gitignore -rw-r--r-- 42 bytes
Dockerfile -rw-r--r-- 729 bytes
Makefile -rw-r--r-- 2.3 KB
api.rst -rw-r--r-- 3.0 KB
beta.rst -rw-r--r-- 123 bytes
bpf.rst -rw-r--r-- 208.3 KB
cheatsheet.rst -rw-r--r-- 8.9 KB
check-build.sh -rwxr-xr-x 2.3 KB
check-cmdref.sh -rwxr-xr-x 336 bytes
check-crd-compat-table.sh -rwxr-xr-x 4.6 KB
check-examples.sh -rwxr-xr-x 593 bytes
commit-access.rst -rw-r--r-- 19.1 KB
community.rst -rw-r--r-- 4.7 KB
conf.py -rw-r--r-- 7.7 KB
further_reading.rst -rw-r--r-- 359 bytes
gettinghelp.rst -rw-r--r-- 1.5 KB
glossary.rst -rw-r--r-- 2.1 KB
hubble.rst -rw-r--r-- 5.6 KB
index.rst -rw-r--r-- 2.2 KB
intro.rst -rw-r--r-- 5.7 KB
kvstore.rst -rw-r--r-- 7.6 KB
requirements.txt -rw-r--r-- 733 bytes
runtime.txt -rw-r--r-- 4 bytes
spelling_wordlist.txt -rw-r--r-- 7.8 KB
tech-preview.rst -rw-r--r-- 187 bytes
update-cmdref.sh -rwxr-xr-x 625 bytes
update-spelling_wordlist.sh -rwxr-xr-x 354 bytes
yaml.config -rw-r--r-- 97 bytes

back to top