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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 362875671a52928fd320f24cb0ef38728fe85f5395282f8d9df9550c8531162f
4
- data.tar.gz: b873e5f6823a443f48577a5126c20f2b5b4db3a1e2c4fb791af059718cbf39a0
3
+ metadata.gz: 3fdaf203f7f6bd6c8fec1ef578ab63bb252646975a1e8fcbc9163c6383cb89f7
4
+ data.tar.gz: 24281bf2c3e1aa4ee234e36bb847e7e3282f7c468284c2b97e4eae6630d33fa3
5
5
  SHA512:
6
- metadata.gz: ecee605e0fc079b62a3cd6af152d30dbdb7ea5cb4785f8a2bcda6218996f7a86bcdcac23f0010d61f6a16e7964f6e587f0c6e0a54ba41c790af15c6490b3ecdb
7
- data.tar.gz: 476d5dd9a39dfd45258cd32d208e3e15d6f79f6cf326d482694e6b6311259731ebb090965fc1dcefbb216ee25cd5e01cbdfb36d5a65bafa9a80e56eb047e3d7c
6
+ metadata.gz: a2d0012766b865d8625c23de2ce4585235765d527732a7352b24dcdfab92a27666df02b12d0b2c362d44c91f98556e806fc31e6c95f906d9a3441cf0b5e668df
7
+ data.tar.gz: 3f069ba0a23f430e0647c666da5acd65fdc9d05cc3d3ab55e1f761251d6e11f7cfda04a1d15d95fef68cde21235a779defd7644d55fb48bc9e08412135a447b5
data/Dockerfile CHANGED
@@ -3,6 +3,9 @@ FROM ruby:2.7.4-alpine
3
3
  RUN apk update --no-cache \
4
4
  && apk add build-base git openssh-client
5
5
 
6
+ COPY Gemfile Gemfile
7
+ COPY hetzner-k3s.gemspec hetzner-k3s.gemspec
8
+
6
9
  RUN gem install hetzner-k3s
7
10
 
8
11
  COPY entrypoint.sh /entrypoint.sh
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hetzner-k3s (0.3.4)
4
+ hetzner-k3s (0.3.8)
5
5
  bcrypt_pbkdf
6
6
  ed25519
7
7
  http
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",
@@ -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([A-Za-z0-9\-\_]+)\Z/
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Hetzner
2
2
  module K3s
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.8"
4
4
  end
5
5
  end
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
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-17 00:00:00.000000000 Z
11
+ date: 2021-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor