Open almereyda opened 2 years ago
Why is this a bug?!
I thought the examples as complete for a specific vendor's environment. It will be useful for other users of the DO cloud to know about this.
This is why I created two issues: One for the documentation, and one here for the technical part.
Since the Digital Ocean provider is an officially supported module, I didn't consider this a Feature Request. Indeed labeling this documentation question as a bug might be irritating, which is due to the nature of KubeOne's code and the examples being unified in the same repository.
/kind feature
This also extends beyond the Terraform example, but also occurs with the MachineController:
A droplet is created in the default project, and the project information in the Terraform JSON state is not respected by KubeOne.
It was possible to delete the MachineDeployment in the cluster, setting the desired project as default project at Digital Ocean, and then recreating it from the KubeOne manifest:
kubeone config machinedeployments -m ... -t ... | k apply -f -
kubeone apply -m ... -t ...
did not not reinstantiate the MachineDeployment.This is consistent with what the KubeOne output says:
WARN[16:47:26 CEST] KubeOne will not manage MachineDeployments objects besides initially creating them and optionally upgrading them...
WARN[16:47:26 CEST] For more info about MachineDeployments see: https://docs.kubermatic.com/kubeone/v1.4/guides/machine_controller/
Simply recreating the cluster worked better:
terraform state rm digitalocean_project.kube_cluster
terraform destroy
terraform import digitalocean_project.kube_cluster b36238c2-f9d0-4971-b2ae-fead4b4af00b
terraform plan
terraform apply
Here we always want to keep the existing project, since it is set as default, and reuse it for the next iteration.
We have to create a Digital Ocean Cloud Project in advance, set it there as default, and then import it to Terraform:
doctl projects list
terraform import digitalocean_project.kube_cluster <UUID>
In case we need to revise something, it is suggested to remove it from the Terraform state, to have it not be deleted, and another project set as default:
terraform state rm digitalocean_project.kube_cluster
What happened?
As outlined in https://github.com/kubermatic/docs/issues/1116, KubeOne's documentation does not yet feature details about Digital Ocean's new Projects, which are also supported by Terraform.
Expected behavior
Digital Ocean Projects are explained in
How to reproduce the issue?
Read the docs.
What KubeOne version are you using?
Additional information
This can be implemented with
main.tf
variables.tf