kubermatic / kubeone

Kubermatic KubeOne automate cluster operations on all your cloud, on-prem, edge, and IoT environments.
https://kubeone.io
Apache License 2.0
1.31k stars 231 forks source link

Allow merging config and terraform integration #1819

Open kron4eg opened 2 years ago

kron4eg commented 2 years ago

Currently we don't support having both, terraform integration sourcing information from terraform output and and having controlPlane.hosts configured, because terraform overwrites controlPlane.hosts completely, because we don't support merging sourced info from the terraform.

What feature would you like to be added? Merge info from terraform with already existing config (if any), merge key should be privateIP.

What are use cases of the feature? Sometimes additional config options could be configured on hosts (e.g. taints), but it's excessive to integrate everything as terraform.

xmudrii commented 2 years ago

I agree that we should merge structs, but I'm worried about merging the same keys. For example, if you have the same machine defined both in the KubeOneCluster manifest and the Terraform config, which definition will be authoritative?

Users might have different expectations, which might lead to tricky to debug issues. I'm wondering should we fail in such cases and instruct users to use only one definition/source. However, we lose the main use case of that feature, so I'm not sure what's the best way to proceed.

kron4eg commented 2 years ago

Indeed, it could be confusing, but what's the way out?

xmudrii commented 2 years ago

I think we can keep this, but I would add a warning that the same machine is defined both in the config file and the Terraform state.