All Projects → cluster-api-provider-hcloud → cluster-api-provider-hcloud

cluster-api-provider-hcloud / cluster-api-provider-hcloud

Licence: Apache-2.0 license
Cluster API infrastructure provider for Hetzner's Hcloud

Programming Languages

go
31211 projects - #10 most used programming language
Starlark
911 projects
shell
77523 projects
Jsonnet
166 projects

Projects that are alternatives of or similar to cluster-api-provider-hcloud

ui-driver-hetzner
Rancher UI driver for the Hetzner Cloud docker driver.
Stars: ✭ 238 (+815.38%)
Mutual labels:  hetzner, hcloud
hetzner.hcloud
A collection containing modules to manage resources on the Hetzner Cloud.
Stars: ✭ 58 (+123.08%)
Mutual labels:  hetzner, hcloud
hcloud-pricing-exporter
A prometheus exporter for the current pricing and costs of your HCloud account
Stars: ✭ 19 (-26.92%)
Mutual labels:  hetzner, hcloud
hcloud-rust
Unofficial Rust crate for accessing the Hetzner Cloud API
Stars: ✭ 22 (-15.38%)
Mutual labels:  hetzner, hcloud
wireguard-setup
WireGuard and Unbound setup with Packer and Terraform.
Stars: ✭ 55 (+111.54%)
Mutual labels:  hetzner, hcloud
cluster-api-provider-digitalocean
The DigitalOcean provider implementation of the Cluster Management API
Stars: ✭ 85 (+226.92%)
Mutual labels:  k8s-sig-cluster-lifecycle, cluster-api
hcloud-ruby
Native ruby client for HetznerCloud
Stars: ✭ 29 (+11.54%)
Mutual labels:  hetzner, hcloud
hcloud-ip-floater
k8s controller for Hetzner Cloud floating IPs
Stars: ✭ 43 (+65.38%)
Mutual labels:  hetzner, hcloud
cluster-api-provider-ibmcloud
Cluster API Provider for IBM Cloud
Stars: ✭ 46 (+76.92%)
Mutual labels:  k8s-sig-cluster-lifecycle
das-schiff
This is home of Das Schiff - Deutsche Telekom Technik's engine for Kubernetes Cluster as a Service (CaaS) in on-premise environment on top of bare-metal servers and VMs.
Stars: ✭ 262 (+907.69%)
Mutual labels:  cluster-api
cluster-api-provider-tinkerbell
Cluster API Infrastructure Provider for Tinkerbell
Stars: ✭ 56 (+115.38%)
Mutual labels:  cluster-api
docker-volume-hetzner
Docker Volume Plugin for accessing Hetzner Cloud Volumes
Stars: ✭ 81 (+211.54%)
Mutual labels:  hetzner
cluster-api-provider-openstack
cluster-api-openstack.sigs.k8s.io/
Stars: ✭ 187 (+619.23%)
Mutual labels:  k8s-sig-cluster-lifecycle
image-builder
Cross provider Kubernetes image building utility.
Stars: ✭ 187 (+619.23%)
Mutual labels:  k8s-sig-cluster-lifecycle
disk-encryption-hetzner
Encrypt a hetzner server from the "serverbörse" and unlock it remote via ssh
Stars: ✭ 122 (+369.23%)
Mutual labels:  hetzner
molecule-hetznercloud
Molecule Hetzner Cloud driver 💀
Stars: ✭ 21 (-19.23%)
Mutual labels:  hetzner
cluster-api-provider-nested
Cluster API Provider for Nested Clusters
Stars: ✭ 240 (+823.08%)
Mutual labels:  k8s-sig-cluster-lifecycle
system-validators
A set of system-oriented validators for kubeadm preflight checks.
Stars: ✭ 22 (-15.38%)
Mutual labels:  k8s-sig-cluster-lifecycle
terraform-provider-hetznerdns
Terraform provider for Hetzner DNS
Stars: ✭ 78 (+200%)
Mutual labels:  hetzner
hetzner-rescaler
Lightweight CLI tool to programmatically rescale your Hetzner virtual server daily to optimize your budget spending
Stars: ✭ 44 (+69.23%)
Mutual labels:  hetzner

cluster-api-provider-hcloud

New project ->: https://github.com/syself/cluster-api-provider-hetzner

⚠️ Deprecation notice: We decided to archive this project and to start a fresh one out of several reasons. We wanted to re-design the structure of the project. For example, we got rid of Bazel and Packer and started with the latest skaffolding of kubebuilder. This makes it more comparable to the other provider integrations and easier to use. We are no longer accepting pull requests or providing support. We urge all cluster-api-provider-hcloud users to migrate to cluster-api-provider-hetzner as soon as possible.

Cluster API infrastructure provider for Hetzner Cloud https://hetzner.cloud

Docs

https://docs.capihc.com/ or under ./docs/src

Time estimation

Task Time
Full cluster ~15-30min
For the packer ~10-15min
Snapshot ~2-3min
First control-plane, worker-nodes are created after ~4min
Cluster creation without packer and snapshot 3 control planes, 3 worker ~10min
Worker upscale ~1-2min
Worker downscale ~20s
Control plane upscale per node ~2.5min
Control plane downscale per node ~1min

Quick start

More information available in the Cluster API - Quick Start guide

Before you can start you need a management Cluster. If you have no management cluster you can use the ./demo/setup.sh to get a kind cluster. If you are not using the script because you have already a managment cluster please ensure to have the following enabled:

export EXP_CLUSTER_RESOURCE_SET=true
clusterctl init --core cluster-api:v0.3.13

Please ensure you have a recent clusterctl release (tested with v0.3.16). You can test with clusterctl version

Now we can start by creating a secret in management cluster. $TOKEN is a placeholder for your HETZNER API Token. You can create one in your Project under security/API TOKENS.

kubectl create secret generic hetzner-token --from-literal=token=$TOKEN

Then we need to create an SSH Key for the nodes. Because this is a quickstart we have specified the name of the Key, but of course feel free to change the name, but remember to do it also in cluster.yaml file. Then upload the public Key to Hetzner Cloud.

ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/cluster

For deploying necessary applications like the CNI, CCM, CSI etc. We use the ClusterResourceSets and apply them to our managment cluster.

kubectl apply -f ./demo/ClusterResourceSets

Then we need to register this infrastructure provider in your $HOME/.cluster-api/clusterctl.yaml:

providers:
  - name: "hcloud"
    url: "https://github.com/cluster-api-provider-hcloud/cluster-api-provider-hcloud/releases/latest/infrastructure-components.yaml"
    type: "InfrastructureProvider"

Now we deploy the API components to the management cluster

clusterctl init --infrastructure hcloud:v0.1.4

Now we can deploy our first Cluster. For production use it is recommended to use your own templates with all configurations. [name] is the placeholder for your cluster name like cluster-dev

clusterctl config cluster [name] | kubectl apply -f -

or use helm

helm install cluster ./demo/helm-charts/cluster-demo

You can check now the status of your target cluster via your management cluster:

kubectl get cluster --all-namespaces

### To verify the first control plane is up:
kubectl get kubeadmcontrolplane --all-namespaces

To get access to your target cluster you can retrieve the kubeconfig file and use it via ENV. [name] is the placeholder for your above defined cluster name.

export KUBECONFIG_GUEST=$(pwd)/.kubeconfig-[name]
kubectl --namespace=default get secret [name]-kubeconfig \
   -o jsonpath={.data.value} | base64 --decode \
   > $KUBECONFIG_GUEST

To verify you have access try:

KUBECONFIG=$KUBECONFIG_GUEST kubectl get nodes

If you want you can now move all the cluster-api Resources from your management Cluster to your Target Cluster:

export EXP_CLUSTER_RESOURCE_SET=true
KUBECONFIG=$KUBECONFIG_GUEST clusterctl init --core cluster-api:v0.3.16
KUBECONFIG=$KUBECONFIG_GUEST clusterctl init --infrastructure hcloud:v0.1.4
clusterctl move --to-kubeconfig $KUBECONFIG_GUEST

### You also need to create your Hetzner Token secret on the new management cluster
### If you use helm please keep in mind to also move the helm secret 

To delete the cluster (if management cluster not equal target cluster)

kubectl delete cluster [name]

or with helm

helm uninstall cluster

To delete your managment cluster (setup via setup.sh)

kind delete cluster --name capi-hcloud

Debugging

### Getting information about the cluster
KUBECONFIG=$KUBECONFIG_GUEST kubectl get all,nodes -A

### Getting informations about cluster-api
watch kubectl get hcloudclusters,cluster,hcloudmachines,baremetalmachines,machines

### cluster-info
KUBECONFIG=$KUBECONFIG_GUEST kubectl get cm cluster-info -n kube-public -o yaml

# Logs
### Provider Integration
kubectl logs -f deployment/capi-hcloud-controller-manager -c manager -n capi-hcloud-system

### Cluster-API Controller
kubectl logs -f deployment/capi-controller-manager -c manager -n capi-system

### Bootstrap Controller
kubectl logs -f deployment/capi-kubeadm-bootstrap-controller-manager -c manager  -n capi-kubeadm-bootstrap-system

### Kubeadm Control-plane Controller
kubectl logs -f deployment/capi-kubeadm-control-plane-controller-manager -c manager  -n capi-kubeadm-control-plane-system

### Kubernetes Events
kubectl get events -o custom-columns=FirstSeen:.firstTimestamp,LastSeen:.lastTimestamp,Count:.count,From:.source.component,Type:.type,Re│
ason:.reason,Message:.message --watch

### Get kubeadm-config
kubectl -n kube-system get cm kubeadm-config -o yaml

For Developers

Please use this for testing!

See ./docs/src/developers or https://docs.capihc.com/developer/developer.html

Prerequisites

  • clusterctl

  • docker

  • kind

  • kubectl

  • kustomize

  • kubebuilder

  • packer

  • BAZEL

  • Go 1.13

  • gomock

  • watch (On MAC: brew install watch)

  • JQ (On MAC: brew install jq)

  • Running development version

This creates the management cluster with all the controllers

# Deploy kind cluster with cluster-api core componets
./demo/setup.sh

# Build project and deploy to local cluster
make deploy_kind
  • Applying the target cluster with demo-cluster
# Please create an SSH Key for later access on the nodes.
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/cluster

# Create a Project on Hetzner Cloud and upload the public key. 

# Create a token on Hetzner Cloud and apply it as secret
kubectl create secret generic hetzner-token --from-literal=token=$TOKEN

#For automatic installation of manifests we use ClusterResourceSets
kubectl apply -f demo/ClusterResourceSets

## You can choose which manifests should be applyed by setting the value of the labels under kind: Cluster

# Apply the manifest to your management cluster; use quickstart guide for getting access to the target cluster
kubectl apply -f ./demo/cluster-minimal.yaml

## Get Logs:
kubectl logs -f deployment/capi-hcloud-controller-manager -c manager --v=4 -n capi-hcloud-system

# Deleting the target cluster
kubectl delete -f ./demo/demo-cluster.yaml

# Deleting the controller
make delete_capihc

# Deleting the management cluster
kind delete cluster --name capi-hcloud
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].