hetzner-k3s 0.3.3 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Dockerfile +14 -0
- data/Gemfile.lock +1 -1
- data/README.md +25 -0
- data/entrypoint.sh +12 -0
- data/lib/hetzner/infra/firewall.rb +5 -0
- data/lib/hetzner/k3s/cli.rb +2 -1
- data/lib/hetzner/k3s/cluster.rb +1 -1
- data/lib/hetzner/k3s/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb3b106422fe5e298a81ffe6b913593ff20a7cdbc7e658012f31f707b1f5732e
|
|
4
|
+
data.tar.gz: 5face1d08a752c26c93da8c5638c947b711d9fff4428c98f163f78bc3e206de8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 389f431593261968ac05127c93c9f49e3aee71836e4240183e74ba5292daae53c5ab1a985bbcef3015fff54957b9072bb6bb99ce6837f78acacfe7915dbeed94
|
|
7
|
+
data.tar.gz: 4fd8bd35216ab0c1c9204295c7a8c6009989b0af452c743da808310de9367c5461d07eb1af50e1059ace49026e278c7c1c11aaeb9ad139cedfbbdf18ce1bf8ca
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
FROM ruby:2.7.4-alpine
|
|
2
|
+
|
|
3
|
+
RUN apk update --no-cache \
|
|
4
|
+
&& apk add build-base git openssh-client
|
|
5
|
+
|
|
6
|
+
COPY Gemfile Gemfile
|
|
7
|
+
COPY hetzner-k3s.gemspec hetzner-k3s.gemspec
|
|
8
|
+
|
|
9
|
+
RUN gem install hetzner-k3s
|
|
10
|
+
|
|
11
|
+
COPY entrypoint.sh /entrypoint.sh
|
|
12
|
+
|
|
13
|
+
ENTRYPOINT ["/entrypoint.sh"]
|
|
14
|
+
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -33,6 +33,16 @@ gem install hetzner-k3s
|
|
|
33
33
|
|
|
34
34
|
This will install the `hetzner-k3s` executable in your PATH.
|
|
35
35
|
|
|
36
|
+
### With Docker
|
|
37
|
+
|
|
38
|
+
Alternatively, if you don't want to set up a Ruby runtime but have Docker installed, you can use a container. Run the following from inside the directory where you have the config file for the cluster (described in the next section):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
docker run --rm -it -v ${PWD}:/cluster -v ${HOME}/.ssh:/tmp/.ssh vitobotta/hetzner-k3s:v0.3.7 create-cluster --config-file /cluster/test.yaml
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Replace `test.yaml` with the name of your config file.
|
|
45
|
+
|
|
36
46
|
## Creating a cluster
|
|
37
47
|
|
|
38
48
|
The tool requires a simple configuration file in order to create/upgrade/delete clusters, in the YAML format like in the example below:
|
|
@@ -60,6 +70,9 @@ worker_node_pools:
|
|
|
60
70
|
|
|
61
71
|
It should hopefully be self explanatory; you can run `hetzner-k3s releases` to see a list of the available releases from the most recent to the oldest available.
|
|
62
72
|
|
|
73
|
+
If you are using Docker, then set `kubeconfig_path` to `/cluster/kubeconfig` so that the kubeconfig is created in the same directory where your config file is.
|
|
74
|
+
|
|
75
|
+
|
|
63
76
|
If you set `masters.instance_count` to 1 then the tool will create a non highly available control plane; for production clusters you may want to set it to a number greater than 1. This number must be odd to avoid split brain issues with etcd and the recommended number is 3.
|
|
64
77
|
|
|
65
78
|
You can specify any number of worker node pools for example to have mixed nodes with different specs for different workloads.
|
|
@@ -214,6 +227,18 @@ Once the cluster is ready you can create persistent volumes out of the box with
|
|
|
214
227
|
|
|
215
228
|
## changelog
|
|
216
229
|
|
|
230
|
+
- 0.3.7
|
|
231
|
+
- Ensure that the cluster name only contains lowercase letters, digits and dashes for compatibility with the cloud controller manager
|
|
232
|
+
|
|
233
|
+
- 0.3.6
|
|
234
|
+
- Retry SSH commands when IO errors occur
|
|
235
|
+
|
|
236
|
+
- 0.3.5
|
|
237
|
+
- Add descriptions for firewall rules
|
|
238
|
+
|
|
239
|
+
- 0.3.4
|
|
240
|
+
- Added Docker support
|
|
241
|
+
|
|
217
242
|
- 0.3.3
|
|
218
243
|
- Add some gems required on Linux
|
|
219
244
|
|
data/entrypoint.sh
ADDED
|
@@ -44,6 +44,7 @@ module Hetzner
|
|
|
44
44
|
name: cluster_name,
|
|
45
45
|
rules: [
|
|
46
46
|
{
|
|
47
|
+
"description": "Allow port 22 (SSH)",
|
|
47
48
|
"direction": "in",
|
|
48
49
|
"protocol": "tcp",
|
|
49
50
|
"port": "22",
|
|
@@ -54,6 +55,7 @@ module Hetzner
|
|
|
54
55
|
"destination_ips": []
|
|
55
56
|
},
|
|
56
57
|
{
|
|
58
|
+
"description": "Allow ICMP (ping)",
|
|
57
59
|
"direction": "in",
|
|
58
60
|
"protocol": "icmp",
|
|
59
61
|
"port": nil,
|
|
@@ -64,6 +66,7 @@ module Hetzner
|
|
|
64
66
|
"destination_ips": []
|
|
65
67
|
},
|
|
66
68
|
{
|
|
69
|
+
"description": "Allow port 6443 (Kubernetes API server)",
|
|
67
70
|
"direction": "in",
|
|
68
71
|
"protocol": "tcp",
|
|
69
72
|
"port": "6443",
|
|
@@ -74,6 +77,7 @@ module Hetzner
|
|
|
74
77
|
"destination_ips": []
|
|
75
78
|
},
|
|
76
79
|
{
|
|
80
|
+
"description": "Allow all TCP traffic between nodes on the private network",
|
|
77
81
|
"direction": "in",
|
|
78
82
|
"protocol": "tcp",
|
|
79
83
|
"port": "any",
|
|
@@ -83,6 +87,7 @@ module Hetzner
|
|
|
83
87
|
"destination_ips": []
|
|
84
88
|
},
|
|
85
89
|
{
|
|
90
|
+
"description": "Allow all UDP traffic between nodes on the private network",
|
|
86
91
|
"direction": "in",
|
|
87
92
|
"protocol": "udp",
|
|
88
93
|
"port": "any",
|
data/lib/hetzner/k3s/cli.rb
CHANGED
|
@@ -110,7 +110,8 @@ module Hetzner
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def validate_cluster_name
|
|
113
|
-
errors << "Cluster name is an invalid format" unless configuration["cluster_name"] =~ /\A
|
|
113
|
+
errors << "Cluster name is an invalid format (only lowercase letters, digits and dashes are allowed)" unless configuration["cluster_name"] =~ /\A[a-z\d-]+\z/
|
|
114
|
+
errors << "Ensure that the cluster name starts with a normal letter" unless configuration["cluster_name"] =~ /\A[a-z]+.*\z/
|
|
114
115
|
end
|
|
115
116
|
|
|
116
117
|
def validate_kubeconfig_path
|
data/lib/hetzner/k3s/cluster.rb
CHANGED
data/lib/hetzner/k3s/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hetzner-k3s
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vito Botta
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-08-
|
|
11
|
+
date: 2021-08-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -121,6 +121,7 @@ files:
|
|
|
121
121
|
- ".rspec"
|
|
122
122
|
- ".travis.yml"
|
|
123
123
|
- CODE_OF_CONDUCT.md
|
|
124
|
+
- Dockerfile
|
|
124
125
|
- Gemfile
|
|
125
126
|
- Gemfile.lock
|
|
126
127
|
- LICENSE.txt
|
|
@@ -129,6 +130,7 @@ files:
|
|
|
129
130
|
- bin/console
|
|
130
131
|
- bin/setup
|
|
131
132
|
- cluster_config.yaml.example
|
|
133
|
+
- entrypoint.sh
|
|
132
134
|
- exe/hetzner-k3s
|
|
133
135
|
- hetzner-k3s.gemspec
|
|
134
136
|
- lib/hetzner.rb
|