kubernetes-sigs / cloud-provider-huaweicloud

HUAWEI CLOUD Controller Manager is an external cloud controller manager for running kubernetes in a HUAWEI CLOUD cluster.
Apache License 2.0
40 stars 26 forks source link

Default Config using ConfigMap is not working for Dedicated ELB #218

Closed cloudomate closed 1 year ago

cloudomate commented 1 year ago

What happened: Followed the guide to create a configmap for default configuration for dedicated ELB. I tried to create the LoadBalancer service without giving the annotations. The service creation fails as the CCM is not able to configure the listener for ELB. The default configuration in the configmap does not work for dedicated ELB

What you expected to happen: Loadbalancer service should be created with Dedicated ELB and listeners added properly

How to reproduce it (as minimally and precisely as possible): Create a configmap as per sample below, replace AZ and Flavor ID. Try to create a ELB service without giving annotations apiVersion: v1 kind: ConfigMap metadata: namespace: huawei-cloud-provider name: loadbalancer-config data: loadBalancerOption: |- { "availability-zones":"az" "l4-flavor-id":"flavor id", "lb-algorithm": "ROUND_ROBIN", "eip-auto-create-option": { "ip_type": "5_bgp", "bandwidth_size": 5, "share_type": "PER" }, "keep-eip": false, "session-affinity-flag": "on", "session-affinity-option": { "type": "SOURCE_IP", "persistence_timeout": 15 }, "health-check-flag": "on", "health-check-option": { "delay": 5, "timeout": 15, "max_retries": 5 } } Anything else we need to know?:

Environment:

chengxiangdong commented 1 year ago

availability-zones and eip-auto-create-option are not supported in loadbalancer-config, other parameters are supported. Are there any errors other than unsupported parameters?

chengxiangdong commented 1 year ago

Others: I can see this error in the logs, {"status_code":400,"request_id":"","error_code":"ELB.8902","error_message":"Invalid input for transparent_client_ip_enable."}

Did you use kubernetes.io/elb.enable-transparent-client-ip in the annotation, can you provide the yaml to create the service?

cloudomate commented 1 year ago

I tried following annotations option,

  1. no tag for
  2. kubernetes.io/elb.enable-transparent-client-ip: true As I understand for Dedicated ELB this value is default true.

availability-zones and eip-auto-create-option are not supported in loadbalancer-config, other parameters are supported. Are there any errors other than unsupported parameters?

Availability Zone is mandatory parameter for Dedicated ELB, so this config option does not work Dedicated ELB !

cloudomate commented 1 year ago

Others: I can see this error in the logs, {"status_code":400,"request_id":"","error_code":"ELB.8902","error_message":"Invalid input for transparent_client_ip_enable."}

Did you use kubernetes.io/elb.enable-transparent-client-ip in the annotation, can you provide the yaml to create the service?

As I understand this value is true, and Dedicated ELB needs true so I tried both options.

  1. Pass explicitly "kubernetes.io/elb.enable-transparent-client-ip: true" tag and
  2. skip this tag,

both time get the same error : {"status_code":400,"request_id":"","error_code":"ELB.8902","error_message":"Invalid input for transparent_client_ip_enable."}

chengxiangdong commented 1 year ago

Others: I can see this error in the logs, {"status_code":400,"request_id":"","error_code":"ELB.8902","error_message":"Invalid input for transparent_client_ip_enable."}

Did you use kubernetes.io/elb.enable-transparent-client-ip in the annotation, can you provide the yaml to create the service?

As I understand this value is true, and Dedicated ELB needs true so I tried both options.

  1. Pass explicitly "kubernetes.io/elb.enable-transparent-client-ip: true" tag and
  2. skip this tag,

both time get the same error : {"status_code":400,"request_id":"","error_code":"ELB.8902","error_message":"Invalid input for transparent_client_ip_enable."}

It seems to be a bug in the previous version, are you using the new version?

I use the yaml below to create a service and everything works fine.

apiVersion: v1
kind: Service
metadata:
  annotations:
    kubernetes.io/elb.class: dedicated
    kubernetes.io/elb.availability-zones: ap-southeast-1a
    kubernetes.io/elb.enable-transparent-client-ip: 'true'
  labels:
    app: nginx
  name: elb-service-demo
  namespace: default
spec:
  ports:
    - port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: nginx
  type: LoadBalancer
chengxiangdong commented 1 year ago

I tried following annotations option,

  1. no tag for
  2. kubernetes.io/elb.enable-transparent-client-ip: true As I understand for Dedicated ELB this value is default true.

availability-zones and eip-auto-create-option are not supported in loadbalancer-config, other parameters are supported. Are there any errors other than unsupported parameters?

Availability Zone is mandatory parameter for Dedicated ELB, so this config option does not work Dedicated ELB !

Currently the availability-zones parameter is not read in the loadbalancer-config configuration, so it does not work, the same for eip-auto-create-option.

We can support it in a later version.

cloudomate commented 1 year ago

ok thanks.