diff --git a/health.tf b/health.tf new file mode 100644 index 0000000..6c5cb96 --- /dev/null +++ b/health.tf @@ -0,0 +1,8 @@ +# The cluster should be healthy after cilium is installed +data "talos_cluster_health" "this" { + depends_on = [data.helm_template.cilium] + client_configuration = data.talos_client_configuration.this.client_configuration + endpoints = local.control_plane_public_ipv4_list + control_plane_nodes = local.control_plane_private_ipv4_list + worker_nodes = local.worker_private_ipv4_list +} diff --git a/manifest_hcloud_ccm.tf b/manifest_hcloud_ccm.tf new file mode 100644 index 0000000..11ca8d6 --- /dev/null +++ b/manifest_hcloud_ccm.tf @@ -0,0 +1,28 @@ +data "helm_template" "hcloud_ccm" { + name = "hcloud-cloud-controller-manager" + namespace = "kube-system" + + repository = "https://charts.hetzner.cloud" + chart = "hcloud-cloud-controller-manager" + version = "1.19.0" + + set { + name = "networking.enabled" + value = "true" + } + + set { + name = "networking.clusterCIDR" + value = local.pod_ipv4_cidr + } +} + +data "kubectl_file_documents" "hcloud_ccm" { + content = data.helm_template.hcloud_ccm.manifest +} + +resource "kubectl_manifest" "apply_hcloud_ccm" { + for_each = data.kubectl_file_documents.hcloud_ccm.manifests + yaml_body = each.value + depends_on = [data.talos_cluster_health.this] +}