From 632c854ebd8efe7eedf9377cc4122d2d9c70bc8c Mon Sep 17 00:00:00 2001 From: Adeniyi Stephen Oluwatola <41240528+adeniyistephen@users.noreply.github.com> Date: Fri, 24 Jun 2022 12:18:06 +0100 Subject: [PATCH] Fix terraform consistent variables for machine deployment replicas (#2115) --- examples/terraform/digitalocean/output.tf | 2 +- examples/terraform/digitalocean/variables.tf | 6 ++++++ examples/terraform/equinixmetal/output.tf | 2 +- examples/terraform/equinixmetal/variables.tf | 6 ++++++ examples/terraform/gce/output.tf | 2 +- examples/terraform/gce/variables.tf | 6 ++++++ examples/terraform/hetzner/output.tf | 2 +- examples/terraform/hetzner/variables.tf | 7 ++++--- examples/terraform/openstack/output.tf | 2 +- examples/terraform/openstack/variables.tf | 6 ++++++ examples/terraform/vsphere/outputs.tf | 2 +- examples/terraform/vsphere/variables.tf | 6 ++++++ examples/terraform/vsphere_flatcar/outputs.tf | 2 +- examples/terraform/vsphere_flatcar/variables.tf | 6 ++++++ 14 files changed, 47 insertions(+), 10 deletions(-) diff --git a/examples/terraform/digitalocean/output.tf b/examples/terraform/digitalocean/output.tf index eabf7ccba..4b8941214 100644 --- a/examples/terraform/digitalocean/output.tf +++ b/examples/terraform/digitalocean/output.tf @@ -47,7 +47,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = 1 + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/digitalocean/variables.tf b/examples/terraform/digitalocean/variables.tf index 711e212df..487400016 100644 --- a/examples/terraform/digitalocean/variables.tf +++ b/examples/terraform/digitalocean/variables.tf @@ -96,6 +96,12 @@ variable "worker_size" { type = string } +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number +} + variable "initial_machinedeployment_operating_system_profile" { default = "" type = string diff --git a/examples/terraform/equinixmetal/output.tf b/examples/terraform/equinixmetal/output.tf index ac9f9353b..730d40756 100644 --- a/examples/terraform/equinixmetal/output.tf +++ b/examples/terraform/equinixmetal/output.tf @@ -47,7 +47,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = 1 + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/equinixmetal/variables.tf b/examples/terraform/equinixmetal/variables.tf index af94ccee4..e72ff223c 100644 --- a/examples/terraform/equinixmetal/variables.tf +++ b/examples/terraform/equinixmetal/variables.tf @@ -108,6 +108,12 @@ variable "project_id" { type = string } +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number +} + variable "initial_machinedeployment_operating_system_profile" { default = "" type = string diff --git a/examples/terraform/gce/output.tf b/examples/terraform/gce/output.tf index b4ff29fbb..e11ca5b14 100644 --- a/examples/terraform/gce/output.tf +++ b/examples/terraform/gce/output.tf @@ -48,7 +48,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = 1 + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/gce/variables.tf b/examples/terraform/gce/variables.tf index 50211c0cb..d9cc1d921 100644 --- a/examples/terraform/gce/variables.tf +++ b/examples/terraform/gce/variables.tf @@ -123,6 +123,12 @@ variable "cluster_network_cidr" { type = string } +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number +} + variable "initial_machinedeployment_operating_system_profile" { default = "" type = string diff --git a/examples/terraform/hetzner/output.tf b/examples/terraform/hetzner/output.tf index a3edcdbe1..d87b25bea 100644 --- a/examples/terraform/hetzner/output.tf +++ b/examples/terraform/hetzner/output.tf @@ -53,7 +53,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = var.workers_replicas + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/hetzner/variables.tf b/examples/terraform/hetzner/variables.tf index c8b48bbc8..63b3583c5 100644 --- a/examples/terraform/hetzner/variables.tf +++ b/examples/terraform/hetzner/variables.tf @@ -87,9 +87,10 @@ variable "worker_type" { type = string } -variable "workers_replicas" { - default = 1 - type = number +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number } variable "lb_type" { diff --git a/examples/terraform/openstack/output.tf b/examples/terraform/openstack/output.tf index 85b7a7da3..5d8a3a4e5 100644 --- a/examples/terraform/openstack/output.tf +++ b/examples/terraform/openstack/output.tf @@ -54,7 +54,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = 1 + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/openstack/variables.tf b/examples/terraform/openstack/variables.tf index a93c8c533..416023984 100644 --- a/examples/terraform/openstack/variables.tf +++ b/examples/terraform/openstack/variables.tf @@ -133,6 +133,12 @@ variable "subnet_dns_servers" { default = ["8.8.8.8", "8.8.4.4"] } +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number +} + variable "initial_machinedeployment_operating_system_profile" { default = "" type = string diff --git a/examples/terraform/vsphere/outputs.tf b/examples/terraform/vsphere/outputs.tf index 3580222ea..01ea0e71d 100644 --- a/examples/terraform/vsphere/outputs.tf +++ b/examples/terraform/vsphere/outputs.tf @@ -48,7 +48,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = 1 + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/vsphere/variables.tf b/examples/terraform/vsphere/variables.tf index da01be341..8a783e459 100644 --- a/examples/terraform/vsphere/variables.tf +++ b/examples/terraform/vsphere/variables.tf @@ -163,6 +163,12 @@ variable "vrrp_router_id" { type = number } +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number +} + variable "initial_machinedeployment_operating_system_profile" { default = "" type = string diff --git a/examples/terraform/vsphere_flatcar/outputs.tf b/examples/terraform/vsphere_flatcar/outputs.tf index 3580222ea..01ea0e71d 100644 --- a/examples/terraform/vsphere_flatcar/outputs.tf +++ b/examples/terraform/vsphere_flatcar/outputs.tf @@ -48,7 +48,7 @@ output "kubeone_workers" { # following outputs will be parsed by kubeone and automatically merged into # corresponding (by name) worker definition "${var.cluster_name}-pool1" = { - replicas = 1 + replicas = var.initial_machinedeployment_replicas providerSpec = { annotations = { "k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile diff --git a/examples/terraform/vsphere_flatcar/variables.tf b/examples/terraform/vsphere_flatcar/variables.tf index e480c150e..1fb1f7629 100644 --- a/examples/terraform/vsphere_flatcar/variables.tf +++ b/examples/terraform/vsphere_flatcar/variables.tf @@ -148,6 +148,12 @@ variable "api_vip" { type = string } +variable "initial_machinedeployment_replicas" { + description = "Number of replicas per MachineDeployment" + default = 1 + type = number +} + variable "initial_machinedeployment_operating_system_profile" { default = "" type = string