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

[LoadBalancerClass] Better defaulting for Service objects #851

Closed
Cellebyte opened this issue May 14, 2024 · 0 comments · Fixed by #855
Closed

[LoadBalancerClass] Better defaulting for Service objects #851

Cellebyte opened this issue May 14, 2024 · 0 comments · Fixed by #855

Comments

@Cellebyte
Copy link
Collaborator

Cellebyte commented May 14, 2024

Describe the bug
When you define a LoadBalancerClass via env or cli flag kube-vip only reconciles Service objects with this LoadBalancerClass.
This is expected behaviour and should stay like that.
The problem is when you have kube-vip running without a LoadBalancerClass defined, it also reconciles Services with a LoadBalancerClass. This would lead to unexpected behaviour as it could announce IPs which it should not.

e.g.
Ingress controllers without a specific IngressClass set, only reconcile Ingresses without a IngressClass and ignore all Ingresses which have such IngressClass defined.

To Reproduce
Steps to reproduce the behavior:

  1. Install kube-vip with svc_enable and the mode you like but without LoadBalancerClassName set
  2. Create 2 Services
# a normal Service without a loadbalancerclass
apiVersion: v1
kind: Service
metadata:
  name: default
spec:
  externalTrafficPolicy: Local
  ports:
  - name: http
    nodePort: 31690
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 32093
    port: 443
    protocol: TCP
    targetPort: https
  selector: {}
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 10.0.0.0
# Service with a loadBalancerClass set
apiVersion: v1
kind: Service
metadata:
  name: default
spec:
  externalTrafficPolicy: Local
  ports:
  - name: http
    nodePort: 31690
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 32093
    port: 443
    protocol: TCP
    targetPort: https
  selector: {}
  sessionAffinity: None
  type: LoadBalancer
  loadBalancerClass: kube-vip.io/kube-vip-class
status:
  loadBalancer:
    ingress:
    - ip: 10.0.0.1

Expected behavior
The second service from the example above should not be reconciled by kube-vip but rather be skipped.

Screenshots

Environment (please complete the following information):

  • OS/Distro: Ubuntu 20.04
  • Kubernetes Version: v1.27.13
  • Kube-vip Version: v0.8.0
@Cellebyte Cellebyte changed the title [LoadBalancerClass] Better defaulting for Service objects without it. [LoadBalancerClass] Better defaulting for Service objects without May 14, 2024
@Cellebyte Cellebyte changed the title [LoadBalancerClass] Better defaulting for Service objects without [LoadBalancerClass] Better defaulting for Service objects May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant