{"id":24839422,"url":"https://github.com/nicholasdille/capictl","last_synced_at":"2025-10-25T16:37:47.780Z","repository":{"id":240042902,"uuid":"670643964","full_name":"nicholasdille/capictl","owner":"nicholasdille","description":"Bootstrap a self-managed workload Kubernetes cluster using Cluster API","archived":false,"fork":false,"pushed_at":"2025-04-07T06:21:27.000Z","size":89,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T07:26:44.538Z","etag":null,"topics":["capi","cluster-api","hcloud","hetzner","k3d","kind","kubernetes","vsphere"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/nicholasdille.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-07-25T14:05:20.000Z","updated_at":"2025-04-07T06:21:19.000Z","dependencies_parsed_at":"2024-07-18T08:46:06.369Z","dependency_job_id":"31a8305f-df33-47b7-8f16-5e2f7af4fe43","html_url":"https://github.com/nicholasdille/capictl","commit_stats":null,"previous_names":["nicholasdille/capictl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasdille%2Fcapictl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasdille%2Fcapictl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasdille%2Fcapictl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasdille%2Fcapictl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicholasdille","download_url":"https://codeload.github.com/nicholasdille/capictl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550768,"owners_count":21122964,"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":["capi","cluster-api","hcloud","hetzner","k3d","kind","kubernetes","vsphere"],"created_at":"2025-01-31T06:48:33.861Z","updated_at":"2025-10-25T16:37:42.736Z","avatar_url":"https://github.com/nicholasdille.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# capictl\n\nThis repository contains an opinionated script to create a Kubernetes cluster using the [Cluster API](https://cluster-api.sigs.k8s.io/) on a few infrastructure providers.\n\n🎉 **This is the successor of [`k8s-caph-talos`](https://github.com/nicholasdille/k8s-caph-talos).** 🎉\n\nAfter creating a local bootstrap cluster, the workload cluster is created. At the end of the rollout, the management services are moved into the workload cluster.\n\nThe resulting cluster will be able to manage itself as well as create new clusters.\n\n## Supported infrastructure\n\nBootstrap clusters: [kind](https://kind.sigs.k8s.io/), [k3d](https://k3d.io)\n\nInfrastructure providers: docker, hetzner, vsphere\n\nCNI: [cilium](https://cilium.io/)\n\n## Usage\n\n`capictl` supports a number of options to configure the cluster. The following command will create a cluster with the default configuration:\n\n```shell\nbash capictl -n my-cluster\n```\n\nThe following settings are supported:\n\n| Option | Variable | Default | Description |\n|--------|----------|---------|-------------|\n| `-n` | `CLUSTER_NAME` | | The name of the cluster |\n| `-v` | `KUBERNETES_VERSION` | (latest) | The version of Kubernetes to deploy |\n| `-b` | `BOOTSTRAP_CLUSTER_PROVIDER` | `kind` | The provider for the bootstrap cluster (valid values are `kind`, `k3d`) |\n| `-i` | `WORKLOAD_PROVIDER` | `docker` | The provider for the workload cluster (valid values are `docker`, `hetzner`, `vsphere`) |\n| `-p` | `CNI_PLUGIN` | `cilium` | The CNI plugin to use (valid values are `cilium`) |\n| `-x` | `POD_CIDR` | `10.42.128.0/17` | The CIDR for pods |\n| `-y` | `SERVICE_CIDR` | `10.42.0.0/17` | The CIDR for services |\n| `-c` | `CONTROL_PLANE_NODE_COUNT` | `1` | The number of control plane nodes |\n| `-w` | `WORKER_NODE_COUNT` | `2` | The number of worker nodes |\n\nAll variables can be configured through a `.env` file as well (including the provider specific variables described below).\n\nThe corresponding `kubeconfig` file is stored in the current directory as `kubeconfig-${CLUSTER_NAME}`.\n\nThe following provider specific variables are supported:\n\n### Hetzner\n\nSee the [Hetzner Cloud provider documentation](https://github.com/syself/cluster-api-provider-hetzner/blob/main/docs/topics/preparation.md#variable-preparation-to-generate-a-cluster-template).\n\nThe following default values are configured:\n\n| Variable                            | Default | Description                                  |\n|-------------------------------------|---------|----------------------------------------------|\n| `HCLOUD_REGION`                     | `fsn1`  | The Hetzner Cloud region                     |\n| `HCLOUD_CONTROL_PLANE_MACHINE_TYPE` | `cx22`  | The Hetzner Cloud control plane machine type |\n| `HCLOUD_WORKER_MACHINE_TYPE`        | `cx22`  | The Hetzner Cloud worker machine type        |\n\n### vsphere\n\nSee the [vsphere provider documentation](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/getting_started.md#configuring-and-installing-cluster-api-provider-vsphere-in-a-management-cluster).\n\n## Prerequisites\n\nThe script relies on a number of binaries to work:\n- `docker`\n- `envsubst`\n- `jq`\n- `kind` or `k3d`\n- `kubectl`\n- `hcloud`\n- `clusterctl`\n- `cilium`\n\nThose prerequisites can be installed with [`uniget`](https://uniget.dev).\n\n## Image\n\nThis repository contains Packer based images for Hetzner Cloud located in the [`images` directory](images/).\n\n## Internals\n\nThis is how the script works:\n\n1. Create a bootstrap cluster using `kind` or `k3d`\n1. Initialize Cluster API in the bootstrap cluster\n1. Generate a cluster configuration for the workload cluster\n1. Wait for the control plane to initialize\n1. Deploy Cilium\n1. Deploy necessary components, e.g. cloud controller manager and CSI\n1. Wait for the controle plane to be ready\n1. Wait for the worker nodes to be ready\n1. Initialize Cluster API in the workload cluster\n1. Move the cluster configuration to the workload cluster\n1. Create a `kubeconfig` for the workload cluster with a dedicated service account\n\n## TODO\n\n- [ ] Talos\n- [x] Idempotency (being able to restart and pick up where it left off)\n- [x] Configure CIDRs for pods and services\n- [x] Test `kubectl wait`\n- [x] Support infrastructure docker?\n- [x] Support infrastructure vcluster?\n- [ ] Check out [Cluster API Operator](https://github.com/kubernetes-sigs/cluster-api-operator)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholasdille%2Fcapictl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholasdille%2Fcapictl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholasdille%2Fcapictl/lists"}