{"id":36911888,"url":"https://github.com/lucheng0127/kube-eip","last_synced_at":"2026-01-12T15:59:32.476Z","repository":{"id":207257845,"uuid":"718775923","full_name":"lucheng0127/kube-eip","owner":"lucheng0127","description":"An add-on for to provide access to k8s internal ip through an elastic ip","archived":false,"fork":false,"pushed_at":"2024-03-29T07:53:05.000Z","size":18693,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-21T17:04:10.922Z","etag":null,"topics":["bgp","eip","elastic-ip"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucheng0127.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-14T19:22:56.000Z","updated_at":"2024-04-03T06:49:06.000Z","dependencies_parsed_at":"2023-11-14T22:26:53.692Z","dependency_job_id":"8634b223-4bf7-49ef-b812-1c3e476ae487","html_url":"https://github.com/lucheng0127/kube-eip","commit_stats":null,"previous_names":["lucheng0127/kube-eip"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lucheng0127/kube-eip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucheng0127%2Fkube-eip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucheng0127%2Fkube-eip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucheng0127%2Fkube-eip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucheng0127%2Fkube-eip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucheng0127","download_url":"https://codeload.github.com/lucheng0127/kube-eip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucheng0127%2Fkube-eip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T15:50:39.657Z","status":"ssl_error","status_checked_at":"2026-01-12T15:49:49.297Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bgp","eip","elastic-ip"],"created_at":"2026-01-12T15:59:30.036Z","updated_at":"2026-01-12T15:59:32.471Z","avatar_url":"https://github.com/lucheng0127.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kube-eip\n\n[中文](./docs/README_zh.md)\n\n**Kube-eip** is an add-on for k8s. The aim is to provide an access to k8s internal ip(such as pod ip or service ip) through elastic ip.\n\n**Kubevirt eip support**\n\nFor kubevirt vmi eip support, install the [virteip-operator](https://github.com/lucheng0127/virteip-operator)\n\n## Architecture\n\n![Architecture](./docs/architecture/architecture.png)\n\nAt it's core, kube-eip use the rules of iptables implement the transform between eip and vm instance ip. By default we access the pod and service network via vmi pod ip, others by eip, if make a eipBinding to a vmi pod. For convenience we use ipset to manage the networks of pods and service, and alse this's a policy route for each eipBinding, make sure that we connect to other pods with vmi pod ip.\n\nThen for eip routes, we use bgp to declare that the nexthop to access vmi pod that binded eip. There ware a series bgp server we can choise, but we can use gobgp as the bgp library native.\n\n## Modules\n\nEipAgent run as daemonset on every k8s hyper node. And the eipctl is a command line tools call EipAgent by gRPC to apply the eipbinding rules on hyper.\n\n## Usage\n\nThe stable docker images\n\n* quay.io/shawnlu0127/eip_agent:20231204 (Use iptables-legacy)\n* quay.io/shawnlu0127/eip_agent:20240322 (Use iptables-nft)\n* quay.io/shawnlu0127/eipctl:20240319 (Used by eipbinding job created by virteip-operator)\n\n**Attention:**\n\nCheck your hyper node iptables version by iptables -V.\n* iptables-legacy: eip_agent:20231204\n* iptables-nft: eip_agent:20240322\n\n*TODO(user): modify configmap eip-agent-cm (config/agent/eip_agent.yaml)*\n\n```\n# Modify it before deploy eip_agent kube-eip/config/agent/eip_agent.yaml\n...\n\n# TODO(user): change content of config map\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: eip-agent-cm\n  namespace: kube-eip-agent\ndata:\n  svc_net: 192.168.223.0/24      # K8s service ip cidr\n  pod_net: 10.244.0.0/16         # K8s pod ip cidr\n  eip_net: 192.168.18.0/24       # The public network cidr\n  eip_gw_ip: 192.168.18.1        # The public network gateway\n  eip_gw_dev: enp2s0             # The interface on each hyper, that access public netwrok interface(If interface name not same, add a linux bridge with the same name(such as br-pub) and add interface to linux bridge)\n  log_level: debug\n\n...\n```\n\n```\n# Deploy\nIMG={your own image name and tag} make deploy-agent\n\n# Undeploy\nmake undeploy-agent\n```\n\n**Build your own image, push and deploy**\n\n```\n# Build eipbinding operator, eip agent and eipctl\nIMG=quay.io/shawnlu0127/eip_agent:20231204 make docker-build-agent\nIMG=quay.io/shawnlu0127/eipctl:20240319 make docker-build-ctl\n\n# Push your image\nIMG=quay.io/shawnlu0127/eip_agent:20231204 make docker-push\nIMG=quay.io/shawnlu0127/eipctl:20240319 make docker-push\n\n# Deploy eipbinding operator and eip agent\nIMG=quay.io/shawnlu0127/eip_agent:20231204 make deploy-agent\n\n# Undeploy\nmake undeploy-agent\n```\n\n**eipctl**\n\neipctl is an command line tool to bind or unbind eip to or from vmi\n\n```\nroot@shawn-server:~/workspace/kube-eip# eipctl -h\nNAME:\n   eipctl - A new cli application\n\nUSAGE:\n   eipctl [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --target value  rpc server address, default 127.0.0.1:6127 (default: \"127.0.0.1:6127\")\n   --eip-ip value  eip ip address\n   --vmi-ip value  vmi ip address\n   --action value  action, bind or unbind\n   --help, -h      show help\n```\n\n**eip_agent**\n\neip_agent run as daemonset in pod, there is the help info of it\n\n```\nroot@shawn-server:~/workspace/kube-eip# eip_agent -h\nNAME:\n   EipAgent - A new cli application\n\nUSAGE:\n   EipAgent [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --port value                                   agent port that rpc listen on (default: 6127)\n   --log-level value                              log level, default info (default: \"info\")\n   --internal-net value [ --internal-net value ]  networks that exclude from nat\n   --gateway-ip value                             externel network gateway ip address\n   --gateway-dev value                            externel network gateway device\n   --bgp-type value                               bgp manager type, default is none, gobgp is avaliable (default: \"none\")\n   --eip-cidr value                               eip network cidr\n   --arp-poisoning                                whether use arp poisoning to make a arp reply for eip, default is false, when enable will not add eip to external network gateway device (default: false)\n   --help, -h                                     show help\n```\n\n**Have fun and enjoy it ٩(๑\u003e◡\u003c๑)۶**\n\n```\nroot@shawn-server:~/workspace/kube-eip# kubectl get all -n kube-eip-system\nWarning: kubevirt.io/v1 VirtualMachineInstancePresets is now deprecated and will be removed in v2.\nNAME                                               READY   STATUS    RESTARTS   AGE\npod/kube-eip-controller-manager-5df4d7d5fd-8qtr6   2/2     Running   0          2m11s\n\nNAME                                                  TYPE        CLUSTER-IP        EXTERNAL-IP   PORT(S)    AGE\nservice/kube-eip-controller-manager-metrics-service   ClusterIP   192.168.223.251   \u003cnone\u003e        8443/TCP   2m11s\n\nNAME                                          READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/kube-eip-controller-manager   1/1     1            1           2m11s\n\nNAME                                                     DESIRED   CURRENT   READY   AGE\nreplicaset.apps/kube-eip-controller-manager-5df4d7d5fd   1         1         1       2m11s\nroot@shawn-server:~/workspace/kube-eip# kubectl get all -n kube-eip-agent\nWarning: kubevirt.io/v1 VirtualMachineInstancePresets is now deprecated and will be removed in v2.\nNAME                  READY   STATUS    RESTARTS   AGE\npod/eip-agent-2dkbb   1/1     Running   0          2m34s\npod/eip-agent-klcpd   1/1     Running   0          2m34s\n\nNAME                       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE\ndaemonset.apps/eip-agent   2         2         2       2            2           \u003cnone\u003e          2m34s\nroot@shawn-server:~/workspace/kube-eip# kubectl get eipbinding\nNAME     AGE\ncirros   45s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucheng0127%2Fkube-eip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucheng0127%2Fkube-eip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucheng0127%2Fkube-eip/lists"}