Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't set externalTrafficPolicy when externalService is ClusterIP #266

Open
baby-gnu opened this issue Jun 9, 2023 · 9 comments · May be fixed by #374
Open

Don't set externalTrafficPolicy when externalService is ClusterIP #266

baby-gnu opened this issue Jun 9, 2023 · 9 comments · May be fixed by #374
Labels
bug Something isn't working

Comments

@baby-gnu
Copy link

baby-gnu commented Jun 9, 2023

Describe the bug

I can't deploy the helm with the following values.yaml:

front:
  hostPort:
    enabled: false

  externalService:
    enabled: true
    type: ClusterIP

I get the following error:

Error: Service "mailu-front-ext" is invalid: spec.externalTrafficPolicy: Invalid value: "Local": may only be set when `type` is 'NodePort' or 'LoadBalancer'

Environment

  • Kubernetes Platform Scaleway

Additional context

I have an existing nginx ingress as LoadBalancer with correct TCP service forwarding.

@baby-gnu baby-gnu added the bug Something isn't working label Jun 9, 2023
@emouawad
Copy link

+1 same here

@jlxq0
Copy link

jlxq0 commented Oct 6, 2024

Same. Did anyone figure this out?

@WebSpider
Copy link
Contributor

I'll see if i can provide a PR for this

@jlxq0
Copy link

jlxq0 commented Oct 17, 2024

What's the workaround, @WebSpider?

@WebSpider
Copy link
Contributor

Sorry, real life happend. Thanks for tagging me, ill PR tonight.

Its a matter of putting an extra 'if' in the template that creates the service.

@jlxq0
Copy link

jlxq0 commented Oct 24, 2024

How do we get this merged now? 😇

@mreho
Copy link

mreho commented Dec 17, 2024

Hello, same issue here, I have a Octavia LoadBalancer in front of my K8S cluster (with Proxy Protocol, X-Forwarded-For headers enabled, and Real IP correctly set up), so the externalTrafficPolicy should be disabled for me too.

Maybe it can be a good thing to disable it by default, since most of the people running "heavy" apps like Mailu have load balancers in front of their cluster..

@larsskj
Copy link

larsskj commented Dec 30, 2024

I'm hit as well - though my situation seems to be a little different.

My local on-prem cluster is running MetalLB in order to create K8s services of type LoadBalancer complete with external IPs on my local network. I use it a lot - not least for services not running HTTP(S) like my Git server using SSH.

And Mailu with all the different mail related ports.

This has worked fine for a long time, but stopped working last night when I upgraded MetalLB to the latest incarnation. Everything worked fine - except for Mailu: It took some time to figure out why, but externalTrafficPolicy was the problem for me as well. Changing it from Local to Cluster like the 15+ other services using a LoadBalancer solved the problem.

Why do you set it to Local in the first place? It seems like a weird decission to me? Why not just leave the setting alone like all my other Helm charts?

@mreho
Copy link

mreho commented Jan 14, 2025

Hello @larsskj,
My loadbalancer is not managed by Kubernetes so I set all my services to ClusterIP (LoadBalancer would make my service in Pending state, waiting for an external IP), that's why externalTrafficPolicy is not applicable in my case.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants