Skip to content

Commit

Permalink
removed legacy cluster lb destroy code that was not used
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticaltech committed Mar 8, 2023
1 parent 82d3dd1 commit b432faf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 40 deletions.
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,26 +218,7 @@ Most cluster components of Kube-Hetzner are deployed with the Rancher [Helm Char

By default, we strive to give you optimal defaults, but if wish, you can customize them.

### Before deploying

In the case of Traefik, Rancher, and Longhorn, we provide you with variables to configure everything you need.

On top of the above, for Nginx, Rancher, Cilium, Traefik, and Longhorn, for maximum flexibility, we give you the ability to configure them even better via helm values variables (e.g. `cilium_values`, see the advanced section in the kube.tf.example for more).

### After deploying

Once the Cluster is up and running, you can easily customize most components like Traefik, Nginx, Rancher, Cilium, Cert-Manager and Longhorn by using HelmChartConfig definitions. See the [examples](https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner#examples) section, for more information.

For other components like Calico and Kured (which uses manifests), we automatically save a `kustomization_backup.yaml` file in the root of your module during the deployment, so you can use that as a starting point. This is also useful when creating the HelmChartConfig definitions, as both HelmChart and HelmChartConfig definitions are very similar.

There is yet another option for power users, to **force the new state of your kube.tf config on the cluster**, which will reconfigure all higher-level components (Traefik, Rancher, etc.) to use the new configuration as updated in your `kube.tf` file. Basically, it will update and re-apply all manifests including the HelmChart definitions. There is no destructive action on the cluster itself, just an alignment of the cluster state with the new configuration.

To do so, you have to run:

```sh
terraform destroy -target 'module.kube-hetzner.null_resource.kustomization'
terraform apply
```
For Traefik, Nginx, Rancher, Cilium, Traefik, and Longhorn, for maximum flexibility, we give you the ability to configure them even better via helm values variables (e.g. `cilium_values`, see the advanced section in the kube.tf.example for more).

## Adding Extras

Expand All @@ -249,6 +230,8 @@ All files in the `extra-manifests` directory including the rendered version of `

_You can use the above to pass all kinds of Kubernetes YAML configs, including HelmChart and/or HelmChartConfig definitions (see the previous section if you do not know what those are in the context of k3s)._

_That said, you can also use pure Terraform and import the kube-hetzner module as part of a larger project, and then use things like the Terraform helm provider to add additional stuff, all up to you!_

## Examples

<details>
Expand Down
20 changes: 0 additions & 20 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,3 @@ resource "hcloud_placement_group" "agent" {
labels = local.labels
type = "spread"
}

resource "null_resource" "destroy_cluster_loadbalancer" {

# this only gets triggered before total destruction of the cluster, but when the necessary elements to run the commands are still available
triggers = {
kustomization_id = null_resource.kustomization.id
cluster_name = var.cluster_name
}

depends_on = [
null_resource.control_planes[0],
hcloud_network_subnet.control_plane,
hcloud_network_subnet.agent,
hcloud_placement_group.control_plane,
hcloud_placement_group.agent,
hcloud_network.k3s,
hcloud_firewall.k3s,
hcloud_ssh_key.k3s
]
}

0 comments on commit b432faf

Please sign in to comment.