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

error when using loadBalancerIP on dual stack setups #228

Open
craigcabrey opened this issue May 28, 2022 · 0 comments
Open

error when using loadBalancerIP on dual stack setups #228

craigcabrey opened this issue May 28, 2022 · 0 comments

Comments

@craigcabrey
Copy link

Warning from MetalLB:

Warning  AllocationFailed  111s  metallb-controller  Failed to allocate IP for "pihole/pihole-dns-tcp": requested loadBalancer IP(s) ["192.168.100.101"] does not match the ipFamily of the service

values.yaml:

dualStack:
  enabled: true

[snip]

serviceDns:
  type: LoadBalancer
  loadBalancerIP: 192.168.100.101
  loadBalancerIPv6: [snip]:f904::101
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc

[snip]

What the Helm chart generates for the IPv4 services:

apiVersion: v1
kind: Service
metadata:
  name: pihole-dns-tcp
  labels:
    app: pihole
    chart: pihole-2.5.8
    release: pihole
    heritage: Helm
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
spec:
  type: LoadBalancer
  loadBalancerIP: 192.168.100.101
  externalTrafficPolicy: Local
  ports:
    - port: 53
      targetPort: dns
      protocol: TCP
      name: dns
  selector:
    app: pihole
    release: pihole

What it generates for the IPv6 service:

apiVersion: v1
kind: Service
metadata:
  name: pihole-dns-tcp-ipv6
  labels:
    app: pihole
    chart: pihole-2.5.8
    release: pihole
    heritage: Helm
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
spec:
  type: LoadBalancer
  ipFamilies:
  - IPv6
  ipFamilyPolicy: SingleStack
  loadBalancerIP: [snip]:f904::101
  externalTrafficPolicy: Local
  ports:
    - port: 53
      targetPort: dns
      protocol: TCP
      name: dns
  selector:
    app: pihole
    release: pihole

The workaround is to save the IPv4 service to a file, edit it to include the ipFamilyPolicy and ipFamilies directives, then apply it. After that, Metallb assigns the requested IPv4 address immediately.

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

No branches or pull requests

1 participant