sbercloud-terraform / terraform-provider-sbercloud

Terraform SberCloud Provider
https://registry.terraform.io/providers/sbercloud-terraform/sbercloud/latest/docs
Mozilla Public License 2.0
34 stars 21 forks source link

Ошибка при разворачивании кластера CCE при создании NodePool #326

Closed xT10r closed 10 hours ago

xT10r commented 4 weeks ago

Столкнулся с проблемой, что если сменю тип сети "container_network_type" на "overlay_l2" и закомментирую "container_network_cidr" и "service_network_cidr" получу эту ошибку. Если перейти в интерфейс и создать пул там, то создание пула проходит успешно.

Terraform Version

1.9.3

Terraform Sbercloud Provider Version

1.12.3

Affected Resource(s)

Terraform Configuration Files

resource "sbercloud_cce_cluster" "cce_cluster" {
  name                   = var.cluster_name
  description            = var.cluster_description
  flavor_id              = var.cluster_flavor
  container_network_type = "overlay_l2" #"vpc-router"
  vpc_id                 = data.sbercloud_vpc.cce_vpc.id
  subnet_id              = data.sbercloud_vpc_subnet.cce_vpc_subnet.id
  tags                   = var.default_tags
  labels                 = var.default_labels
  enterprise_project_id  = data.sbercloud_enterprise_project.project.id
  #container_network_cidr = var.container_network_cidr
  #service_network_cidr   = var.service_network_cidr
}

resource "sbercloud_cce_node_pool" "cce_node_pool" {
  cluster_id               = sbercloud_cce_cluster.cce_cluster.id
  name                     = var.node_pool_name
  os                       = data.sbercloud_images_image.node_image.name # "Ubuntu 22.04 server 64bit"
  flavor_id                = var.node_flavor # "c7n.4xlarge.4"
  scall_enable             = true
  initial_node_count       = 2
  min_node_count           = 1
  max_node_count           = 50
  scale_down_cooldown_time = 10
  priority                 = 1
  password                 = random_password.node_pool_password.result

  root_volume {
    size       = var.root_volume_size
    volumetype = var.volume_type
  }

  data_volumes {
    size       = var.data_volume_size
    volumetype = var.volume_type
  }

  labels = var.default_labels
  tags   = var.default_tags

}

Debug Output

╷
│ Error: error creating CCE node pool: Action forbidden: [POST https://cce.ru-moscow-1.hc.sbercloud.ru/api/v3/projects/b775a18c20ff484bbc11ec1c9e1e87b0/clusters/d47c12e6-954e-11ef-a172-0255ac100049/nodepools], request_id: 199b11dda0af854b914d83957cb37162, error message: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","code":403,"errorCode":"CCE.01403001","errorMessage":"Forbidden.","error_code":"CCE_CM.0002","error_msg":"Forbidden","message":"Not 
│ ...
│ 
│   with sbercloud_cce_node_pool.cce_node_pool,
│   on cce_node_pool.tf line 2, in resource "sbercloud_cce_node_pool" "cce_node_pool":
│    2: resource "sbercloud_cce_node_pool" "cce_node_pool" {
│ 
╵

Steps to Reproduce

  1. terraform apply
xT10r commented 10 hours ago

Это проблема облака. Нельзя использовать container_network_type = "overlay_l2" вместе с ОС Ubuntu