72 lines
2.2 KiB
Markdown
72 lines
2.2 KiB
Markdown
# Rancher Kubernetes Cluster Module
|
|
|
|
Dieses Terraform-Modul erstellt einen verwalteten Kubernetes-Cluster in Rancher mit Harvester als Infrastrukturprovider.
|
|
|
|
## Features
|
|
|
|
- Unterstützt drei Umgebungen (dev, test, prod) mit unterschiedlichen Node-Konfigurationen
|
|
- Automatische Konfiguration von Cilium als CNI
|
|
- Gateway API Integration
|
|
- Flexible VM-Größen (large, xlarge, xxlarge)
|
|
|
|
## Verwendung
|
|
|
|
```hcl
|
|
module "rancher_cluster" {
|
|
source = "./modules/rancher-cluster"
|
|
|
|
# Rancher Konfiguration
|
|
rancher2_api_url = "https://rancher.example.com"
|
|
rancher2_access_key = "access-key"
|
|
rancher2_secret_key = "secret-key"
|
|
|
|
# Cluster Konfiguration
|
|
cluster_name = "mein-cluster"
|
|
cluster_environment = "dev" # Mögliche Werte: dev, test, prod
|
|
cluster_kubernetes_version = "v1.32.5+rke2r1"
|
|
|
|
# Harvester Konfiguration
|
|
harvester_cluster_name = "c-xxxxx"
|
|
cluster_vm_namespace = "default"
|
|
cluster_vm_network = "default/vmnetwork"
|
|
cluster_vm_image = "default/image-xxxxx"
|
|
}
|
|
```
|
|
|
|
## Inputs
|
|
|
|
| Name | Beschreibung | Typ | Erforderlich |
|
|
|------|-------------|-----|-------------|
|
|
| rancher2_api_url | Rancher API URL | string | ja |
|
|
| rancher2_access_key | Rancher Access Key | string | ja |
|
|
| rancher2_secret_key | Rancher Secret Key | string | ja |
|
|
| rancher2_insecure | TLS-Verifizierung überspringen | bool | nein (default: false) |
|
|
| cluster_name | Name des zu erstellenden Clusters | string | ja |
|
|
| cluster_environment | Umgebung (dev/test/prod) | string | ja |
|
|
| cluster_kubernetes_version | Kubernetes Version | string | ja |
|
|
| harvester_cluster_name | Name des Harvester Clusters | string | ja |
|
|
| cluster_vm_namespace | Namespace für VMs | string | ja |
|
|
| cluster_vm_network | Netzwerk für VMs | string | ja |
|
|
| cluster_vm_image | VM Image | string | ja |
|
|
|
|
## Outputs
|
|
|
|
| Name | Beschreibung |
|
|
|------|-------------|
|
|
| cluster_id | ID des erstellten Clusters |
|
|
| cluster_name | Name des erstellten Clusters |
|
|
| kube_config | Kubeconfig für den Cluster (sensitiv) |
|
|
|
|
## Node-Konfigurationen nach Umgebung
|
|
|
|
### Dev
|
|
- 1 All-in-One Node (xxlarge)
|
|
|
|
### Test
|
|
- 1 Control-Plane Node (large)
|
|
- 1 Worker Node (xlarge)
|
|
|
|
### Prod
|
|
- 3 Control-Plane Nodes (large)
|
|
- 2 Worker Nodes (xlarge)
|