From 7a9a25aa7f2b76671d4d3993185a12965c11400c Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sun, 14 Mar 2021 18:34:15 +0000 Subject: [PATCH] Abstract customised images. Images currently set are either multiarch or ARM64. Users willing to create their own k8s cluster in different architectures should find it easier to change images causing problems to desirable format. --- step3/infrastructure/adguard.tf | 2 +- step3/infrastructure/master-backup.tf | 2 +- step3/infrastructure/torrent.tf | 2 +- step3/infrastructure/variables.tf | 1 + step3/variables.tfvars | 7 +++++++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/step3/infrastructure/adguard.tf b/step3/infrastructure/adguard.tf index 44c479d..bcd7ad7 100644 --- a/step3/infrastructure/adguard.tf +++ b/step3/infrastructure/adguard.tf @@ -180,7 +180,7 @@ resource "kubernetes_deployment" "adguard" { } container { name = "adguard" - image = "adguard/adguardhome:arm64-edge" + image = var.images.adguard port { container_port = 53 protocol = "TCP" diff --git a/step3/infrastructure/master-backup.tf b/step3/infrastructure/master-backup.tf index 59951fa..505a736 100644 --- a/step3/infrastructure/master-backup.tf +++ b/step3/infrastructure/master-backup.tf @@ -83,7 +83,7 @@ resource "kubernetes_cron_job" "etcd_backup" { } container { name = "etcd-backup" - image = "gcr.io/etcd-development/etcd:v3.4.15-arm64" + image = var.images.etcd env { name = "ETCDCTL_API" value = "3" diff --git a/step3/infrastructure/torrent.tf b/step3/infrastructure/torrent.tf index 3eecd25..4b2339d 100644 --- a/step3/infrastructure/torrent.tf +++ b/step3/infrastructure/torrent.tf @@ -149,7 +149,7 @@ resource "kubernetes_deployment" "flood-torrent" { } container { name = "flood-torrent" - image = "ghcr.io/lukaszraczylo/flood:1.2292.7" + image = var.images.flood_torrent env { name = "FLOOD_DISABLE_AUTH" value = "true" diff --git a/step3/infrastructure/variables.tf b/step3/infrastructure/variables.tf index e47dec5..55b3641 100644 --- a/step3/infrastructure/variables.tf +++ b/step3/infrastructure/variables.tf @@ -1,6 +1,7 @@ variable "network_subnet" {} variable "nfs_storage" {} variable "net_hosts" {} +variable "images" {} 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 32cebba..b25c673 100644 --- a/step3/variables.tfvars +++ b/step3/variables.tfvars @@ -14,5 +14,12 @@ nfs_storage = { adguard = "/mnt/drobo-storage/docker-volumes/adguard" } +# Images definition to make it easier to update +images = { + flood_torrent = "ghcr.io/lukaszraczylo/flood:1.2292.7" + etcd = "gcr.io/etcd-development/etcd:v3.4.15-arm64" + adguard = "adguard/adguardhome:arm64-edge" +} + # 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