Closed murali-reddy closed 5 years ago
Gateway manager part is fully functional now. Please follow below step to try out.
On any kubernetes cluster with more than 3 nodes you can try below steps:
kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-crd.yaml
kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-gateway-manager.yaml
Now at this point static-egress-gateway-manager
components performs following on any applied staticegressip
custom resources
staticegressip
resource and update the status
object with Gateway
fieldstatic-egress-gateway-manager
itslef runs as HA mode with only one instance at a time actin as leader.
Please note that this steps only for testing logic to choose gateway for static egress IP and detect node failures and switch over to a different gateway.
For actual data-path configurations and routing changes to director and gateway you need to install kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-controller.yaml
Updating instruction for testing end-to-end functionality:
kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-crd.yaml
kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-gateway-manager.yaml
https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-controller.yaml
At this point you can install a customeresource
object. For e.g. please take a look at https://raw.githubusercontent.com/nirmata/kube-static-egress-ip/ha/config/static-egressip-example.yaml
you need to ensure service mentioned under service-name
must exist.
Please note that this only works with direct-routing CNI's. For instance use Flannel with host-gw
.
I am working making functionality work with overlay CNI's e.g. Flannel VXLAN and Weave.
If kube-static-egress-ip is upgraded with a rolling-upgrade (but the nodes are not re-booted) then it would be horrible if the active gw hops to the next, and next node during the upgrade. When a new gw becomes active external traffic must be re-routed to it (how?) and all existing connections are lost.
Will is be possible to tune the leaderelection in a very "defensive" way. I.e wait for the active gw to come back rather than immediately move to another node?
@uablrek thanks for taking interest in this project.
it would be horrible if the active gw hops to the next, and next node during the upgrade
Right now thinking (implementation in this PR) is to rely upon the kubelet + kube-controller-manager notion of node readiness. When a node acting as a gateway becomes unready, a new node is selected from the set of ready nodes.
Merging PR. I will do follow-up PR to update the documentation.
Refactor current code to support below: