Skip to content

Remove externalTrafficPolicy from template for service type ClusterIP - #950

Open
birke-kb wants to merge 1 commit into
apache:masterfrom
birke-kb:fix/service-type-cluster-ip
Open

birke-kb wants to merge 1 commit into
apache:masterfrom
birke-kb:fix/service-type-cluster-ip

Conversation

@birke-kb

Copy link
Copy Markdown

Add a condition to specify externalTrafficPolicy in the apisix-gateway service spec only for service types LoadBalancer and NodePort. Adding the field for service type ClusterIP leads to configuration errors in Kubernetes.

@eedeebee

Copy link
Copy Markdown

Hi apisix folks - thanks for making and maintaining this chart!

Is there anything else needed for this PR to get reviewed?

It addresses #755 and #780 which have been open for 2 years. I'm happy to help or add whatever it takes to get it in.

@martin-mat

Copy link
Copy Markdown

Confirming this is still needed on the current chart (apisix 2.17.0, APISIX 3.18.0). With service.type: ClusterIP, the install fails on Kubernetes 1.35:

Error: INSTALLATION FAILED: 1 error occurred:
	* Service "apisix-gateway" is invalid: spec.externalTrafficPolicy: Invalid value: "Cluster": may only be set for externally-accessible services

The template sets externalTrafficPolicy unconditionally, and the API server accepts it only on LoadBalancer and NodePort Services. This PR renders it for exactly those two types, so a ClusterIP gateway installs and the other types are unchanged. Fronting the gateway with an Ingress or a cloud load balancer is a common reason to want ClusterIP, as #755 and #780 describe.

The workaround in the meantime, for anyone landing here, is service.externalTrafficPolicy: null in the values.

Could a maintainer review this? It fixes #755, open since May 2024. Earlier attempts at the same fix (#792, #816) went stale without review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants