Closed Programie closed 9 months ago
Firstly, thank you for your detailed issue. I have also thought of this config/options json file approach. In my opinion it's a very streamlined approach and it's a pretty clear/structured way to define resources.
However, have you considered IaC tools such as https://github.com/ionos-cloud/terraform-provider-ionoscloud/ or https://github.com/ionos-cloud/module-ansible ? They are designed for use cases such as the one you describe
Regarding the --lan-id
approach, even though it is not the most user-friendly and I'm not a big fan of it, it could be a feasible workaround.
Thanks for opening the issue, I'll update this thread as soon we've made a decision regarding this proposal, have a nice day!
Yes, we've already evaluated Terraform. Unfortunately, it doesn't exactly fit our use-case as we just want to create Kubernetes clusters and nodepools without actually keeping the state somewhere. Therefore we want to use ionosctl for that.
Hi! Since #391 you can now use --json-properties-example
and --json-properties <JSON-FILE-PATH>
to create k8s nodepools. Set the properties.lans
array to pass networks to the command.
This functionality will be available since v6.7.2. If you encounter any problems, please open a new issue or we can re-open this one.
I just tested the new functionality but for me it is not working.
I used the JSON returned by ionosctl k8s nodepool create --json-properties-example
, dumped it to a file and modified some values to match our setup. But it seems like the file is not used at all as ionosctl complains about an unsupported CPU family "AMD_OPTERON" even if I specified "INTEL_SKYLAKE" in the file.
Removing the cpuFamily
property from the file and manually specifying it as --cpu-family INTEL_SKYLAKE
works and then confirmed my guess about the file not being used at all as everything in the file is just ignored. For example, the nodepool does not contain the amount of nodes, the configured CPU cores, RAM, HDD size, etc.
Use-cases
When creating a new nodepool, it is possible to define the LAN IDs which should be attached to the worker nodes. Unfortunately, it is not possible to also define the networks and gateways for them.
Therefore, when creating a new nodepool, we have to first create the nodepool without the attached private LAN, wait for it to become ready and after that attach the private LAN which results in recreating the nodepool (which takes some time depending on the size of the nodepool).
Attempted Solutions
Nothing so far.
Proposal
Allow to also define the networks to be routed to the LAN while creating the nodepool.
I know, the command line might be really cluttered doing it that way. And you might also have to think about a way how to define the networks for each LAN to be attached.
One quite ugly option to define it would be to allow giving
--lan-ids
multiple times (maybe then renamed to--lan-id
as it is only a single LAN) listing the LAN ID followed by the networks and gateways. Something like the following:Another approach might be to define the properties in a config file which also supports nesting (i.e. JSON or YAML) and then simply provide the config file on the command line.
Example:
options.json:
The config variant might be also useful for the other create commands.