Setup - HCloud
Setting up a Kubernetes Cluster with Hetzner Cloud (hcloud)
Last updated
Was this helpful?
Was this helpful?
brew install terraformbrew install hcloud
hcloud context create <project_name>brew install kubernetes-clibrew install wget
brew install jqgit submodule update --init# Optional
(cd hcloud && direnv allow)
# Optional
(cd hcloud && virtualenv -p python3 venv)(cd hcloud && pip install -r ansible/requirements.txt)
(cd hcloud && ansible-galaxy install -r ansible/requirements.yml)make hcloudvar.name
The base name used for all resources
Enter a value: ma-k8s
var.token
Hetzner Cloud API token
Enter a value: <secret>
var.user_name
The admin user name for the nodes
Enter a value: admin(cd hcloud && scp $(terraform output -raw hcloud_config) ~/.kube/config-hcloud)
# Merge it and set current context
KUBECONFIG=~/.kube/config:~/.kube/config-hcloud kubectl config view --flatten > ~/.kube/tmpcfg && mv -f ~/.kube/tmpcfg ~/.kube/config && kubectl config use-context $(kubectl config current-context --kubeconfig=$HOME/.kube/config-hcloud)
kubectl version