janosmiko / hetzner-k3s Goto Github PK
View Code? Open in Web Editor NEWThis is a CLI tool to quickly create and manage Kubernetes clusters in Hetzner Cloud using the lightweight Kubernetes distribution k3s from Rancher.
License: MIT License
This is a CLI tool to quickly create and manage Kubernetes clusters in Hetzner Cloud using the lightweight Kubernetes distribution k3s from Rancher.
License: MIT License
Currently, the servers created by the Cluster Autoscaler are not added to the firewall even when the HCLOUD_FIREWALL environment variable is set properly.
As a workaround set the firewall to be applied to servers using "hcloud/node-group" labels.
In a new and empty hcloud project I created a token and used the docker image and the example yaml-file (see below). Only change is the k3s version, for which I chose 1.25.5-k3s1. All resources are created as expected, but when hetzner-k3s reaches the "Deploying Hetzner CSI Driver..." step the application crashes:
Command output: Error from server (NotFound): error when deleting "STDIN": csidrivers.storage.k8s.io "csi.hetzner.cloud" not found
Exit code: exit status 1
Error: cannot create cluster: cannot deploy hetzner csi driver: shell command exited with error: 1, output: Error from server (NotFound): error when deleting "STDIN": csidrivers.storage.k8s.io "csi.hetzner.cloud" not found
Restarting the cluster-create command does not yield a different result.
In this line
hetzner-k3s/internal/k3s/hetzner.go
Line 115 in 13e7b15
I've manually added the CSIDriver with the yaml configuration (as defined for deletion)
hetzner-k3s/internal/k3s/hetzner.go
Lines 307 to 316 in 13e7b15
create-cluster
command again. This time all ran successfully.
I'm happy to provide more information if requried.
As mentioned above my yaml-file:
---
hetzner_token: <my-token>
cluster_name: test
kubeconfig_path: "/cluster/kubeconfig"
k3s_version: v1.25.5+k3s1
public_ssh_key_path: "/tmp/.ssh/id_rsa.pub"
private_ssh_key_path: "/tmp/.ssh/id_rsa"
verify_host_key: false
location: nbg1
schedule_workloads_on_masters: false
masters:
instance_type: cpx21
instance_count: 3
worker_node_pools:
- name: small
instance_type: cpx21
instance_count: 4
- name: big
instance_type: cpx31
instance_count: 2
autoscaling_node_pools:
- name: small
instance_type: cx41
instance_min: 3
instance_max: 5
- name: big
instance_type: cpx51
instance_max: 10
post_create_commands:
- apt update
- apt upgrade -y
- apt autoremove -y
- shutdown -r now
enable_encryption: true
Command to run:
docker run --rm -it \
-v ${PWD}:/cluster \
-v ${HOME}/.ssh:/tmp/.ssh \
janosmiko/hetzner-k3s:v0.1.5 \
create-cluster \
--config-file /cluster/test.yaml
If you can use the env variable (which did not work for me btw), the hetzner_token key should not be required in the yaml.
If the number of masters is 3, make it possible to create the masters in 3 different regions.
Eg:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.