Open rvangsgaard opened 4 months ago
Hmm, really good idea! I thought about this once but I was not able to come up with a good solution, as one could potentially want to initialize multiple clusters in the same folder.
I do not want to enforce ways of working, so do you have a suggestion of how I could handle if there are multiple KSail clusters initialized in the same folder?
I do not want to enforce ways of working, so do you have a suggestion of how I could handle if there are multiple KSail clusters initialized in the same folder?
I think a good default behavior is a good thing, and allow the user to override it. In this case:
If not, look for a config file (cluster) with the same name as the folder.
The problem with this is that there could be:
cluster1-ksail-k3d-config.yaml
cluster2-ksail-k3d-config.yaml
k8s/clusters/cluster1/**
k8s/clusters/cluster2/**
In the same folder, thus I would not know which cluster the user wants to use by default.
My current solution proposal is to await having implemented a ksail native config file with something like this:
ksail-config.yaml
---
clusterName: cluster1
otherOption: dsadsad
anotherOption: dsdsad
There would only be one of these in your current folder, and that file can then be used to control the behavior of the CLI. Flags and arguments would overwrite the config values, and thus it would still be possible to run ksail up cluster2
to setup the other cluster using the default values from the config file.
Would this solve it for you? :-)
I do not understand the proposed solution - will the ksail native config file only contain exactly one clusterName or multiple. If you can, please elaborate on the ksail native config file, especially the example.
It will contain one cluster name.
See it as a per-project configuration. One folder should not contain more than one ksail cluster. In rare cases where there could be more than one ksail cluster in a folder, the configuration will use the cluster name to infer which one to provision when running:
ksail up
Description
Try to discover clusterName based on current folder name. Consider validating the discovered name by looking for a corresponding YAML-file.
Example: