Skip to content

Commit c72b41c

Browse files
committed
feat: switch from terraform to hetzner-k3s
1 parent 19f34f8 commit c72b41c

File tree

7 files changed

+62
-98
lines changed

7 files changed

+62
-98
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"installTerraformDocs": true
88
},
99
"ghcr.io/dhoeric/features/trivy:1": {},
10-
"ghcr.io/devcontainers-contrib/features/argo-cd:1": {}
10+
"ghcr.io/devcontainers-contrib/features/argo-cd:1": {},
11+
"ghcr.io/devcontainers-extra/features/gh-release:1": {
12+
"repo": "vitobotta/hetzner-k3s",
13+
"binaryNames": "hetzner-k3s"
14+
}
1115
},
1216
"customizations": {
1317
"vscode": {

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
CLUSTER ?= dev
16+
CLUSTER_ROOT = ./clusters
17+
OUTPUT_FILE ?= /tmp/config.yaml
18+
1519
cruft-update:
1620
ifeq (,$(wildcard .cruft.json))
1721
@echo "Cruft not configured"
1822
else
1923
@cruft check || cruft update --skip-apply-ask --refresh-private-variables
2024
endif
2125
.PHONY: cruft-update
26+
27+
generate-config:
28+
@yq '. *= load("${CLUSTER_ROOT}/${CLUSTER}.yaml")' ${CLUSTER_ROOT}/common.yaml > ${OUTPUT_FILE}
29+
.PHONY: generate-config

clusters/common.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
kubeconfig_path: "~/.kube/config"
2+
k3s_version: v1.31.3+k3s1
3+
4+
networking:
5+
ssh:
6+
port: 2244
7+
use_agent: false
8+
public_key_path: "~/.ssh/homelab.pub"
9+
private_key_path: "~/.ssh/homelab"
10+
allowed_networks:
11+
ssh:
12+
- 0.0.0.0/0
13+
api:
14+
- 0.0.0.0/0
15+
public_network:
16+
ipv4: true
17+
ipv6: true
18+
private_network:
19+
enabled: true
20+
subnet: 10.0.0.0/16
21+
cni:
22+
enabled: true
23+
encryption: true
24+
mode: cilium
25+
26+
datastore:
27+
mode: etcd
28+
29+
schedule_workloads_on_masters: true
30+
31+
image: ubuntu-24.04
32+
33+
masters_pool:
34+
instance_type: cx32
35+
instance_count: 3
36+
location: nbg1
37+
38+
kube_cloud_controller_manager_args:
39+
networking:
40+
enabled: true
41+
env:
42+
- name: HCLOUD_LOAD_BALANCERS_ENABLED
43+
value: false

clusters/dev.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cluster_name: dev
2+
networking:
3+
private_network:
4+
subnet: 10.2.0.0/16

clusters/prod.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cluster_name: prod

modules/kubernetes/files/cloud-controller-manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ networking:
33

44
env:
55
HCLOUD_LOAD_BALANCERS_ENABLED:
6-
value: "false"
6+
value: "false"

modules/kubernetes/hetzner.tf

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)