Skip to content

Commit

Permalink
Replaced Bird by native MetalLB
Browse files Browse the repository at this point in the history
Setup Ingress IP properly
Added Rancher deployment
K3s or RKE2 available
  • Loading branch information
e-minguez committed Sep 30, 2024
1 parent 0be4cdf commit 5048824
Show file tree
Hide file tree
Showing 11 changed files with 755 additions and 443 deletions.
16 changes: 9 additions & 7 deletions examples/demo_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,23 @@ variable "deploy_demo" {
}

variable "clusters" {
description = "K3s cluster definition"
description = "Cluster definition"
type = list(object({
name = optional(string, "K3s demo cluster")
name = optional(string, "Demo cluster")
metro = optional(string, "FR")
plan_control_plane = optional(string, "c3.small.x86")
plan_node = optional(string, "c3.small.x86")
node_count = optional(number, 0)
k3s_ha = optional(bool, false)
ha = optional(bool, false)
os = optional(string, "debian_11")
control_plane_hostnames = optional(string, "k3s-cp")
node_hostnames = optional(string, "k3s-node")
custom_k3s_token = optional(string, "")
control_plane_hostnames = optional(string, "cp")
node_hostnames = optional(string, "node")
custom_token = optional(string, "")
ip_pool_count = optional(number, 0)
k3s_version = optional(string, "")
kube_version = optional(string, "")
metallb_version = optional(string, "")
rancher_version = optional(string, "")
rancher_flavor = optional(string, "")
}))
default = [{}]
}
14 changes: 8 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ locals {
}

################################################################################
# K3S Cluster In-line Module
# K8s Cluster In-line Module
################################################################################

module "k3s_cluster" {
source = "./modules/k3s_cluster"
module "kube_cluster" {
source = "./modules/kube_cluster"

for_each = { for cluster in var.clusters : cluster.name => cluster }

Expand All @@ -18,14 +18,16 @@ module "k3s_cluster" {
plan_control_plane = each.value.plan_control_plane
plan_node = each.value.plan_node
node_count = each.value.node_count
k3s_ha = each.value.k3s_ha
ha = each.value.ha
os = each.value.os
control_plane_hostnames = each.value.control_plane_hostnames
node_hostnames = each.value.node_hostnames
custom_k3s_token = each.value.custom_k3s_token
k3s_version = each.value.k3s_version
custom_token = each.value.custom_token
kube_version = each.value.kube_version
metallb_version = each.value.metallb_version
ip_pool_count = each.value.ip_pool_count
rancher_flavor = each.value.rancher_flavor
rancher_version = each.value.rancher_version
metal_project_id = var.metal_project_id
deploy_demo = var.deploy_demo
global_ip_cidr = local.global_ip_cidr
Expand Down
Loading

0 comments on commit 5048824

Please sign in to comment.