{"id":25083902,"url":"https://github.com/sh4d1/scaleway-external-ip","last_synced_at":"2025-04-01T11:35:34.284Z","repository":{"id":204262482,"uuid":"711454355","full_name":"Sh4d1/scaleway-external-ip","owner":"Sh4d1","description":"IP failover over Scaleway Routed IP for Kubernetes Kapsule","archived":false,"fork":false,"pushed_at":"2024-06-07T07:31:44.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-07T06:31:38.406Z","etag":null,"topics":["ip","kapsule","kubernetes","scaleway"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sh4d1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2023-10-29T10:16:30.000Z","updated_at":"2024-06-07T07:31:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c5bed6b-2f9e-41c0-a97e-683f28dabc58","html_url":"https://github.com/Sh4d1/scaleway-external-ip","commit_stats":null,"previous_names":["sh4d1/scaleway-external-ip"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-external-ip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-external-ip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-external-ip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-external-ip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sh4d1","download_url":"https://codeload.github.com/Sh4d1/scaleway-external-ip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246634802,"owners_count":20809305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ip","kapsule","kubernetes","scaleway"],"created_at":"2025-02-07T06:29:35.251Z","updated_at":"2025-04-01T11:35:34.263Z","avatar_url":"https://github.com/Sh4d1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scaleway-external-ip (this is a POC, all hell can break loose, use at your own risk)\n\nThis project aims to bring some sort of IP failover mechanism, over Scaleway's new routed IP system.\n\n## Description\n\nscaleway-external-ip brings a new CRD: `ScwExternalIP`. This resource, with the help of Scaleway Routed IPs, will allow you to have a failover IP that always is pointing to a healthy node of the cluster.\n\nIn order to make it work, you'll need a `ClusterIP` service, with the `.spec.externalIPs` set to the Scaleway Routed IPs (v4\u0026v6, see limitations) you want to use for this service, like this:\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: myapp\n  labels:\n    app: myapp\nspec:\n  ports:\n  - port: 8080\n    targetPort: 8080\n  selector:\n    app: myapp\n  externalIPs:\n    - 1.2.3.4\n    - dead::beef::1\n```\n\nIn this case, the service `myapp` will be exposed on the public endpoints `1.2.3.4:8080` and `dead::beef::1:8080`.\nHowever, the IPs needs to be attached to a node in the cluster, and the addresses added to the interface.\n\nNo worries, you just need to create the following `ScwExternalIP`:\n\n```yaml\napiVersion: ptrk.io/v1alpha1\nkind: ScwExternalIP\nmetadata:\n  name: myapp\nspec:\n  service: myapp # name of the targeted service, in the same namespace\n  # supports the nodeSelector, when choosing a node to attach.\n  # the controller is already adding a selector on the IP's zone\n  #nodeSelector:\n  # TODO: ideas to add reverse, whitelist (might be done with a Cilium network policy though), ...\n```\n\nOnce it's created (and if the agents and controller are running of course!), it will attach the different IPs to a node matching the constraints.\nThe agent will add the IP address on the Instance's interface on all nodes matchings the constraints, for a quick failover.\nOnce a node is not ready, the IP is detached, and re-attached to another node matching the constraints.\n\n- TODO: add a healtcheck mechanism for faster failure discovery\n- TODO: or add a new CRD to manage IP addresses on the nodes, and check every X for last heartbeat\n\n## Limitations\n\n- No real IPv6 support right now, as the Kapsule cluster can't be dual stack. The IP will be confiugred on the host, but Cilium will reject connections because it's not ipv6 enable.\n- \"Slow\" failover, as it waits for the node to be not ready\n\n## Getting Started\n\n### Warning\n\nAs usual, please don't do this on your production :)\n\n### Setup\n\nYou’ll need a Scaleway Kapsule Kubernetes cluster to run against (could work with a selfhosted cluster on Scaleway instances, though I haven't tested it) running Cilium as CNI.\n\nInstall the controller and the agent with:\n```yaml\nkubectl create -k https://github.com/Sh4d1/scaleway-external-ip/config/default\n```\n\nCreate and enter your Scaleway credentials with:\n```yaml\nkubectl create -f https://raw.githubusercontent.com/Sh4d1/scaleway-external-ip/main/secret.yaml --edit --namespace scaleway-external-ip-system\n```\n\nYou are now ready to create Routed IPs, add them to `externalIPs` in a service, and create a `ScwExternalIP` targeting this service! Yay!\n\n## License\n\nCopyright 2023.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh4d1%2Fscaleway-external-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsh4d1%2Fscaleway-external-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh4d1%2Fscaleway-external-ip/lists"}