Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding ability to define a floating ip for a kubernetes workload via annotation #419
This PR adds the ability to define DNAT/floating IP for a kubernetes workload via annotation. Most of the plumbing was already in place, this adds the missing link.
Thanks for the submission and for adding a unit test. I spotted a couple of minor issues. Please can you fix those up?
Ideally, we'd like to have an end-to-end test of this function that test that packet actually flow as expected. Is that something you'd be able to add (in the calico repo).
@caseydavenport reminded me that this change will only cover our etcd mode, please can you add support for the kubernetes datastore driver too (where we directly map Pods to WorkloadEndpoints in the datastore layer)?
That means adding similar logic to this function to copy the annotation into the WorkloadEndpoint: https://github.com/projectcalico/libcalico-go/blob/master/lib/backend/k8s/conversion/conversion.go#L171