-
Notifications
You must be signed in to change notification settings - Fork 176
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
[BUG] Can’t set the value of externalTrafficPolicy to Cluster in the Service. #8235
Comments
Hi @shuoshadow |
the serviceType Instead of posing an OpsRequest, you can manipulate the apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: camellia-cluster
namespace: default
spec:
terminationPolicy: Delete
services: # patch Cluster CR with your services
- componentSelector: proxy
name: proxy-internet
serviceName: proxy-internet
annotations: # customized annotations if necessary
yourkey: yourvalue
spec: # this is `corev1.ServiceSpec`
ports:
- name: redis-proxy
nodePort: 30449
port: 6380
protocol: TCP
targetPort: redis-proxy
- name: console-port
nodePort: 31347
port: 16379
protocol: TCP
targetPort: console-port
type: LoadBalancer
externalTrafficPolicy: Cluster # specify the externalTrafficPolicy attribute here
componentSpecs:
- name: proxy
componentDef: camellia-redis-proxy
... |
@shanshanying Thanks, I successfully implemented the modification of the externalTrafficPolicy in the service using this method. |
When I create a Service of type LoadBalancer, the value of externalTrafficPolicy is set to Local by default and cannot be changed to Cluster.
In my Kubernetes cluster, I’m using the Cilium CNI component and assigning EXTERNAL-IP to LoadBalancer type services through the CiliumBGPPeeringPolicy.
When the Service has externalTrafficPolicy: Cluster, BGP Control Plane unconditionally advertises the ingress IPs of the selected Service. When the Service has externalTrafficPolicy: Local, BGP Control Plane keeps track of the endpoints for the service on the local node and stops advertisement when there’s no local endpoint.
https://docs.cilium.io/en/stable/network/bgp-control-plane/bgp-control-plane-v1/#externaltrafficpolicy
So I need to set the externalTrafficPolicy for the Service to Cluster.
The text was updated successfully, but these errors were encountered: