mirror of
https://github.com/2martens/terraform.git
synced 2026-10-17 18:46:52 +02:00
Add tag to network and subnet
This commit is contained in:
@@ -10,6 +10,9 @@ resource "hcloud_network" "kubernetes-network" {
|
||||
name = "kubernetes"
|
||||
ip_range = "10.0.0.0/8"
|
||||
delete_protection = true
|
||||
labels = {
|
||||
"kubernetes.io/cluster/${local.test_cluster}" : "shared"
|
||||
}
|
||||
}
|
||||
|
||||
resource "hcloud_network_subnet" "k8s-network-subnet" {
|
||||
@@ -17,6 +20,9 @@ resource "hcloud_network_subnet" "k8s-network-subnet" {
|
||||
network_id = hcloud_network.kubernetes-network.id
|
||||
network_zone = "eu-central"
|
||||
ip_range = "10.0.0.0/16"
|
||||
labels = {
|
||||
"kubernetes.io/cluster/${local.test_cluster}" : "shared"
|
||||
}
|
||||
}
|
||||
|
||||
resource "hcloud_firewall" "basic-firewall" {
|
||||
|
||||
+3
-2
@@ -19,7 +19,8 @@ data "hcloud_ssh_key" "macos" {
|
||||
}
|
||||
|
||||
locals {
|
||||
domain = "2martens.de"
|
||||
domain = "2martens.de"
|
||||
test_cluster = "test"
|
||||
}
|
||||
|
||||
module "test_cluster" {
|
||||
@@ -51,7 +52,7 @@ module "test_cluster" {
|
||||
cidrhost(hcloud_network_subnet.k8s-network-subnet.ip_range, 6)
|
||||
]
|
||||
server_subnet_id = hcloud_network_subnet.k8s-network-subnet.id
|
||||
cluster_name = "test"
|
||||
cluster_name = local.test_cluster
|
||||
argocd_environment = "test"
|
||||
number_nodes = 1
|
||||
server_type = "cax21"
|
||||
|
||||
Reference in New Issue
Block a user