added first implementation
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# Gemeinsame Variablen
|
||||
variable "cluster_kubernetes_version" {
|
||||
description = "Kubernetes Version für die Cluster"
|
||||
type = string
|
||||
default = "v1.32.5+rke2r1"
|
||||
}
|
||||
|
||||
variable "harvester_cluster_name" {
|
||||
description = "Name des Harvester Clusters"
|
||||
type = string
|
||||
default = "c-g8zlv"
|
||||
}
|
||||
|
||||
variable "cluster_vm_network" {
|
||||
description = "Netzwerk für die VMs"
|
||||
type = string
|
||||
default = "default/vmnetwork"
|
||||
}
|
||||
|
||||
variable "cluster_vm_image" {
|
||||
description = "Image für die VMs"
|
||||
type = string
|
||||
default = "default/image-62xch"
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
description = "Name des zu erstellenden Clusters"
|
||||
type = string
|
||||
default = "hnrx"
|
||||
}
|
||||
|
||||
variable "cluster_environment" {
|
||||
description = "Umgebung des zu erstellenden Clusters"
|
||||
type = string
|
||||
default = "hnrx"
|
||||
}
|
||||
|
||||
# Rancher Cluster Modul
|
||||
module "rancher_cluster" {
|
||||
source = "git::https://git.hnrx.net/terraform-modules/rancher-cluster.git?ref=main"
|
||||
|
||||
# Cluster Konfiguration aus Workspace
|
||||
cluster_name = var.cluster_name
|
||||
cluster_environment = terraform.workspace
|
||||
cluster_kubernetes_version = var.cluster_kubernetes_version
|
||||
|
||||
# Harvester Konfiguration
|
||||
harvester_cluster_name = var.harvester_cluster_name
|
||||
cluster_vm_namespace = "hnrx-${var.cluster_environment}-cluster"
|
||||
cluster_vm_network = var.cluster_vm_network
|
||||
cluster_vm_image = var.cluster_vm_image
|
||||
}
|
||||
|
||||
# Outputs
|
||||
output "cluster" {
|
||||
description = "Details des Clusters"
|
||||
value = {
|
||||
id = module.rancher_cluster.cluster_id
|
||||
name = module.rancher_cluster.cluster_name
|
||||
kube_config = module.rancher_cluster.kube_config
|
||||
}
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user