{"id":13451577,"url":"https://github.com/kinvolk/kube-spawn","last_synced_at":"2025-03-23T18:32:57.193Z","repository":{"id":54152767,"uuid":"78522032","full_name":"kinvolk/kube-spawn","owner":"kinvolk","description":"A tool for creating multi-node Kubernetes clusters on a Linux machine using kubeadm \u0026 systemd-nspawn. Brought to you by the Kinvolk team.","archived":true,"fork":false,"pushed_at":"2021-03-09T17:27:09.000Z","size":14000,"stargazers_count":442,"open_issues_count":45,"forks_count":41,"subscribers_count":40,"default_branch":"master","last_synced_at":"2024-10-28T18:15:44.329Z","etag":null,"topics":["cluster","cni","containers","kubeadm","kubernetes","systemd-nspawn"],"latest_commit_sha":null,"homepage":"https://kinvolk.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinvolk.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}},"created_at":"2017-01-10T10:16:39.000Z","updated_at":"2024-10-28T10:32:38.000Z","dependencies_parsed_at":"2022-08-13T07:40:56.651Z","dependency_job_id":null,"html_url":"https://github.com/kinvolk/kube-spawn","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinvolk%2Fkube-spawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinvolk%2Fkube-spawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinvolk%2Fkube-spawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinvolk%2Fkube-spawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinvolk","download_url":"https://codeload.github.com/kinvolk/kube-spawn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245149903,"owners_count":20568994,"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","cni","containers","kubeadm","kubernetes","systemd-nspawn"],"created_at":"2024-07-31T07:00:56.208Z","updated_at":"2025-03-23T18:32:52.177Z","avatar_url":"https://github.com/kinvolk.png","language":"Go","funding_links":[],"categories":["Go","Platform"],"sub_categories":[],"readme":"![kube-spawn Logo](logos/PNG/kube_spawn-horz_prpblkonwht.png)\n\n# kube-spawn\n\n\u003cimg src=\"https://github.com/cncf/artwork/raw/8760b54868864a24459716cd0e9ba9986de882f8/kubernetes/certified-kubernetes/versionless/color/certified-kubernetes-color.png\" align=\"right\" width=\"100px\"\u003e `kube-spawn` is a tool for creating a multi-node Kubernetes (\u003e= 1.8) cluster on a single Linux machine, created mostly for developers __of__ Kubernetes but is also a [Certified Kubernetes Distribution](https://kubernetes.io/partners/#dist) and, therefore, perfect for running and testing deployments locally.\n\nIt attempts to mimic production setups by making use of OS containers to set up nodes.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/132605.png)](https://asciinema.org/a/132605)\n\n## Requirements\n\n* `systemd-nspawn` in at least version 233\n* Large enough `/var/lib/machines` partition.\n\n  If /var/lib/machines is not its own filesystem, systemd-nspawn\n  will create /var/lib/machines.raw and loopback mount it as a\n  btrfs filesystem. You may wish to increase the default size:\n\n  `machinectl set-limit 20G`\n\n  We recommend you create a partition of sufficient size, format\n  it as btrfs, and mount it on /var/lib/machines, rather than\n  letting the loopback mechanism take hold.\n\n  In the event there is a loopback file mounted on /var/lib/machines,\n  kube-spawn will attempt to enlarge the underlying image `/var/lib/machines.raw`\n  on cluster start, but this can only succeed when the image is not in use by\n  another cluster or machine. Not enough disk space is a common source\n  of error. See [doc/troubleshooting](doc/troubleshooting.md#varlibmachines-partition-too-small) for\n  instructions on how to increase the size manually.\n* `qemu-img`\n\n## Installation\n\n`kube-spawn` should run well on a modern Linux system (for example Fedora 27 or\nDebian testing). If you want to test it in a controlled environment, you can\nuse [Vagrant](doc/vagrant.md).\n\nTo install `kube-spawn` on your machine, download a single binary release\nor [build from source](#building).\n\nkube-spawn uses CNI to setup networking for its containers. For that, you need\nto download the CNI plugins (v.0.6.0 or later) from GitHub.\n\nExample:\n\n```\ncd /tmp\ncurl -fsSL -O https://github.com/containernetworking/plugins/releases/download/v0.6.0/cni-plugins-amd64-v0.6.0.tgz\nsudo mkdir -p /opt/cni/bin\nsudo tar -C /opt/cni/bin -xvf cni-plugins-amd64-v0.6.0.tgz\n```\n\nBy default, kube-spawn expects the plugins in `/opt/cni/bin`. The location\ncan be configured with `--cni-plugin-dir=` from the command line or\nby setting `cni-plugin-dir: ...` in the configuration file.\n\nAlternatively, you can use `go get` to fetch the plugins into your `GOPATH`:\n\n```\ngo get -u github.com/containernetworking/plugins/plugins/...\n```\n\n## Quickstart\n\nCreate and start a 3 node cluster with the name \"default\":\n\n```\nsudo ./kube-spawn create\nsudo ./kube-spawn start [--nodes 3]\n```\n\nReminder: if the CNI plugins can't be found in `/opt/cni/bin`, you need\nto pass `--cni-plugin-dir path/to/plugins`.\n\n`create` prepares the cluster environment in `/var/lib/kube-spawn/clusters`.\n\n`start` brings up the nodes and configures the cluster using\n[kubeadm](https://github.com/kubernetes/kubeadm).\n\nShortly after, the cluster should be initialized:\n\n```\n[...]\n\nCluster \"default\" initialized\nExport $KUBECONFIG as follows for kubectl:\n\n        export KUBECONFIG=/var/lib/kube-spawn/clusters/default/admin.kubeconfig\n```\n\nAfter another 1-2 minutes the nodes should be ready:\n\n```\nexport KUBECONFIG=/var/lib/kube-spawn/clusters/default/admin.kubeconfig\nkubectl get nodes\nNAME                          STATUS    ROLES     AGE       VERSION\nkube-spawn-c1-master-q9fd4y   Ready     master    5m        v1.9.6\nkube-spawn-c1-worker-dj7xou   Ready     \u003cnone\u003e    4m        v1.9.6\nkube-spawn-c1-worker-etbxnu   Ready     \u003cnone\u003e    4m        v1.9.6\n```\n\n## Configuration\n\nkube-spawn can be configured by command line flags, configuration file\n(default `/etc/kube-spawn/config.yaml` or `--config path/to/config.yaml`),\nenvironment variables or a mix thereof.\n\nExample:\n\n```\n# /etc/kube-spawn/config.yaml\ncni-plugin-dir: /home/user/code/go/bin\ncluster-name: cluster1\ncontainer-runtime: rkt\nrktlet-binary-path: /home/user/code/go/src/github.com/kubernetes-incubator/rktlet/bin/rktlet\n```\n\n## CNI plugins\n\nkube-spawn supports weave, flannel, calico. It defaults to weave.\n\nTo configure with flannel:\n```\nkube-spawn create --pod-network-cidr 10.244.0.0/16 --cni-plugin flannel --kubernetes-version=v1.10.5\nkube-spawn start --cni-plugin flannel --nodes 5\n```\n\nTo configure with calico:\n```\nkube-spawn create --pod-network-cidr 192.168.0.0/16 --cni-plugin calico --kubernetes-version=v1.10.5\nkube-spawn start --cni-plugin calico --nodes 5\n```\n\nTo configure with canal:\n```\nkube-spawn create --pod-network-cidr 10.244.0.0/16 --cni-plugin canal --kubernetes-version=v1.10.5\nkube-spawn start --cni-plugin canal --nodes 5\n```\n\n## Accessing kube-spawn nodes\n\nAll nodes can be seen with `machinectl list`. `machinectl shell` can be\nused to access a node, for example:\n\n```\nsudo machinectl shell kube-spawn-c1-master-fubo3j\n```\n\nThe password is `root`.\n\n## Documentation\n\nSee [doc/](doc/)\n\n## Building\n\nTo build kube-spawn in a Docker build container, simply run:\n\n```\nmake\n```\n\nOptionally, install kube-spawn under a system directory:\n\n```\nsudo make install\n```\n\n`PREFIX` can be set to override the default target `/usr`.\n\n## Troubleshooting\n\nSee [doc/troubleshooting](doc/troubleshooting.md)\n\n## Community\n\nDiscuss the project on [Slack](https://kubernetes.slack.com/messages/C9ZMJH2NL/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinvolk%2Fkube-spawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinvolk%2Fkube-spawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinvolk%2Fkube-spawn/lists"}