Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionoscloud_dataplatform_cluster does not create the cluster with the correct name #484

Open
FLST-btelligent opened this issue Nov 6, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@FLST-btelligent
Copy link

FLST-btelligent commented Nov 6, 2023

Description

I create the IONOS Cloud Dataplatform Cluster with the resource "ionoscloud_dataplatform_cluster" but it does not create the cluster with the correct name within the IONOS Cloud. The Cluster has the ID as name and not the one I configured within the resource.

When I create a managed k8s cluster with the resource "ionoscloud_k8s_cluster" it works as expected and the cluster gets created with the correct name.

Screenshot 2023-11-06 at 09 11 16

This issue does lead to other issues why working with the "ionoscloud_dataplatform_cluster" datasource. Where we have the issue, that we cannot find the data platform cluster by name and neither by ID:

Screenshot_2023-10-18_113228

Expected behavior

I expect that the cluster gets created with the name configured within the Terraform resource and that I also can get the cluster via the datasource by the name of the cluster.

Environment

Terraform version:

1.6.3

Provider version:

6.4.9

OS:

linux

How to Reproduce

Steps to reproduce the behavior:

  1. create the Terraform resource "ionoscloud_dataplatform_cluster" and configure a name
  2. Do a Terraform apply and deploy the cluster to the IONOS Cloud
  3. Review the Cluster Name within the Cloud, or use the Data source and try to get the cluster by name.
@FLST-btelligent FLST-btelligent added the bug Something isn't working label Nov 6, 2023
@cristiGuranIonos
Copy link
Collaborator

Hi, the DCD output is confusing and seems to have a bug.

What happens if you use this for data source?

terraform {
required_providers {
ionoscloud = {
source = "ionos-cloud/ionoscloud"
version = ">= 6.4.10"
}
}
}
resource "ionoscloud_datacenter" "example" {
name = "Datacenter_Example"
location = "de/txl"
description = "Datacenter for testing Dataplatform Cluster"
}

resource "ionoscloud_dataplatform_cluster" "example" {
datacenter_id = ionoscloud_datacenter.example.id
name = "Dataplatform_Cluster_Example"
maintenance_window {
day_of_the_week = "Sunday"
time = "09:00:00"
}
version = "23.7"
}

data "ionoscloud_dataplatform_cluster" "example" {
name = resource.ionoscloud_dataplatform_cluster.example.name
}

I've provided the entire plan, but please adjust according to your plan/names

@FLST-btelligent
Copy link
Author

Thanks for your quick answer!

The Plan gives me then the ID as return value, what is within the IONOS Portal my cluster name.

What I actually would like to get in the end, was the UUID from the Cluster, to use this with the datasource "ionoscloud_k8s_node_pool_nodes" but that is actually not possible because there I get the error that it can not find a cluster with the provided UUID - What makes totally sense, because the returned value is not an UUID.

But then the question, how can I get the nodes from the dataplatform Cluster, to then taint them for example?

@cristiGuranIonos
Copy link
Collaborator

Ah, I see. Manually, you can go to DCD and then go to the Kubernetes Manager and there you can see the API in blue next to your cluster. Click there and you will get a href where you can see the k8s details. To see nodepools, add depth=3 at the end of the url : https://api.ionos.com/cloudapi/v6/k8s/cluster_id_here?depth=3
Will investigate on how to get it from terraform.

You can use this datasource and see the dataplatform k8s cluster as a server, but not sure if this is useful:
data ionoscloud_servers example {
datacenter_id = ionoscloud_datacenter.example.id
filter {
name = "name"
value = "name_from_dcd_here"
}
}

@FLST-btelligent
Copy link
Author

Thank you! I am looking forward to your answer on how to get it from terraform :)

@cristiGuranIonos
Copy link
Collaborator

cristiGuranIonos commented Nov 9, 2023

Currently no way from terraform, but I think you can use ionoctl and then set the ids in variables that can used in terraform?
ionosctl k8s cluster list --filters name=<generated_dataplatform_name_here>
ionosctl k8s nodepool list --cluster-id=<cluster_id_from_previous_command_output>

We will try to add a way to see this from terraform data source directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants