diff --git a/charts/pulsar/templates/proxy-service.yaml b/charts/pulsar/templates/proxy-service.yaml index 302a3d7f..6f5235c5 100644 --- a/charts/pulsar/templates/proxy-service.yaml +++ b/charts/pulsar/templates/proxy-service.yaml @@ -35,6 +35,12 @@ spec: {{- with .Values.proxy.service.loadBalancerIP }} loadBalancerIP: {{ . }} {{- end }} + {{- if .Values.proxy.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.proxy.service.externalTrafficPolicy }} + {{- end }} + {{- if .Values.proxy.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{ toYaml .Values.proxy.service.loadBalancerSourceRanges | nindent 4 }} + {{- end }} ports: {{- if or (not .Values.tls.enabled) (not .Values.tls.proxy.enabled) }} - name: http diff --git a/charts/pulsar/templates/pulsar-manager-service.yaml b/charts/pulsar/templates/pulsar-manager-service.yaml index 3c2450e4..26455a6b 100644 --- a/charts/pulsar/templates/pulsar-manager-service.yaml +++ b/charts/pulsar/templates/pulsar-manager-service.yaml @@ -30,6 +30,12 @@ metadata: {{ toYaml .Values.pulsar_manager.service.annotations | indent 4 }} spec: type: {{ .Values.pulsar_manager.service.type }} + {{- if .Values.pulsar_manager.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.pulsar_manager.service.externalTrafficPolicy }} + {{- end }} + {{- if .Values.pulsar_manager.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{ toYaml .Values.pulsar_manager.service.loadBalancerSourceRanges | nindent 4 }} + {{- end }} ports: - name: server port: {{ .Values.pulsar_manager.service.port }} diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index fbfde7a2..92f1da2b 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -967,6 +967,12 @@ proxy: type: LoadBalancer ## Optional. Leave it blank to get next available random IP. loadBalancerIP: "" + ## Set external traffic policy to: "Local" to preserve source IP on providers supporting it. + ## Ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-typeloadbalancer + # externalTrafficPolicy: Local + ## Restrict traffic through the load balancer to specified IPs on providers supporting it. + # loadBalancerSourceRanges: + # - 10.0.0.0/8 ## Proxy ingress ## templates/proxy-ingress.yaml ## @@ -1131,6 +1137,12 @@ pulsar_manager: port: 9527 targetPort: 9527 annotations: {} + ## Set external traffic policy to: "Local" to preserve source IP on providers supporting it. + ## Ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-typeloadbalancer + # externalTrafficPolicy: Local + ## Restrict traffic through the load balancer to specified IPs on providers supporting it. + # loadBalancerSourceRanges: + # - 10.0.0.0/8 ## Pulsar manager ingress ## templates/pulsar-manager-ingress.yaml ##