All Projects → xetys → Hetzner Kube

xetys / Hetzner Kube

Licence: apache-2.0
A CLI tool for provisioning kubernetes clusters on Hetzner Cloud

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Hetzner Kube

Kooper
Kooper is a simple Go library to create Kubernetes operators and controllers.
Stars: ✭ 388 (-43.69%)
Mutual labels:  k8s
Meetup
【❤️ 互联网最全大厂技术分享PPT 👍🏻 持续更新中!】🍻各大技术交流会、活动资料汇总 ,如 👉QCon👉全球运维技术大会 👉 GDG 👉 全球技术领导力峰会👉大前端大会👉架构师峰会👉敏捷开发DevOps👉OpenResty👉Elastic,欢迎 PR / Issues
Stars: ✭ 542 (-21.34%)
Mutual labels:  k8s
Kubesphere
The container platform tailored for Kubernetes multi-cloud, datacenter, and edge management ⎈ 🖥 ☁️
Stars: ✭ 8,315 (+1106.82%)
Mutual labels:  k8s
Charts
Helm charts for applications you run at home
Stars: ✭ 421 (-38.9%)
Mutual labels:  k8s
Click To Deploy
Source for Google Click to Deploy solutions listed on Google Cloud Marketplace.
Stars: ✭ 509 (-26.12%)
Mutual labels:  k8s
Microk8s
MicroK8s is a small, fast, single-package Kubernetes for developers, IoT and edge.
Stars: ✭ 6,017 (+773.29%)
Mutual labels:  k8s
Faas
OpenFaaS - Serverless Functions Made Simple
Stars: ✭ 20,820 (+2921.77%)
Mutual labels:  k8s
Geodesic
🚀 Geodesic is a DevOps Linux Distro. We use it as a cloud automation shell. It's the fastest way to get up and running with a rock solid Open Source toolchain. ★ this repo! https://slack.cloudposse.com/
Stars: ✭ 629 (-8.71%)
Mutual labels:  k8s
Awesome Helm
Collaborative list of awesome helm charts and resources. PRs are welcome!
Stars: ✭ 543 (-21.19%)
Mutual labels:  k8s
Kube Scan
kube-scan: Octarine k8s cluster risk assessment tool
Stars: ✭ 566 (-17.85%)
Mutual labels:  k8s
Kubernetes practice
kubernetes实践指南(内容不定期更新中。。。), 欢迎提PR。
Stars: ✭ 428 (-37.88%)
Mutual labels:  k8s
Carvel Kapp
kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label
Stars: ✭ 489 (-29.03%)
Mutual labels:  k8s
Install k8s
一键安装kubernets(k8s)系统,采用RBAC模式运行(证书安全认证模式),既可以单台安装、也可以集群安装,并且完全是生产环境的安装标准。有疑问大家可以加我微信沟通:bsh888
Stars: ✭ 562 (-18.43%)
Mutual labels:  k8s
Victoriametrics
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
Stars: ✭ 5,558 (+706.68%)
Mutual labels:  k8s
Openpitrix
Application Management Platform on Multi-Cloud Environment
Stars: ✭ 583 (-15.38%)
Mutual labels:  k8s
Micro
go-micro 微服务实践,更多请关注Micro中国站☞
Stars: ✭ 383 (-44.41%)
Mutual labels:  k8s
Dnc
dnc 去中心化 开源社区 轻联盟 dncto.com QQ群 779699538
Stars: ✭ 551 (-20.03%)
Mutual labels:  k8s
Gcr.io mirror
all of the gcr.io docker image mirror
Stars: ✭ 650 (-5.66%)
Mutual labels:  k8s
Virtlet
Kubernetes CRI implementation for running VM workloads
Stars: ✭ 620 (-10.01%)
Mutual labels:  k8s
Dns
Kubernetes DNS service
Stars: ✭ 561 (-18.58%)
Mutual labels:  k8s

Build Status Go Report Card Maintainability Gitter chat

hetzner-kube: fast and easy setup of kubernetes clusters on Hetzner Cloud

This project contains a CLI tool to easily provision kubernetes clusters on Hetzner Cloud.

This is my very first tool written in Go.

How to install

Binary releases

Get the binary from releases page

From source

hetzner-kube is written in Go. To install Go please follow the instructions on its homepage.

To get and build hetzner-kube from source run this command:

$ go get -u github.com/xetys/hetzner-kube

The project source will now be in your $GOPATH directory ($GOPATH/src/github.com/xetys/hetzner-kube) and the binary will be in $GOPATH/bin.

If you want to build it yourself later, you can change into the source directory and run go build or go install.

Code completion

BASH

To load completion run

source <(hetzner-kube completion bash)

To configure your bash shell to load completions for each session add to your "~/.bashrc" file

# ~/.bashrc or ~/.profile
echo 'source <(hetzner-kube completion bash)\n' >> ~/.bashrc

Or you can add it to your bash_completition.d folder:

# On linux
hetzner-kube completion bash > /etc/bash_completion.d/hetzner-kube
# On OSX with completion installed via brew (`brew install bash-completion`)
hetzner-kube completion bash > /usr/local/etc/bash_completion.d/hetzner-kube

ZSH

To configure your zsh shell to load completions run following commands:

# On linux
hetzner-kube completion zsh | sudo tee /usr/share/zsh/vendor-completions/_hetzner-kube
# On OSX
hetzner-kube completion zsh | sudo tee /usr/share/zsh/site-functions/_hetzner-kube

Than rebuild autocomplete function with:

compinits

Usage

In your Hetzner Console generate an API token and

$ hetzner-kube context add my-project
Token: <PASTE-TOKEN-HERE>

Then you need to add an SSH key:

$ hetzner-kube ssh-key add -n my-key

This assumes, you already have a SSH keypair ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub

And finally, you can create a cluster by running:

$ hetzner-kube cluster create --name my-cluster --ssh-key my-key

This will provision a brand new kubernetes cluster in latest version!

To access the cluster via kubectl, create a config file:

# Write ~/.kube/config (you'll be asked to overwrite if file already exists)
hetzner-kube cluster kubeconfig my-cluster
# Alternatively, create a separate file and point kubectl to it:
#hetzner-kube cluster kubeconfig --print my-cluster > ~/.kube/config-my-cluster
#export KUBECONFIG=~/.kube/config-my-cluster

For a full list of options that can be passed to the cluster create command, see the Cluster Create Guide for more information.

HA-clusters

You can build high available clusters with hetzner-kube. Read the High availability Guide for further information.

Custom Options

addons

You can install some addons to your cluster using the cluster addon sub-command. Get a list of addons using:

$ hetzner-kube cluster addon list

contributing new addons

You want to add some cool stuff to hetzner-kube? It's quite easy! Learn how to add new addons in the Developing Addons documentation.

backup & restore (for HA-clusters)

If you are running an external etcd cluster, you can use the etcd management to backup the etcd cluster using

$ hetzner-kube cluster etcd backup my-cluster --snapshot-name my-snapshot

(--snapshot-name is optional)

and restore it using

$ hetzner-kube cluster etcd restore my-cluster --snapshot-name my-snapshot

If you place a different snapshot (with .db file extension) in /root/etcd-snapshots of the first etcd node, you can use the restore command for migration of kubernetes clusters.

phases

After a cluster is once created (nodes creation is enough), you can perform the steps from hetzner-kube cluster create separately.

You can use

$ hetzner-kube cluster phase -h

to only list all available phases.

Cluster creation is a chain of these phases:

  • provision
  • network-setup
  • etcd (if HA)
  • install-masters
  • setup-ha (if HA)
  • install-workers

Some of theses phase have additional options, to run the actual phase differently from the usual cluster creation.

examples for phases

To simply run a phase from cluster creation, you cam run a phase, eg. the etcd phase using:

$ hetzner-kube cluster phase etcd my-cluster

In order to upgrade or migrate a cluster, you might want to keep the etcd data, and run

$ hetzner-kube cluster phase etcd my-cluster --keep-data

and preserve the existing certificates using

$ hetzner-kube cluster phase install-master my-cluster --keep-all-certs

The latter command can be also useful during cluster migration, if you place the existing certs in /etc/kubernetes/pki before running the install-masters phase.

cloud-init

If you like to run some scripts or install some additional packages while provisioning new servers, you can use cloud-init

$ hetzner-kube cluster create --name my-cluster --nodes 3 --ssh-key my-key --cloud-init <PATH-TO-FILE>

An example file to make all nodes ansible ready. The comment on the first line is important:

#cloud-config
package_update: true
packages:
 - python

Full tutorial

This article guides through a full cluster setup.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].