Skip to content

CKS: Service creation of type "LoadBalancer" fails when cluster name contains uppercase #8718

@zap51

Description

@zap51
ISSUE TYPE
  • Bug Report
COMPONENT NAME
CKS
CLOUDSTACK VERSION
4.16.1.0 onwards
CONFIGURATION
Advanced Networking
OS / ENVIRONMENT
Ubuntu 20.04 and later
SUMMARY

A Kubernetes Cluster managed by CKS fails to acquire external IP for the service of type "LoadBalancer" when the cluster / node names have upper case letters.

STEPS TO REPRODUCE
1. Create a cluster with some name which contains upper case characters like for example "Kubernetescl34t"
2. Nodes come online with lower case letters
# kubectl get no
NAME                                  STATUS   ROLES           AGE   VERSION
kubernetescl34t-control-18dee810e29   Ready    control-plane   88s   v1.28.4
kubernetescl34t-control-18dee813b32   Ready    control-plane   75s   v1.28.4
kubernetescl34t-control-18dee81618f   Ready    control-plane   74s   v1.28.4
kubernetescl34t-node-18dee818726      Ready    <none>          76s   v1.28.4
3. Run a sample pod and create a service of type "LoadBalancer"
# kubectl run --image=nginx nginx
pod/nginx created
root@Kubernetescl34t-control-18dee810e29:~# kubectl expose pod/nginx --type=LoadBalancer --port=80
service/nginx exposed
4. The external IP doesn't get acquired and the service-controller reports the below
# kubectl describe svc/nginx
Name:                     nginx
Namespace:                default
Labels:                   run=nginx
Annotations:              <none>
Selector:                 run=nginx
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.96.80.24
IPs:                      10.96.80.24
Port:                     <unset>  80/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  31692/TCP
Endpoints:                10.44.0.4:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type     Reason                  Age               From                Message
  ----     ------                  ----              ----                -------
  Normal   EnsuringLoadBalancer    6s (x4 over 43s)  service-controller  Ensuring load balancer
  Warning  SyncLoadBalancerFailed  6s (x4 over 42s)  service-controller  Error syncing load balancer: failed to ensure load balancer: could not find network

Mailing list reference: https://lists.apache.org/thread/bm1g6lmx6pv2tg8v331rtjn0ytxm4xpj

EXPECTED RESULTS
The external IP should be acquired. CKS should enforce only lowercase names for the cluster and the nodes.
ACTUAL RESULTS
Events:
  Type     Reason                  Age               From                Message
  ----     ------                  ----              ----                -------
  Normal   EnsuringLoadBalancer    6s (x4 over 43s)  service-controller  Ensuring load balancer
  Warning  SyncLoadBalancerFailed  6s (x4 over 42s)  service-controller  Error syncing load balancer: failed to ensure load balancer: could not find network

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions