terraform-provider-huaweicloud icon indicating copy to clipboard operation
terraform-provider-huaweicloud copied to clipboard

autocreate the elb with addon

Open thisurawijesekera opened this issue 5 months ago • 0 comments

When I am trying to autocreate the elb by nginx cce addon I am getting below error.

╷ │ Error: error creating CCE add-on: Bad request with: [POST [https://3d019829-8066-11ef-b874-0255ac10003d.cce.***.myhuaweicloud.com/api/v3/addons],](https://3d019829-8066-11ef-b874-0255ac10003d.cce.%2A%2A%2A.myhuaweicloud.com/api/v3/addons],) request_id: 76c298b1a376a44e95bda0e3f930cee4, error message: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","code":400,"errorCode":"CCE.03400001","errorMessage":"Invalid request.","error":{"message":"kubernetes.io/elb.id and loadBalancerIP cannot both be empty","code":"SVCSTG.CCE-ADDONMGR.4000002"},"message":"kubernetes.io/elb.id and loadBalancerIP cannot both be empty","reason":"BadRequest"}

How can I have the Here is my terraform code.

+ resource "huaweicloud_cce_addon" "nginx_ingress" {
      + cluster_id    = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      + description   = (known after apply)
      + id            = (known after apply)
      + region        = "***"
      + status        = (known after apply)
      + template_name = "nginx-ingress"
      + version       = "2.6.5"

      + values {
          + basic_json  = jsonencode({})
          + custom_json = jsonencode(
                {
                  + config                = {
                      + keep-alive-requests = "100"
                    }
                  + defaultBackend        = {
                      + enabled = true
                    }
                  + defaultBackendService = "backend-service"
                  + headers               = {}
                  + service               = {
                      + annotations = {
                          + "kubernetes.io/elb.autocreate"   = jsonencode(
                                {
                                  + available_zone       = [
                                      + "***a",
                                    ]
                                  + bandwidth_chargemode = "traffic"
                                  + bandwidth_name       = "bandwidth-cce-3d0[198](https://github.com/xxxxx/terraform-hauwei/actions/runs/11141825370/job/30963542038#step:17:199)29-8066-11ef-b874-0255ac10003d"
                                  + bandwidth_sharetype  = "PER"
                                  + bandwidth_size       = 5
                                  + eip_type             = "5_bgp"
                                  + l4_flavor_name       = "L4_flavor.elb.s1.small"
                                  + name                 = "dev01-cluster-nlb-public"
                                  + type                 = "public"
                                }
                            )
                          + "kubernetes.io/elb.pass-through" = "true"
                        }
                    }
                  + tcp                   = {}
                  + udp                   = {}
                }
            )
          + flavor_json = jsonencode(
                {
                  + description = "An nginx Ingress controller that uses ConfigMap to store the nginx configuration."
                  + name        = "nginx-ingress"
                  + replicas    = 1
                  + resources   = [
                      + {
                          + limitsCpu   = "1000m"
                          + limitsMem   = "1000Mi"
                          + name        = "nginx-ingress"
                          + requestsCpu = "[200](https://github.com/xxxx/terraform-hauwei/actions/runs/11141825370/job/30963542038#step:17:201)m"
                          + requestsMem = "200Mi"
                        },
                    ]
                }
            )
        }
    }

thisurawijesekera avatar Oct 02 '24 10:10 thisurawijesekera