diff --git a/proxmox/terraform/staging/cluster-graphql.tf b/proxmox/terraform/staging/cluster-graphql.tf index e91c327..f506d8c 100644 --- a/proxmox/terraform/staging/cluster-graphql.tf +++ b/proxmox/terraform/staging/cluster-graphql.tf @@ -1,159 +1,119 @@ # This declares terraform manifests to provision vms and register containers within # those to a rancher (clusters management service) instance. # Each software has the following responsibilities: # - proxmox: provision vms (with docker dependency) # - rancher: installs kube cluster within containers (running on vms) # Requires (RANCHER_ACCESS_KEY and RANCHER_SECRET_KEY) in your shell environment # $ cat ~/.config/terraform/swh/setup.sh # ... # key_entry=operations/rancher/azure/elastic-loader-lister-keys # export RANCHER_ACCESS_KEY=$(swhpass ls $key_entry | head -1 | cut -d: -f1) # export RANCHER_SECRET_KEY=$(swhpass ls $key_entry | head -1 | cut -d: -f2) # Plan: # - create cluster with terraform # - Create nodes as usual through terraform # - Retrieve the registration command (out of the cluster creation step) to provide new # node resource "rancher2_cluster" "cluster-graphql" { name = "cluster-graphql" description = "graphql staging cluster" rke_config { network { plugin = "canal" } } } output "rancher2_cluster_graphql_summary" { sensitive = true value = rancher2_cluster.cluster-graphql.kube_config } output "rancher2_cluster_graphql_command" { sensitive = true value = rancher2_cluster.cluster-graphql.cluster_registration_token[0].node_command } module "graphql-worker0" { source = "../modules/node" vmid = 162 template = var.templates["stable-zfs"] config = local.config hostname = "graphql-worker0" description = "elastic worker running in rancher cluster" hypervisor = "uffizi" sockets = "1" cores = "4" onboot = true memory = "8192" balloon = "4096" networks = [{ id = 0 ip = "192.168.130.150" gateway = local.config["gateway_ip"] bridge = "vmbr443" }] storages = [{ storage = "proxmox" size = "20G" }, { storage = "proxmox" size = "50G" } ] post_provision_steps = [ "systemctl restart docker", # workaround "${rancher2_cluster.cluster-graphql.cluster_registration_token[0].node_command} --etcd --controlplane --worker" ] } output "graphql-worker0_summary" { value = module.graphql-worker0.summary } module "graphql-worker1" { source = "../modules/node" vmid = 163 template = var.templates["stable-zfs"] config = local.config hostname = "graphql-worker1" description = "graphql worker running in rancher cluster" hypervisor = "uffizi" sockets = "1" cores = "4" onboot = true memory = "8192" balloon = "4096" networks = [{ id = 0 ip = "192.168.130.151" gateway = local.config["gateway_ip"] bridge = "vmbr443" }] storages = [{ storage = "proxmox" size = "20G" }, { storage = "proxmox" size = "50G" } ] post_provision_steps = [ "systemctl restart docker", # workaround "${rancher2_cluster.cluster-graphql.cluster_registration_token[0].node_command} --etcd --controlplane --worker" ] } output "graphql-worker1_summary" { value = module.graphql-worker1.summary } - -module "graphql-worker2" { - source = "../modules/node" - vmid = 164 - template = var.templates["stable-zfs"] - config = local.config - hostname = "graphql-worker2" - description = "graphql worker running in rancher cluster" - hypervisor = "uffizi" - sockets = "1" - cores = "4" - onboot = true - memory = "8192" - balloon = "4096" - - networks = [{ - id = 0 - ip = "192.168.130.152" - gateway = local.config["gateway_ip"] - bridge = "vmbr443" - }] - - storages = [{ - storage = "proxmox" - size = "20G" - }, { - storage = "proxmox" - size = "50G" - } - ] - - post_provision_steps = [ - "systemctl restart docker", # workaround - "${rancher2_cluster.cluster-graphql.cluster_registration_token[0].node_command} --etcd --controlplane --worker" - ] -} - -output "graphql-worker2_summary" { - value = module.graphql-worker2.summary -} diff --git a/proxmox/terraform/staging/cluster-graphql2.tf b/proxmox/terraform/staging/cluster-graphql3.tf similarity index 56% rename from proxmox/terraform/staging/cluster-graphql2.tf rename to proxmox/terraform/staging/cluster-graphql3.tf index 9004c4b..f571ccb 100644 --- a/proxmox/terraform/staging/cluster-graphql2.tf +++ b/proxmox/terraform/staging/cluster-graphql3.tf @@ -1,80 +1,120 @@ # This declares terraform manifests to provision vms and register containers within # those to a rancher (clusters management service) instance. # Each software has the following responsibilities: # - proxmox: provision vms (with docker dependency) # - rancher: installs kube cluster within containers (running on vms) # Requires (RANCHER_ACCESS_KEY and RANCHER_SECRET_KEY) in your shell environment # $ cat ~/.config/terraform/swh/setup.sh # ... # key_entry=operations/rancher/azure/elastic-loader-lister-keys # export RANCHER_ACCESS_KEY=$(swhpass ls $key_entry | head -1 | cut -d: -f1) # export RANCHER_SECRET_KEY=$(swhpass ls $key_entry | head -1 | cut -d: -f2) # Plan: # - create cluster with terraform # - Create nodes as usual through terraform # - Retrieve the registration command (out of the cluster creation step) to provide new # node -resource "rancher2_cluster" "cluster-graphql2" { - name = "cluster-graphql2" - description = "2nd graphql staging cluster" +resource "rancher2_cluster" "cluster-graphql3" { + name = "cluster-graphql3" + description = "3rd (tryout) graphql staging cluster" rke_config { - kubernetes_version = "v1.22.10-rancher1-1" + kubernetes_version = "v1.21.12-rancher1-1" network { plugin = "canal" } } } -output "rancher2_cluster_graphql2_summary" { +output "rancher2_cluster_graphql3_summary" { sensitive = true - value = rancher2_cluster.cluster-graphql2.kube_config + value = rancher2_cluster.cluster-graphql3.kube_config } -output "rancher2_cluster_graphql2_command" { +output "rancher2_cluster_graphql3_command" { sensitive = true - value = rancher2_cluster.cluster-graphql2.cluster_registration_token[0].node_command + value = rancher2_cluster.cluster-graphql3.cluster_registration_token[0].node_command } module "graphql-worker3" { source = "../modules/node" vmid = 165 template = var.templates["stable-zfs"] config = local.config hostname = "graphql-worker3" description = "graphql worker running in rancher cluster" hypervisor = "uffizi" sockets = "1" cores = "4" onboot = true memory = "16384" balloon = "8192" networks = [{ id = 0 ip = "192.168.130.153" gateway = local.config["gateway_ip"] bridge = "vmbr443" }] storages = [{ storage = "proxmox" size = "20G" }, { storage = "proxmox" size = "50G" } ] post_provision_steps = [ "systemctl restart docker", # workaround - "${rancher2_cluster.cluster-graphql2.cluster_registration_token[0].node_command} --etcd --controlplane --worker" + "${rancher2_cluster.cluster-graphql3.cluster_registration_token[0].node_command} --etcd --controlplane --worker" ] } output "graphql-worker3_summary" { value = module.graphql-worker3.summary } + +# module "graphql-worker2" { +# source = "../modules/node" +# vmid = 164 +# template = var.templates["stable-zfs"] +# config = local.config +# hostname = "graphql-worker2" +# description = "graphql worker running in rancher cluster" +# hypervisor = "uffizi" +# sockets = "1" +# cores = "4" +# onboot = true +# memory = "8192" +# balloon = "4096" + +# networks = [{ +# id = 0 +# ip = "192.168.130.152" +# gateway = local.config["gateway_ip"] +# bridge = "vmbr443" +# }] + +# storages = [{ +# storage = "proxmox" +# size = "20G" +# }, { +# storage = "proxmox" +# size = "50G" +# } +# ] + +# post_provision_steps = [ +# "systemctl restart docker", # workaround +# "${rancher2_cluster.cluster-graphql3.cluster_registration_token[0].node_command} --controlplane" +# ] +# } + +# output "graphql-worker2_summary" { +# value = module.graphql-worker2.summary +# }