kubermatic / docs

Documentation for Kubermatic projects
https://docs.kubermatic.com/
Other
15 stars 105 forks source link

KubeOne: Digital Ocean Projects not documented #1116

Open almereyda opened 2 years ago

almereyda commented 2 years ago

Digital Ocean now have so-called projects which resources can be assigned to.

This allows creation of resources under different name spaces.

Its usage is currently not documented for KubeOne.

almereyda commented 2 years ago

This is how this looks in main.tf:

resource "digitalocean_project" "kube_cluster" {
  name        = "${var.project_name}"
  description = "${var.project_description}"
  purpose     = "${var.project_purpose}"
  environment = "${var.project_environment}"
  resources   = concat(
    flatten(
      digitalocean_droplet.control_plane.*.urn
    ),
    [
      digitalocean_loadbalancer.control_plane.urn,
      digitalocean_tag.kube_cluster_tag.id,
      digitalocean_ssh_key.deployer.id
    ]
  )
}

and in variables.tf:

variable "project_name" {
  description = "Name of the project"
  type        = string
}

variable "project_description" {
  description = "Description of the project"
  type        = string
}

variable "project_purpose" {
  description = "Purpose of the project"
  type        = string
}

variable "project_environment" {
  description = "Environment of the project"
  type        = string
}

Updates need to be applied to

as well.

ahmedwaleedmalik commented 2 years ago

@almereyda it's not documented because we don't support it?! :D

almereyda commented 2 years ago

Yes (:

I was just leaving a note here for documenting my own attempts at using them, in case someone would want to do something similar.

That is, sometimes it had become useful to remove and import the Terraform state of the project, in order for it not being removed during multiple cycles of setting up the KubeOne cluster.

terraform state rm digitalocean_project.kube_cluster
terraform destroy
terraform import digitalocean_project.kube_cluster b36238c2-f9d0-4971-b2ae-fead4b4af00b
terraform plan
terraform apply

The only true workaround for this, from the perspective of a DO Cloud user, is to set the desired project as default project in your account.

madalinignisca commented 2 years ago

Digital Ocean's Projects are just a label. It's not like Hetzner's projects, which is true isolation between projects.