{"id":13548389,"url":"https://github.com/xetys/hetzner-kube","last_synced_at":"2025-04-12T15:39:03.445Z","repository":{"id":28545222,"uuid":"118689988","full_name":"xetys/hetzner-kube","owner":"xetys","description":"A CLI tool for provisioning kubernetes clusters on Hetzner Cloud","archived":false,"fork":false,"pushed_at":"2023-02-25T01:44:51.000Z","size":12677,"stargazers_count":748,"open_issues_count":91,"forks_count":115,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-09T14:44:35.890Z","etag":null,"topics":["hetzner-cloud","k8s","kubernetes"],"latest_commit_sha":null,"homepage":null,"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/xetys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-24T00:43:37.000Z","updated_at":"2025-03-03T09:11:10.000Z","dependencies_parsed_at":"2024-01-14T09:57:45.794Z","dependency_job_id":"2607f52e-85ef-44a7-bcc6-89a7c080d7a3","html_url":"https://github.com/xetys/hetzner-kube","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xetys%2Fhetzner-kube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xetys%2Fhetzner-kube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xetys%2Fhetzner-kube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xetys%2Fhetzner-kube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xetys","download_url":"https://codeload.github.com/xetys/hetzner-kube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590639,"owners_count":21129865,"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":["hetzner-cloud","k8s","kubernetes"],"created_at":"2024-08-01T12:01:09.667Z","updated_at":"2025-04-12T15:39:03.418Z","avatar_url":"https://github.com/xetys.png","language":"Go","funding_links":[],"categories":["Go","Tools"],"sub_categories":["Rust"],"readme":"\n[![Build Status](https://travis-ci.org/xetys/hetzner-kube.svg?branch=master)](https://travis-ci.org/xetys/hetzner-kube)\n[![Go Report Card](https://goreportcard.com/badge/github.com/xetys/hetzner-kube)](https://goreportcard.com/report/github.com/xetys/hetzner-kube)\n[![Maintainability](https://api.codeclimate.com/v1/badges/3ef5b31a84811e3b8b02/maintainability)](https://codeclimate.com/github/xetys/hetzner-kube/maintainability)\n[![Gitter chat](https://badges.gitter.im/hetzner-kube.png)](https://gitter.im/hetzner-kube)\n\n# hetzner-kube: fast and easy setup of kubernetes clusters on Hetzner Cloud\n\nThis project contains a CLI tool to easily provision [kubernetes](https://kubernetes.io) clusters\non [Hetzner Cloud](https://hetzner.com/cloud).\n\nThis is my very first tool written in Go.\n\n## How to install\n\n### Binary releases\n\nGet the binary from [releases page](https://github.com/xetys/hetzner-kube/releases)\n\n### From source\n\n`hetzner-kube` is written in [Go](https://golang.org/). To install Go please follow the instructions on its homepage.\n\nTo get and build `hetzner-kube` from source run this command:\n\n```\n$ go get -u github.com/xetys/hetzner-kube\n```\n\nThe project source will now be in your `$GOPATH` directory (`$GOPATH/src/github.com/xetys/hetzner-kube`) and the binary will be in `$GOPATH/bin`.\n\nIf you want to build it yourself later, you can change into the source directory and run `go build` or `go install`.\n\n### Code completion\n\n#### BASH\n\nTo load completion run\n\n```bash\nsource \u003c(hetzner-kube completion bash)\n```\n\nTo configure your bash shell to load completions for each session add to your \"~/.bashrc\" file\n\n```bash\n# ~/.bashrc or ~/.profile\necho 'source \u003c(hetzner-kube completion bash)\\n' \u003e\u003e ~/.bashrc\n```\n\nOr you can add it to your `bash_completition.d` folder:\n\n```bash\n# On linux\nhetzner-kube completion bash \u003e /etc/bash_completion.d/hetzner-kube\n# On OSX with completion installed via brew (`brew install bash-completion`)\nhetzner-kube completion bash \u003e /usr/local/etc/bash_completion.d/hetzner-kube\n```\n\n#### ZSH\n\nTo configure your zsh shell to load completions run following commands:\n\n```bash\n# On linux\nhetzner-kube completion zsh | sudo tee /usr/share/zsh/vendor-completions/_hetzner-kube\n# On OSX\nhetzner-kube completion zsh | sudo tee /usr/share/zsh/site-functions/_hetzner-kube\n```\n\nThan rebuild autocomplete function with:\n\n```\ncompinits\n```\n\n## Usage\n\nIn your [Hetzner Console](https://console.hetzner.cloud) generate an API token and\n\n```bash\n$ hetzner-kube context add my-project\nToken: \u003cPASTE-TOKEN-HERE\u003e\n```\n\nThen you need to add an SSH key:\n\n```bash\n$ hetzner-kube ssh-key add -n my-key\n```\n\nThis assumes, you already have a SSH keypair `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`\n\nAnd finally, you can create a cluster by running:\n\n```bash\n$ hetzner-kube cluster create --name my-cluster --ssh-key my-key\n```\n\nThis will provision a brand new kubernetes cluster in latest version!\n\nTo access the cluster via kubectl, create a config file:\n\n```bash\n# Write ~/.kube/config (you'll be asked to overwrite if file already exists)\nhetzner-kube cluster kubeconfig my-cluster\n# Alternatively, create a separate file and point kubectl to it:\n#hetzner-kube cluster kubeconfig --print my-cluster \u003e ~/.kube/config-my-cluster\n#export KUBECONFIG=~/.kube/config-my-cluster\n```\n\nFor a full list of options that can be passed to the ```cluster create``` command, see the [Cluster Create Guide](docs/cluster-create.md) for more information.\n\n## HA-clusters\n\nYou can build high available clusters with hetzner-kube. Read the [High availability Guide](docs/high-availability.md) for\nfurther information.\n\n# Custom Options\n\n## addons\n\nYou can install some addons to your cluster using the `cluster addon` sub-command. Get a list of addons using:\n\n```bash\n$ hetzner-kube cluster addon list\n```\n\n### contributing new addons\n\nYou want to add some cool stuff to hetzner-kube? It's quite easy! Learn how to add new addons in the [Developing Addons](docs/cluster-addons.md) documentation.\n\n## backup \u0026 restore (for HA-clusters)\n\nIf you are running an external etcd cluster, you can use the etcd management to backup the\netcd cluster using\n\n```bash\n$ hetzner-kube cluster etcd backup my-cluster --snapshot-name my-snapshot\n```\n\n(`--snapshot-name` is optional)\n\nand restore it using\n\n```bash\n$ hetzner-kube cluster etcd restore my-cluster --snapshot-name my-snapshot\n```\n\nIf you place a different snapshot (with `.db` file extension) in /root/etcd-snapshots of the\nfirst etcd node, you can use the restore command for migration of kubernetes clusters.\n\n\n## phases\n\nAfter a cluster is once created (nodes creation is enough), you can perform the steps from\n`hetzner-kube cluster create` separately. \n\nYou can use\n``` bash\n$ hetzner-kube cluster phase -h\n```\n\nto only list all available phases.\n\nCluster creation is a chain of these phases:\n\n- `provision`\n- `network-setup`\n- `etcd` (if HA)\n- `install-masters`\n- `setup-ha` (if HA)\n- `install-workers`\n\nSome of theses phase have additional options, to run the actual phase differently from the\nusual cluster creation.\n\n### examples for phases\n\nTo simply run a phase from cluster creation, you cam run a phase, eg. the `etcd` phase using:\n\n```bash\n$ hetzner-kube cluster phase etcd my-cluster\n```\n\nIn order to upgrade or migrate a cluster, you might want to keep the etcd data, and run\n\n```bash\n$ hetzner-kube cluster phase etcd my-cluster --keep-data\n```\n\nand preserve the existing certificates using\n\n```bash\n$ hetzner-kube cluster phase install-master my-cluster --keep-all-certs\n```\n\nThe latter command can be also useful during cluster migration, if you place the existing certs\nin /etc/kubernetes/pki before running the `install-masters` phase.\n\n## cloud-init\n\nIf you like to run some scripts or install some additional packages while provisioning new servers, you can use cloud-init\n```\n$ hetzner-kube cluster create --name my-cluster --nodes 3 --ssh-key my-key --cloud-init \u003cPATH-TO-FILE\u003e\n```\nAn example file to make all nodes ansible ready. The comment on the first line is important:\n\n```yaml\n#cloud-config\npackage_update: true\npackages:\n - python\n```\n\n## Full tutorial\n\n[This article](http://stytex.de/blog/2018/01/29/deploy-kubernetes-hetzner-cloud-openebs/) guides through a full cluster setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxetys%2Fhetzner-kube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxetys%2Fhetzner-kube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxetys%2Fhetzner-kube/lists"}