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

CCE Update Addon listener #2389

Open
Maeschlii opened this issue Dec 4, 2023 · 5 comments
Open

CCE Update Addon listener #2389

Maeschlii opened this issue Dec 4, 2023 · 5 comments
Assignees
Labels
otc-issue Blocked by OTC issues

Comments

@Maeschlii
Copy link

Terraform provider version

  • Installing opentelekomcloud/opentelekomcloud v1.35.13
  • Installed opentelekomcloud/opentelekomcloud v1.35.13

Affected Resource(s)

example

  • opentelekomcloud_cce_addon_v3
  • opentelekomcloud_cce_addon_template_v3

Terraform Configuration Files

data "opentelekomcloud_cce_addon_template_v3" "autoscaler" {
  count         = var.cluster_enable_scaling ? 1 : 0
  addon_version = var.autoscaler_version
  addon_name    = "autoscaler"
}

locals {
  region_endpoint = replace(local.region, "eu-ch2", "eu-ch2.sc")
}

resource "opentelekomcloud_cce_addon_v3" "autoscaler" {
  count            = var.cluster_enable_scaling ? 1 : 0
  template_name    = data.opentelekomcloud_cce_addon_template_v3.autoscaler[0].addon_name
  template_version = data.opentelekomcloud_cce_addon_template_v3.autoscaler[0].addon_version
  cluster_id       = opentelekomcloud_cce_cluster_v3.cluster.id

  values {
    basic = {
      "cceEndpoint" = "https://cce.${local.region_endpoint}.otc.t-systems.com"
      "ecsEndpoint" = "https://ecs.${local.region_endpoint}.otc.t-systems.com"
      "region"      = opentelekomcloud_cce_cluster_v3.cluster.region
      "swr_addr"    = data.opentelekomcloud_cce_addon_template_v3.autoscaler[0].swr_addr
      "swr_user"    = data.opentelekomcloud_cce_addon_template_v3.autoscaler[0].swr_user
    }
    custom = {
      "cluster_id"                    = opentelekomcloud_cce_cluster_v3.cluster.id
      "tenant_id"                     = data.opentelekomcloud_identity_project_v3.current.id
      "coresTotal"                    = 16000
      "expander"                      = "priority"
      "logLevel"                      = 4
      "maxEmptyBulkDeleteFlag"        = 11
      "maxNodesTotal"                 = 100
      "memoryTotal"                   = 64000
      "scaleDownDelayAfterAdd"        = 15
      "scaleDownDelayAfterDelete"     = 15
      "scaleDownDelayAfterFailure"    = 3
      "scaleDownEnabled"              = true
      "scaleDownUnneededTime"         = 7
      "scaleUpUnscheduledPodEnabled"  = true
      "scaleUpUtilizationEnabled"     = true
      "unremovableNodeRecheckTimeout" = 7
    }
  }
}

data "opentelekomcloud_cce_addon_template_v3" "metrics" {
  addon_version = var.metrics_server_version
  addon_name    = "metrics-server"
}

resource "opentelekomcloud_cce_addon_v3" "metrics" {
  template_name    = data.opentelekomcloud_cce_addon_template_v3.metrics.addon_name
  template_version = data.opentelekomcloud_cce_addon_template_v3.metrics.addon_version
  cluster_id       = opentelekomcloud_cce_cluster_v3.cluster.id

  values {
    basic = {
      # "image_version" = "v0.6.2",
      "swr_addr" = data.opentelekomcloud_cce_addon_template_v3.metrics.swr_addr
      "swr_user" = data.opentelekomcloud_cce_addon_template_v3.metrics.swr_user
    }
    custom = {}
    # flavor = <<EOF
    #   {
    #     "category": [
    #       "Autopilot"
    #     ],
    #     "description": "Has only one instance",
    #     "name": "Single",
    #     "replicas": 1,
    #     "resources": [
    #       {
    #         "limitsCpu": "1",
    #         "limitsMem": "2Gi",
    #         "name": "metrics-server",
    #       }
    #     ]
    #   }
    # EOF
  }
}


data "opentelekomcloud_cce_addon_template_v3" "npd" {
  addon_version = var.npd_version
  addon_name    = "npd"
}

resource "opentelekomcloud_cce_addon_v3" "npd" {
  template_name    = data.opentelekomcloud_cce_addon_template_v3.npd.addon_name
  template_version = data.opentelekomcloud_cce_addon_template_v3.npd.addon_version
  cluster_id       = opentelekomcloud_cce_cluster_v3.cluster.id

  values {
    basic = {
      "swr_addr" = data.opentelekomcloud_cce_addon_template_v3.npd.swr_addr
      "swr_user" = data.opentelekomcloud_cce_addon_template_v3.npd.swr_user
    }
    custom = {}
  }
}

Debug Output/Panic Output

Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: error listing installed addons: Resource not found: [GET https://27099715-8e95-11ee-aa9a-0255ac100043.cce.eu-ch2.sc.otc.t-systems.com/api/v3/addons?cluster_id=27099715-8e95-11ee-aa9a-0255ac100043], error message: {"error_msg":"The API does not exist or has not been published in the environment","error_code":"APIGW.0101","request_id":"a3fd2d98efaf36ab35d6c488f0c51da2"}
│ 
│ 
│   with module.cce["blackout"].opentelekomcloud_cce_cluster_v3.cluster,
│   on modules/cce/cluster.tf line 52, in resource "opentelekomcloud_cce_cluster_v3" "cluster":52: resource "opentelekomcloud_cce_cluster_v3" "cluster" {

Steps to Reproduce

Gitlabrunner:

  1. terraform plan

Expected Behavior

The api should be reached and the apply should start.
GET without cluster_id before the cce.eu-ch2 is working for us.
https://cce.eu-ch2.sc.otc.t-systems.com/api/v3/addons?cluster_id=27099715-8e95-11ee-aa9a-0255ac100043

Actual Behavior

There occoured an error message that the API does not exist or has not been published in the environment

Important Factoids

We using Tokens they are reset every 24h.

References

@dombisza
Copy link
Contributor

dombisza commented Dec 8, 2023

Seems to be an issue on the APIGW of swiss cloud. Opened an internal ticket for the responsible squad: CONT-2320

@anton-sidelnikov anton-sidelnikov self-assigned this Dec 12, 2023
@dombisza
Copy link
Contributor

@Maeschlii the APIs are suppose to be fixed. Can you please re-test?

@Wolfslicht
Copy link

Hey @dombisza , @anton-sidelnikov

we find another change in the Endpoints, and I would believe there are more.
So the terraform plan comes up with a plan, but as we want to apply we got an error:

CODE

resource "opentelekomcloud_vpc_v1" "MKE-MOCK" {
  name = var.MKE-MOCK
  cidr = var.MKE-MOCK_cidr
}

STACK

terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
  + create

Terraform will perform the following actions:

  # opentelekomcloud_vpc_v1.MKE-MOCK will be created
  + resource "opentelekomcloud_vpc_v1" "MKE-MOCK" {
      + cidr   = "10.0.0.0/16"
      + id     = (known after apply)
      + name   = "MKE-MOCK"
      + region = (known after apply)
      + shared = (known after apply)
      + status = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

opentelekomcloud_vpc_v1.MKE-MOCK: Creating...
╷
│ Error: error creating OpenTelekomCloud VPC: Resource not found: [POST https://vpc.eu-ch2.sc.otc.t-systems.com/v1//vpcs], error message: {"error_msg":"The API does not exist or has not been published in the environment","error_code":"APIGW.0101","request_id":"6ea58f08dfe8f105f2b5f763ab20c593"}
│
│
│   with opentelekomcloud_vpc_v1.MKE-MOCK,
│   on main.tf line 2, in resource "opentelekomcloud_vpc_v1" "MKE-MOCK":
│    2: resource "opentelekomcloud_vpc_v1" "MKE-MOCK" {

@dombisza
Copy link
Contributor

dombisza commented Dec 19, 2023

@Wolfslicht This is a different issue, notice that the URL for API call is missing the project_id:
POST https://vpc.eu-ch2.sc.otc.t-systems.com/v1//vpcs
Most likely it is a configuration issue, can you check your provider config and also check if similar is happening with other resources as well?

@Wolfslicht
Copy link

I figured out. It was a provider setup issue.
delegated_project_name was used, instead of tenant_name

So no Issue with the APIGW for VPC.

Sorry for escalation.

@anton-sidelnikov anton-sidelnikov added the otc-issue Blocked by OTC issues label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
otc-issue Blocked by OTC issues
Projects
None yet
Development

No branches or pull requests

4 participants