diff --git a/step3/infrastructure/adguard.tf b/step3/infrastructure/adguard.tf index 443d02a..44c479d 100644 --- a/step3/infrastructure/adguard.tf +++ b/step3/infrastructure/adguard.tf @@ -72,7 +72,7 @@ resource "kubernetes_service" "adguard_svc" { port = 3000 target_port = 3000 } - load_balancer_ip = "${var.network_subnet}.${var.adguard_catchall_host}" + load_balancer_ip = "${var.network_subnet}.${var.net_hosts.adguard_catchall}" selector = { "app" : "adguard" } @@ -97,7 +97,7 @@ resource "kubernetes_service" "adguard_udp_svc" { target_port = 53 protocol = "UDP" } - load_balancer_ip = "${var.network_subnet}.${var.adguard_host}" + load_balancer_ip = "${var.network_subnet}.${var.net_hosts.adguard}" selector = { "app" : "adguard" } @@ -122,7 +122,7 @@ resource "kubernetes_persistent_volume" "adguard_shared_nfs" { access_modes = ["ReadWriteMany"] persistent_volume_source { host_path { - path = var.nfs_adguard_path + path = var.nfs_storage.adguard } } } diff --git a/step3/infrastructure/master-backup.tf b/step3/infrastructure/master-backup.tf index 46e219f..59951fa 100644 --- a/step3/infrastructure/master-backup.tf +++ b/step3/infrastructure/master-backup.tf @@ -25,7 +25,7 @@ resource "kubernetes_persistent_volume" "etc_backup_shared_nfs" { access_modes = ["ReadWriteMany"] persistent_volume_source { host_path { - path = "${var.nfs_general_path}/etcd-backup" + path = "${var.nfs_storage.general}/etcd-backup" } } } diff --git a/step3/infrastructure/torrent.tf b/step3/infrastructure/torrent.tf index 21881b3..3eecd25 100644 --- a/step3/infrastructure/torrent.tf +++ b/step3/infrastructure/torrent.tf @@ -67,7 +67,7 @@ resource "kubernetes_service" "torrent_svc" { port = 3000 target_port = 3000 } - load_balancer_ip = "${var.network_subnet}.${var.rtorrent_rpc_host}" + load_balancer_ip = "${var.network_subnet}.${var.net_hosts.torrent_rpc}" selector = { "app" : "torrent" } @@ -91,7 +91,7 @@ resource "kubernetes_persistent_volume" "torrent_shared_nfs" { access_modes = ["ReadWriteMany"] persistent_volume_source { host_path { - path = var.nfs_torrent_path + path = var.nfs_storage.torrent } } } @@ -154,7 +154,7 @@ resource "kubernetes_deployment" "flood-torrent" { name = "FLOOD_DISABLE_AUTH" value = "true" } - args = ["--rthost", "${var.network_subnet}.${var.rtorrent_rpc_host}", + args = ["--rthost", "${var.network_subnet}.${var.net_hosts.torrent_rpc}", "--rtport", "5000", "-e", "HOME=/config", "--auth", "none", "-d", "/config/flood", "--allowedpath", "/config", "--allowedpath", "/data", diff --git a/step3/infrastructure/traefik.tf b/step3/infrastructure/traefik.tf index b56864e..16d6ac8 100644 --- a/step3/infrastructure/traefik.tf +++ b/step3/infrastructure/traefik.tf @@ -11,7 +11,7 @@ resource "helm_release" "traefik" { set { name = "service.spec.loadBalancerIP" - value = "${var.network_subnet}.${var.traefik_host}" + value = "${var.network_subnet}.${var.net_hosts.traefik}" } values = [ diff --git a/step3/infrastructure/variables.tf b/step3/infrastructure/variables.tf index 5359def..e47dec5 100644 --- a/step3/infrastructure/variables.tf +++ b/step3/infrastructure/variables.tf @@ -1,11 +1,6 @@ variable "network_subnet" {} -variable "rtorrent_rpc_host" {} -variable "nfs_general_path" {} -variable "nfs_torrent_path" {} -variable "nfs_adguard_path" {} -variable "adguard_host" {} -variable "adguard_catchall_host" {} -variable "traefik_host" {} +variable "nfs_storage" {} +variable "net_hosts" {} variable "traefik_api_key" {} variable "github_user" {} variable "github_pat" {} \ No newline at end of file diff --git a/step3/variables.tfvars b/step3/variables.tfvars index 5641ed1..32cebba 100644 --- a/step3/variables.tfvars +++ b/step3/variables.tfvars @@ -1,13 +1,18 @@ # Variables used for barebone kubernetes setup network_subnet = "192.168.50" -rtorrent_rpc_host = "245" -adguard_host = "240" -adguard_catchall_host = "249" -traefik_host = "234" -nfs_general_path = "/media/nfs" -nfs_torrent_path = "/mnt/drobo-storage/docker-volumes/torrent" -nfs_adguard_path = "/mnt/drobo-storage/docker-volumes/adguard" +net_hosts = { + adguard = "240" + adguard_catchall = "249" + traefik = "234" + torrent_rpc = "245" +} + +nfs_storage = { + general = "/media/nfs" + torrent = "/mnt/drobo-storage/docker-volumes/torrent" + adguard = "/mnt/drobo-storage/docker-volumes/adguard" +} # ENV variable: TRAEFIK_API_KEY sets traefik_api_key # ENV variable: GH_USER, GH_PAT for authentication with private containers \ No newline at end of file