{"id":15988546,"url":"https://github.com/woile/rpi-cluster-assistant","last_synced_at":"2025-06-11T18:32:25.291Z","repository":{"id":150147911,"uuid":"190781324","full_name":"woile/rpi-cluster-assistant","owner":"woile","description":"Scripts to assist with the creation of a raspberry pi kubernetes cluster.","archived":false,"fork":false,"pushed_at":"2019-06-12T12:56:39.000Z","size":30,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-09T01:42:19.020Z","etag":null,"topics":["cluster","hypriot","hypriot-flash","hypriot-os","kubernetes","kubernetes-cluster","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woile.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,"publiccode":null,"codemeta":null}},"created_at":"2019-06-07T17:10:46.000Z","updated_at":"2022-08-22T01:51:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4a1f208-610b-44fc-82f7-39edf8ee516d","html_url":"https://github.com/woile/rpi-cluster-assistant","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"47a119c0bc42851eaadf96d5052b13dbaf54b0b4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Frpi-cluster-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Frpi-cluster-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Frpi-cluster-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Frpi-cluster-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woile","download_url":"https://codeload.github.com/woile/rpi-cluster-assistant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893857,"owners_count":20364918,"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":["cluster","hypriot","hypriot-flash","hypriot-os","kubernetes","kubernetes-cluster","raspberry-pi"],"created_at":"2024-10-08T04:05:22.355Z","updated_at":"2025-03-18T01:30:33.660Z","avatar_url":"https://github.com/woile.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Cluster Assistant\n\n\u003e Scripts to assist with the creation of a raspberry pi kubernetes cluster.\n\n## About\n\nThis repository will help and guide you on setting up a cluster with multiple raspberries pi.\n\nCurrently it can generate a `master` and `N`-`workers` where `N` is the number of\nnodes chosen in the `conf.json`.\n\nIt configures a DHCP server making the `master` node start assigning IPs to the worker nodes.\nIt is expected for the raspberries to be connected to the same switch.\nThe `eth0` interface should be reserved for the cluster.\n\nThe objective of this project is to make it easy to configure a cluster in order\nto start playing with Kubernetes.\n\n## Quickstart\n\n```bash\ngit clone https://github.com/Woile/rpi-cluster-assistant.git\ncd rpi-cluster-assistant/\n```\n\n```bash\n./scripts/init\n./scripts/flash-cluster\n```\n\nOnce the SD cards have been flashed, plug them in the raspberries.\nI'd recommend starting with the SD containing the master node.\n\n## Features\n\n- Access using `SSH` to the nodes.\n- DHCP Server and `master` node with static IP `10.0.0.1`\n- Range of IPs assigned to nodes goes from `10.0.0.2` to `10.0.0.50`\n- All the nodes have access to wifi. This might be useful later to play with multi-master nodes.\n- Provision a `kubernetes` cluster\n- Support for multiple pod networks: `flannel`, `weavenet`\n- Include kubernetes addons, currently only dashboard.\n- Prompt asking for the configuration of the cluster.\n\n## Prerequisites\n\n- Linux Debian based OS.\n- Python 3.x\n\n## Usage\n\n### 1. Initialization\n\n**Execute**:\n\n```bash\n./scripts/init\n```\n\n**Explanation**:\n\n1. Installs OS dependencies (debian) in your machine (the host).\n1. Downloads `Hypriot OS` and `flash`.\n1. Create 'conf.json' using the assistant if file is not present.\n\n### 2. Flash to SD cards\n\n**Before**:\n\n- Update `config.json` values.\n\n**Execute**:\n\n```bash\n./scripts/flash-cluster\n```\n\n**Explanation**:\n\n1. Show information of what is going to happen and ask for confirmation.\n1. Render cluster files.\n1. If master node is true, it will be the first to be flashed.\n1. The worker nodes will be flashed.\n\n### Extra commands\n\n### Assistant\n\n**Execute**:\n\n```bash\n./scripts/assistant.py\n```\n\n**Explanation**:\n\n1. Questions about the cluster are prompted.\n1. A `conf.json` file is generated.\n\n### Flash one\n\n**Before**:\n\n- Update `config.json` values.\n\n**Execute**:\n\n```bash\n./scripts/flash-one\n```\n\n**Explanation**:\n\n1. Prompt the user for some information.\n1. Render cluster files.\n1. Flash one SD card based on the node type (`master` or `worker`) chosen.\n\n### Render template\n\n**Before**:\n\n- Update the values in `conf.json`.\n- Use the raw wifi password because it will be automatically converted using `wpa_passphrase`.\n- If you don't have a ssh key, create one using [this tutorial][ssh_tutorial].\n\n**Execute**:\n\n```bash\n./scripts/render.py\n```\n\n**Explanation**:\n\n1. Reads information from `conf.json`.\n1. Creates files for Raspberry cluster inside `output` folder.\n\n### Configuration\n\nThe configuration file can be created based on the `conf.example.json`\n\n```bash\ncp conf.example.json conf.json\n```\n\nAll the values are required, if you don't know what to put, leave the default.\n\n| Variable           | Description                                                                  | Default             |\n| ------------------ | ---------------------------------------------------------------------------- | ------------------- |\n| `username`         | The username used to log in to the node                                      | `hypriot`           |\n| `wifi_ssid_name`   | The name of your wifi                                                        | -                   |\n| `wifi_password`    | Raw password of your wifi                                                    | -                   |\n| `wifi_country`     | Country where you are, [check the codes][wifi_codes]                         | `NL`                |\n| `ssh_public_key`   | Public [SSH Key][ssh_tutorial] to access from outside the nodes              | `~/.ssh/id_rsa.pub` |\n| `hostname_prefix`  | Name of the machine. It will look like: `node-1`                             | `node`              |\n| `number_of_nodes`  | Number of raspberries to be flashed                                          | `4`                 |\n| `node_range_start` | Offset to the number of nodes. Example range: `[5..8]` with range start: `5` | `1`                 |\n| `include_master`   | Decide whether to flash a `master` node or only workers.                     | `true`              |\n| `pod_network`      | [Pod Network][pod_network]. Options: `weavenet`, `flannel`                   | `flannel`           |\n\n### Provisioning kubernetes cluster\n\n#### Master node\n\n1. As root follow the steps located in `/root/k8s-cluster`.\n1. As normal user follow the steps located in `/home/\u003cuser\u003e/k8s-config`\n\n**Notes**:\n\n- Observe the output located in `/root/k8s-cluster/kubeadm-init.out` because you will\n- have to run the `kubeadm join ...` after provisioning the worker nodes.\n\n#### Worker nodes\n\nRemember that this must be executed after running all the scripts above\n\n1. As root follow the steps located in `/root/k8s-cluster`.\n1. Run `kubeadm join ...` command which appears in the master node.\n\n#### Finally\n\nYou can run the [addons][k8s_addons] included in `/home/\u003cuser\u003e/k8s-addons`.\n\n[ssh_tutorial]: https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent\n[wifi_codes]: https://github.com/recalbox/recalbox-os/wiki/Wifi-country-code-(EN)\n[pod_network]: https://kubernetes.io/docs/concepts/cluster-administration/addons/#networking-and-network-policy\n[k8s_addons]: https://kubernetes.io/docs/concepts/cluster-administration/addons/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoile%2Frpi-cluster-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoile%2Frpi-cluster-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoile%2Frpi-cluster-assistant/lists"}