Giter Site home page Giter Site logo

hetzner-kube's Introduction

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!

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.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.