Skip to content

Commit ac29b17

Browse files
authored
Merge pull request #19 from InputObject2/feature/allow-disabling-k8s-image-swaper
feat(kubernetes): allow disabling and customizing image swapper
2 parents 58e985e + b0a17bb commit ac29b17

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

variables.tf

+12
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ variable "microk8s_version" {
203203
default = null
204204
}
205205

206+
variable "install_k8s_image_swapper" {
207+
description = "This will add the chart by default to use the k8s-image-swapper and save on imagePulls to Dockerhub, which are rate-limited"
208+
type = bool
209+
default = false
210+
}
211+
212+
variable "k8s_image_swapper_private_registy" {
213+
description = "Point this to the FQDN of a private registry so the k8s-image-swapper can pull from there. Has no effect if `install_k8s_image_swapper` is unused"
214+
type = string
215+
default = ""
216+
}
217+
206218
variable "cloud_network_config_template" {
207219
description = "Template for cloud network config"
208220
type = string

xen_master.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ write_files:
5353
target:
5454
type: generic
5555
generic:
56-
repository: docker-private-registry.${substr(lower(var.dns_zone), 0, length(var.dns_zone) - 1)}
56+
repository: ${var.k8s_image_swapper_private_registy}
5757
5858
image:
5959
repository: inputobject2/k8s-image-swapper
@@ -94,7 +94,7 @@ runcmd:
9494
microk8s kubectl label node ${local.master_prefix}-${random_integer.master[0].result}.${var.dns_sub_zone}.${substr(lower(var.dns_zone), 0, length(var.dns_zone) - 1)} node-role.kubernetes.io/control-plane
9595
microk8s helm repo add estahn https://estahn.github.io/charts/
9696
microk8s helm repo update
97-
microk8s helm install k8s-image-swapper estahn/k8s-image-swapper -n k8s-image-swapper --create-namespace --version 1.8.0 -f /tmp/k8s-image-swapper-values.yaml
97+
${var.install_k8s_image_swapper ? "microk8s helm install k8s-image-swapper estahn/k8s-image-swapper -n k8s-image-swapper --create-namespace --version 1.8.0 -f /tmp/k8s-image-swapper-values.yaml" : ""}
9898
microk8s enable metrics-server
9999
100100
firewall:

0 commit comments

Comments
 (0)