hetzner-k3s 0.3.2 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +11 -0
- data/Gemfile.lock +5 -1
- data/README.md +25 -0
- data/entrypoint.sh +12 -0
- data/hetzner-k3s.gemspec +2 -0
- data/lib/hetzner/infra/firewall.rb +5 -0
- data/lib/hetzner/k3s/cluster.rb +1 -1
- data/lib/hetzner/k3s/version.rb +1 -1
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b1b2acb7f0649eac91750409418446c2b1ffea2b1b7a32b1f9f8a6fd2d50c5b
|
4
|
+
data.tar.gz: 457994e28a028e8a1052e20a68ab653bb41fdf5fb88160f43e51b3de49bc8710
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 743edefe6fdaa9ebf9dc2236e4ce672f44d10bcbe954bda7a1560c4166cacf12824eb6c994dfe635543746c402696d981a22224852bb25a7df7558c81bdbbff3
|
7
|
+
data.tar.gz: 506488a2edac4c9e7b68d09e8b8dd8a970993dc8a87ba7d6bf3200856f4384ebe90362ea2fe337e2cdb4f43cb951b7c79c2a9a26154ed278b1704c369b88e85a
|
data/Dockerfile
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hetzner-k3s (0.3.
|
4
|
+
hetzner-k3s (0.3.6)
|
5
|
+
bcrypt_pbkdf
|
6
|
+
ed25519
|
5
7
|
http
|
6
8
|
k8s-ruby
|
7
9
|
net-ssh
|
@@ -13,6 +15,7 @@ GEM
|
|
13
15
|
specs:
|
14
16
|
addressable (2.8.0)
|
15
17
|
public_suffix (>= 2.0.2, < 5.0)
|
18
|
+
bcrypt_pbkdf (1.1.0)
|
16
19
|
concurrent-ruby (1.1.9)
|
17
20
|
diff-lcs (1.4.4)
|
18
21
|
domain_name (0.5.20190701)
|
@@ -43,6 +46,7 @@ GEM
|
|
43
46
|
dry-equalizer (~> 0.2)
|
44
47
|
dry-inflector (~> 0.1, >= 0.1.2)
|
45
48
|
dry-logic (~> 0.4, >= 0.4.2)
|
49
|
+
ed25519 (1.2.4)
|
46
50
|
excon (0.85.0)
|
47
51
|
ffi (1.15.3)
|
48
52
|
ffi-compiler (1.0.1)
|
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 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.6
|
231
|
+
- Retry SSH commands when IO errors occur
|
232
|
+
|
233
|
+
- 0.3.5
|
234
|
+
- Add descriptions for firewall rules
|
235
|
+
|
236
|
+
- 0.3.4
|
237
|
+
- Added Docker support
|
238
|
+
|
239
|
+
- 0.3.3
|
240
|
+
- Add some gems required on Linux
|
241
|
+
|
217
242
|
- 0.3.2
|
218
243
|
- Configure DNS to use Cloudflare's resolver instead of Hetzner's, since Hetzner's resolvers are not always reliable
|
219
244
|
|
data/entrypoint.sh
ADDED
data/hetzner-k3s.gemspec
CHANGED
@@ -23,6 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency "net-ssh"
|
24
24
|
spec.add_dependency "k8s-ruby"
|
25
25
|
spec.add_dependency "sshkey"
|
26
|
+
spec.add_dependency "ed25519"
|
27
|
+
spec.add_dependency "bcrypt_pbkdf"
|
26
28
|
|
27
29
|
# Specify which files should be added to the gem when it is released.
|
28
30
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -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/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.6
|
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
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: ed25519
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bcrypt_pbkdf
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
description: A CLI to create a Kubernetes cluster in Hetzner Cloud very quickly using
|
84
112
|
k3s.
|
85
113
|
email:
|
@@ -93,6 +121,7 @@ files:
|
|
93
121
|
- ".rspec"
|
94
122
|
- ".travis.yml"
|
95
123
|
- CODE_OF_CONDUCT.md
|
124
|
+
- Dockerfile
|
96
125
|
- Gemfile
|
97
126
|
- Gemfile.lock
|
98
127
|
- LICENSE.txt
|
@@ -101,6 +130,7 @@ files:
|
|
101
130
|
- bin/console
|
102
131
|
- bin/setup
|
103
132
|
- cluster_config.yaml.example
|
133
|
+
- entrypoint.sh
|
104
134
|
- exe/hetzner-k3s
|
105
135
|
- hetzner-k3s.gemspec
|
106
136
|
- lib/hetzner.rb
|