{"id":13983334,"url":"https://github.com/Sh4d1/scaleway-k8s-node-coffee","last_synced_at":"2025-07-21T22:32:18.715Z","repository":{"id":53015921,"uuid":"329075312","full_name":"Sh4d1/scaleway-k8s-node-coffee","owner":"Sh4d1","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-22T09:47:55.000Z","size":167,"stargazers_count":33,"open_issues_count":4,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-09T05:08:44.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","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":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-01-12T18:23:08.000Z","updated_at":"2023-08-27T05:22:06.000Z","dependencies_parsed_at":"2024-01-07T09:39:11.589Z","dependency_job_id":"22d76188-9158-4de0-a41a-6a003d5a596e","html_url":"https://github.com/Sh4d1/scaleway-k8s-node-coffee","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-k8s-node-coffee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-k8s-node-coffee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-k8s-node-coffee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sh4d1%2Fscaleway-k8s-node-coffee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sh4d1","download_url":"https://codeload.github.com/Sh4d1/scaleway-k8s-node-coffee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226991559,"owners_count":17714607,"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":[],"created_at":"2024-08-09T05:01:43.425Z","updated_at":"2024-11-28T21:31:30.120Z","avatar_url":"https://github.com/Sh4d1.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"50%\" src=\"medias/cli-artwork.png\" /\u003e\u003c/p\u003e\n\n# scaleway-k8s-node-coffee ☕\n\nKubernetes toolkit controller project for Scaleway k8s nodes, that does a lot of different things based on changes in a Kubernetes cluster (especially Kapsule).\n\n# Getting started 🚀\n\n## Configuration\n\nBelow environment variables have to be defined in the controller container to configure it. Leaving a feature-related variable empty will disable it\n\n| Variable             | Description                                                                                                                                                                                                                           | Example                                                                              |\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |\n| `KUBECONFIG`         | *optional*. `KUBECONFIG` file path to the cluster you want to run the controller against                                                                                                                                              | `~/.kube/config/my-kubeconfig.yaml`                                                  |\n| `SCW_ACCESS_KEY`     | *required*. Your scaleway project access key ([docs](https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/))                                                                                                               | `SCWxxxxxxxxxxxxxxxxx`                                                               |\n| `SCW_SECRET_KEY`     | *required*. Your scaleway project secret key ([docs](https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/))                                                                                                               | `11111111-1111-1111-2111-111111111111`                                               |\n| `SCW_DEFAULT_REGION` | Your Scaleway DBaaS default region ([docs](https://www.scaleway.com/en/docs/compute/instances/concepts/#availability-zone), [guides](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/regions_and_zones)) | `fr-par`                                                                             |\n| `SCW_DEFAULT_ZONE`   | Your Scaleway DBaaS default zone ([docs](https://www.scaleway.com/en/docs/compute/instances/concepts/#availability-zone), [guides](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/regions_and_zones))   | `fr-par-1`                                                                           |\n| `RESERVED_IPS_POOL`  | List of already existing reserved IP, comma-separated                                                                                                                                                                                 | `51.15.15.15,51.15.15.32`                                                            |\n| `REVERSE_IP_DOMAIN`  | Your desired domain name                                                                                                                                                                                                              | `example.com`                                                                        |\n| `DATABASE_IDS`       | List of DBaaS IDs (with optional regional IDs), comma-separated                                                                                                                                                                       | `11111111-1111-1111-2111-111111111111,nl-ams/11111111-1111-1111-2111-111111111112`   |\n| `REDIS_IDS`          | List of Redis IDs (with optional zonal IDs), comma-separated                                                                                                                                                                          | `11111111-1111-1111-2111-111111111111,nl-ams-1/11111111-1111-1111-2111-111111111112` |\n| `SECURITY_GROUP_IDS` | List of security group IDs (with optional zonal IDs), comma-separated                                                                                                                                                                 | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`                                               |\n| `NUMBER_RETRIES`     | *optional*. Retries on error amount (default: `30`)                                                                                                                                                                                   | `15`                                                                                 |\n## Local tests\n\nYou can test it against a remote cluster by providing the corresponding `KUBECONFIG` environment variable to the container, like the following :\n\n```bash\ndocker run sh4d1/scaleway-k8s-node-coffee \\\n  # Remote cluster to run against\n  --env KUBECONFIG=\"~/.kube/config/my-kubeconfig.yaml\" \\\n  ...\n```\n\nBelow snippet will build and run the controller (all features enabled) locally against the given cluster (`kubeconfig`)\n\n```bash\n# Run the tests and build the image (if working on the project)\nmake docker-build\n\n# Build the image\ndocker build -t sh4d1/scaleway-k8s-node-coffee .\n\n# Run it with the required environment variables\ndocker run sh4d1/scaleway-k8s-node-coffee \\\n  # Remote cluster to run against\n  --env KUBECONFIG=\"~/.kube/config/my-kubeconfig.yaml\" \\\n  # Authentication/global configuration\n  --env SCW_ACCESS_KEY=\"SCWxxxxxxxxxxxxxxxxx\" \\\n  --env SCW_SECRET_KEY=\"11111111-1111-1111-2111-111111111111\" \\\n  --env RETRIES_NUMBER=\"15\" \\\n  # Reserved IP\n  --env RESERVED_IPS_POOL=\"51.15.15.15,51.15.15.32\" \\\n  # Reverse IP\n  --env REVERSE_IP_DOMAIN=\"example.com\" \\\n  # Database ACL\n  --env SCW_DEFAULT_REGION=\"fr-par\" \\\n  --env DATABASE_IDS=\"11111111-1111-1111-2111-111111111111,nl-ams/11111111-1111-1111-2111-111111111112\" \\\n  # Redis ACL\n  --env REDIS_IDS=\"11111111-1111-1111-2111-111111111111,nl-ams-1/11111111-1111-1111-2111-111111111112\" \\\n  --env SCW_DEFAULT_ZONE=\"fr-par-1\" \\\n  # Security groups\n  --env SECURITY_GROUP_IDS=my-value \\\n```\n\n## Deploy\n\nBelow snippet will deploy the controller on the current cluster context you're authenticated against (`kubectl config current-context`)\n\n⚠️ Please note that you'll have to edit `./deploy/{configmap,secret}.yaml` to define your credentials and custimze your needs! \n\n```bash\n# Using make (requires to clone the repository)\nmake deploy\n\n# Using kubectl\nkubectl create -f https://raw.githubusercontent.com/Sh4d1/scaleway-k8s-node-coffee/main/deploy/deploy.yaml\nkubectl create -f https://raw.githubusercontent.com/Sh4d1/scaleway-k8s-node-coffee/main/deploy/secret.yaml --edit --namespace scaleway-k8s-node-coffee\nkubectl create -f https://raw.githubusercontent.com/Sh4d1/scaleway-k8s-node-coffee/main/deploy/configmap.yaml --edit --namespace scaleway-k8s-node-coffee\n```\n\n### Helm\n\nA helm implementation of this controller is in progress, feel free to contribute (https://github.com/Sh4d1/scaleway-k8s-node-coffee/pull/7)\n\n# Features ✨\n\n## Reserved IP\n\nThis feature allows a set of predefined reserved IP to be used as the nodes IP. Once a new node appears, it will try to assign a free reserved IP out of the given list to the node.\n\n**Variable(s)** 📝\n\n- `RESERVED_IPS_POOL`\n  - list of already existing reserved IP, comma-separated\n  - e.g. `51.15.15.15,51.15.15.32`\n\n**Notes**\n\n- ℹ️ A label `reserved-ip: true` will be added to the nodes with a reserved IP.\n\n## Reverse IP\n\nThis feature allows you to set the reverse IP of the reserved IP to a custom one. It will only work if a reserved IP is already set on the node (to use with the Reserved IP feature).\n\n**Variable(s)** 📝\n\n- `REVERSE_IP_DOMAIN`\n  - desired domain name\n  - e.g. `example.com` will update the reserved IP `51.16.17.18` with the reverse `18-17-16-51.example.com`\n\n**Notes**\n\n- ℹ️ If your domain is hosted on Scaleway, the record such as `18-17-16-51.example.com` will be added (and removed if not needed anymore).\n\n## Database ACLs\n\nThis feature allows to update the ACL rules of several DB to allow of all the cluster nodes (adding new ones, and removing old ones).\n\n**Variable(s)** 📝\n\n- `DATABASE_IDS`\n  - list of DBaaS IDs (with optional regional IDs), comma-separated\n  - e.g. `11111111-1111-1111-2111-111111111111,nl-ams/11111111-1111-1111-2111-111111111112`\n- `SCW_DEFAULT_REGION`\n  - Default DBaaS resources region\n  - e.g. `fr-par`\n\n**Notes**\n\n- ℹ️ Will update the ACL of the database with ID `11111111-1111-1111-2111-111111111111` in the region specified by the environment variable `SCW_DEFAULT_REGION` and the database `11111111-1111-1111-2111-111111111112` in the `nl-ams` region.\n\n- ℹ️ If your database is in a different project than the cluster nodes, please set the environment variable `NODES_IP_SOURCE` to `kubernetes`.\n\n- ℹ️ If your DBaaS already have ACL rules allowing your k8s nodes' IPs, and not named following their IDs, you'll have to delete them or rename them with the corresponding nodes' IDs\n\n## Redis ACLs\n\nThis feature allows to update the ACL rules of several Redis instances to allow of all the cluster nodes (adding new ones, and removing old ones).\n\n**Variable(s)** 📝\n\n- `REDIS_IDS`\n  - list of Redis IDs (with optional zonal IDs), comma-separated\n  - e.g. `11111111-1111-1111-2111-111111111111,nl-ams-1/11111111-1111-1111-2111-111111111112`\n- `SCW_DEFAULT_ZONE`\n  - Default Redis resources zone\n  - e.g. `fr-par-1`\n\n**Notes**\n\n- ℹ️ Will update the ACL of the redis instance with ID `11111111-1111-1111-2111-111111111111` in the zone specified by the environment variable `SCW_DEFAULT_ZONE` and the instance `11111111-1111-1111-2111-111111111112` in the `nl-ams-1` zone.\n\n- ℹ️ If your redis instance is in a different project than the cluster nodes, please set the environment variable `NODES_IP_SOURCE` to `kubernetes`.\n\n## Security Group\n\nThis feature allows you to update multiple security groups with:\n- The Public and Private IPs of all nodes of the cluster\n- The Node Ports of the NodePort and LoadBalancer services\n\n**Variable(s)** 📝\n\n- `SECURITY_GROUP_IDS`\n  - list of security group IDs (with optional zonal IDs), comma-separated\n  - e.g. `11111111-1111-1111-2111-111111111111,nl-ams-1/11111111-1111-1111-2111-111111111112`\n\n**Notes**\n\n- ℹ️ However due to several lack of features, the deletion of the rules if best effort for the nodes, and non existent for the services.\n\n## Contribution\n\nFeel free to submit any issue, feature request or pull request :smile:!\n\nArtwork edited, initially from [scaleway-cli](https://github.com/scaleway/scaleway-cli)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSh4d1%2Fscaleway-k8s-node-coffee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSh4d1%2Fscaleway-k8s-node-coffee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSh4d1%2Fscaleway-k8s-node-coffee/lists"}