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

[Release-1.27] - SyncLoadBalancerFailed when using a very long (yet valid) service name #10566

Closed
brandond opened this issue Jul 24, 2024 · 1 comment
Assignees
Milestone

Comments

@brandond
Copy link
Member

Backport fix for SyncLoadBalancerFailed when using a very long (yet valid) service name

@fmoral2
Copy link
Contributor

fmoral2 commented Aug 9, 2024

Validated on Version:

-$  k3s version v1.27.16+k3s-8c79522e (8c79522e)

Environment Details

Infrastructure
Cloud EC2 instance

Node(s) CPU architecture, OS, and Version:
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"

Cluster Configuration:
1 node server

Steps to validate the fix

  1. Install k3s
  2. Create a lb service with a very long name yet valid in the range of 63 chars
apiVersion: v1
kind: Service
metadata:
  name: a-service-with-a-very-veeeeeery-long-yet-valid-name
spec:
  selector:
    app.kubernetes.io/name: MyApp
  ports:
    - protocol: TCP
      port: 80
  type: LoadBalancer
  1. Validate that the service is created and working as expected
  2. Validate pods

Reproduction Issue:


~$  k apply -f ldservicelongnameyetvalid.yaml


 $ journalctl -xeu k3s.service -f | grep "Error syncing load balancer"

Aug 09 12:35:20 ip  k3s[1803]: I0809 12:35:20.548326    1803 event.go:389] "Event occurred" object="default/a-service-with-a-very-veeeeeery-long-yet-valid-name" fieldPath="" kind="Service" apiVersion="v1" type="Warning" reason="SyncLoadBalancerFailed" message="Error syncing load balancer: failed to ensure load balancer: failed to create kube-system/svclb-a-service-with-a-very-veeeeeery-long-yet-valid-name-1c1eaccc apps/v1, Kind=DaemonSet for  default/a-service-with-a-very-veeeeeery-long-yet-valid-name: DaemonSet.apps \"svclb-a-service-with-a-very-veeeeeery-long-yet-valid-name-1c1eaccc\" is invalid: [spec.selector.matchLabels: Invalid value: \"svclb-a-service-with-a-very-veeeeeery-long-yet-valid-name-1c1eaccc\": must be no more than 63 characters, spec.template.labels: Invalid value: \"svclb-a-service-with-a-very-veeeeeery-long-yet-valid-name-1c1eaccc\": must be no more than 63 characters]"



Validation Results:


 
~$  k apply -f ldservicelongnameyetvalid.yaml


$ k get pods -A
 
kube-system   svclb-a-service-with-a-very-veeeeeery-long-yet-valid-n-1b8rd5s9   0/1     Pending     0          78s

  

  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants