hetzner-k3s 0.3.4 → 0.3.8
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 +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -1
- data/lib/hetzner/infra/firewall.rb +5 -0
- data/lib/hetzner/k3s/cli.rb +2 -1
- data/lib/hetzner/k3s/cluster.rb +6 -2
- data/lib/hetzner/k3s/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fdaf203f7f6bd6c8fec1ef578ab63bb252646975a1e8fcbc9163c6383cb89f7
|
|
4
|
+
data.tar.gz: 24281bf2c3e1aa4ee234e36bb847e7e3282f7c468284c2b97e4eae6630d33fa3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2d0012766b865d8625c23de2ce4585235765d527732a7352b24dcdfab92a27666df02b12d0b2c362d44c91f98556e806fc31e6c95f906d9a3441cf0b5e668df
|
|
7
|
+
data.tar.gz: 3f069ba0a23f430e0647c666da5acd65fdc9d05cc3d3ab55e1f761251d6e11f7cfda04a1d15d95fef68cde21235a779defd7644d55fb48bc9e08412135a447b5
|
data/Dockerfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -38,7 +38,7 @@ This will install the `hetzner-k3s` executable in your PATH.
|
|
|
38
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
39
|
|
|
40
40
|
```bash
|
|
41
|
-
docker run --rm -it -v ${PWD}:/cluster -v ${HOME}/.ssh:/tmp/.ssh vitobotta/hetzner-k3s create-cluster --config-file /cluster/test.yaml
|
|
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
42
|
```
|
|
43
43
|
|
|
44
44
|
Replace `test.yaml` with the name of your config file.
|
|
@@ -227,6 +227,18 @@ Once the cluster is ready you can create persistent volumes out of the box with
|
|
|
227
227
|
|
|
228
228
|
## changelog
|
|
229
229
|
|
|
230
|
+
- 0.3.8
|
|
231
|
+
- Fix: added a check on a label to ensure that only servers that belong to the cluster are deleted from the project.
|
|
232
|
+
|
|
233
|
+
- 0.3.7
|
|
234
|
+
- Ensure that the cluster name only contains lowercase letters, digits and dashes for compatibility with the cloud controller manager
|
|
235
|
+
|
|
236
|
+
- 0.3.6
|
|
237
|
+
- Retry SSH commands when IO errors occur
|
|
238
|
+
|
|
239
|
+
- 0.3.5
|
|
240
|
+
- Add descriptions for firewall rules
|
|
241
|
+
|
|
230
242
|
- 0.3.4
|
|
231
243
|
- Added Docker support
|
|
232
244
|
|
|
@@ -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
|
@@ -457,7 +457,7 @@ class Cluster
|
|
|
457
457
|
|
|
458
458
|
puts "...server #{server_name} is now up."
|
|
459
459
|
end
|
|
460
|
-
rescue Errno::ENETUNREACH, Errno::EHOSTUNREACH, Timeout::Error
|
|
460
|
+
rescue Errno::ENETUNREACH, Errno::EHOSTUNREACH, Timeout::Error, IOError
|
|
461
461
|
retry
|
|
462
462
|
end
|
|
463
463
|
|
|
@@ -501,7 +501,7 @@ class Cluster
|
|
|
501
501
|
end
|
|
502
502
|
|
|
503
503
|
def all_servers
|
|
504
|
-
@all_servers ||= hetzner_client.get("/servers")["servers"]
|
|
504
|
+
@all_servers ||= hetzner_client.get("/servers")["servers"].select{ |server| belongs_to_cluster?(server) == true }
|
|
505
505
|
end
|
|
506
506
|
|
|
507
507
|
def masters
|
|
@@ -624,4 +624,8 @@ class Cluster
|
|
|
624
624
|
temp_file_path
|
|
625
625
|
end
|
|
626
626
|
|
|
627
|
+
def belongs_to_cluster?(server)
|
|
628
|
+
server.dig("labels", "cluster") == cluster_name
|
|
629
|
+
end
|
|
630
|
+
|
|
627
631
|
end
|
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.8
|
|
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-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|