diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index b7430a21..45e48ac4 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -134,6 +134,7 @@ func DeleteCluster(cluster *k3d.Cluster, runtime k3drt.Runtime) error { } } + // Delete the cluster network, if it was created for/by this cluster (and if it's not in use anymore) // TODO: does this make sense or should we always try to delete it? (Will fail anyway, if it's still in use) if network, ok := cluster.Nodes[0].Labels["k3d.cluster.network"]; ok { if cluster.Nodes[0].Labels["k3d.cluster.network.external"] == "false" { log.Infof("Deleting cluster network '%s'", network) diff --git a/thoughts.md b/thoughts.md index 6a911542..4249f57d 100644 --- a/thoughts.md +++ b/thoughts.md @@ -58,7 +58,7 @@ Here's how k3d types should translate to a runtime type: - Restart -> - Labels -> container.Labels -## expose ports / volumes +## expose ports / volumes => DONE - `--port [host:]port[:containerPort][/protocol][@group_identifier[[index] | @node_identifier]` - Examples: @@ -70,14 +70,16 @@ Here's how k3d types should translate to a runtime type: - analogous for volumes -## multi master setup +## multi master setup => WIP - if `--masters` > 1 deploy a load-balancer in front of them as an extra container - consider that in the kubeconfig file and `--tls-san` - - make this the default, but provide a `--no-deploy-lb` flag + - make this the default, but provide a `--no-lb` flag -## Store additional created stuff in labels +## Store additional created stuff in labels => DONE - when creating a cluster, usually, you also create a new docker network (and maybe other resources) - store a reference to those in the container labels of cluster nodes - when deleting the cluster, parse the labels, deduplicate the results and delete the additional resources + - DONE for network + - new labels `k3d.cluster.network=` and `k3d.cluster.network.external=` (determine whether to try to delete it when you delete a cluster, since network may have been created manually)