add some comments

This commit is contained in:
iwilltry42 2019-11-11 11:39:36 +01:00
parent b596eeb70b
commit 31270fe08c
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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=<ID>` and `k3d.cluster.network.external=<true|false>` (determine whether to try to delete it when you delete a cluster, since network may have been created manually)