Closed levshvarts closed 4 months ago
Alright, I figured out what the issue is... Maybe keep this closed bug just in case anybody else hits this issue, as the error given by the platform is meaningless.
My issue was that the ELB that I created didn't have subnet_id
specified, so it couldn't bind to an ip on the subnet. With the following change to the Service Load Balancer definition, the issue was resolved:
data "opentelekomcloud_lb_flavor_v3" "network_lb_small" {
name = var.service_lb_flavor_name
}
resource "opentelekomcloud_lb_loadbalancer_v3" "service_load_balancer" {
name = "test-service-lb"
router_id = var.vpc.id
subnet_id = var.cluster_subnet_id
network_ids = [var.cluster_subnet_id]
l4_flavor = data.opentelekomcloud_lb_flavor_v3.network_lb_small.id
availability_zones = [var.availability_zone]
public_ip {
id = opentelekomcloud_vpc_eip_v1.service_load_balancer_ip.id
}
}
In reality the way provider allowed me to create the load balancer is wrong and it seems like subnet_id
should be required, as this is required on the OTC UI.
Also note, that if you want to assign this ELB to the LoadBalancer service type in CCE, you have to specify l4_flavor
, which is also not obvious.
With the above changes I can simply apply my k8s manifest to the cluster and see it run:
$ kubectl apply -f nginx.yml
deployment.apps/nginx created
service/ngnix-service created
$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ngnix-service LoadBalancer 10.246.230.99 10.50.143.169,xx.xx.xx.x7 443:31092/TCP 8m51s
Hi @levshvarts thanks for sharing solution, i will close this issue.
Terraform provider version
Affected Resource(s)
opentelekomcloud_cce_cluster_v3
Terraform Configuration Files
Steps to Reproduce
terraform apply
Error syncing load balancer: failed to ensure load balancer: Failed to ListEips : request failed: {"error_msg":"Incorrect IAM authentication information: verify aksk signature fail, canonical_request:GET|\/v1\/d13fe6ad9bad43e29904a38b8731b121\/publicips\/|port_id=|host:vpc.eu-de.otc.t-systems.com|x-project-id:d13fe6ad9bad43e29904a38b8731b121|x-sdk-date:20240502T222345Z||host;x-project-id;x-sdk-date|e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","error_code":"APIGW.0301","request_id":"90f7714c6ee0f4a31ae34cd4a930138e"} , status code: 401
Expected Behavior
Service is up and running and has an assigned load balancer IP:
Actual Behavior
Service is stuck in pending state:
Important Factoids
The most strange thing is that I encounter this error when using kubeconfig from the CCE cluster created with terroform provider. When I add a service through a console(on the cluster created with terraform) the service gets the load-balancer associated just fine. In addition, when I create a CCE cluster through the console this issue disappears - I can use the kubeconfig generated by the platform and apply the same nginx service yaml and the ip gets assigned.
However with this problem terraform provider is somewhat useless, as we would have to create everything thorough the console anyways.
I tried this using both AK/SK and User ID + Password + TOTP type of auth for the provider.
References