You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by to...@apache.org on 2021/06/03 11:01:35 UTC

[apisix-helm-chart] branch master updated: chore: add externalTrafficPolicy for apisix gateway service (#89)

This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new 605c0c5  chore: add externalTrafficPolicy for apisix gateway service (#89)
605c0c5 is described below

commit 605c0c5520fe2b9b7724df3269b5471f14d88db4
Author: Jintao Zhang <ta...@163.com>
AuthorDate: Thu Jun 3 19:01:29 2021 +0800

    chore: add externalTrafficPolicy for apisix gateway service (#89)
    
    Signed-off-by: Jintao Zhang <zh...@gmail.com>
---
 charts/apisix/README.md                      | 15 ++++++++-------
 charts/apisix/templates/service-gateway.yaml |  1 +
 charts/apisix/values.yaml                    |  3 +++
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/charts/apisix/README.md b/charts/apisix/README.md
index 524714d..20c7cf1 100644
--- a/charts/apisix/README.md
+++ b/charts/apisix/README.md
@@ -79,13 +79,14 @@ The following tables lists the configurable parameters of the apisix chart and t
 
 Apache APISIX service parameters, this determines how users can access itself.
 
-| Parameter                  | Description                                                                      | Default                                                 |
-|----------------------------|----------------------------------------------------------------------------------|---------------------------------------------------------|
-| `gateway.type`             | Apache APISIX service type for user access itself                                | `NodePort`                                              |
-| `gateway.http`             | Apache APISIX service settings for http                                          |                                                         |
-| `gateway.tls`              | Apache APISIX service settings for tls                                           |                                                         |
-| `gateway.stream`           | Apache APISIX service settings for stream                                        |                                                         |
-| `gateway.ingress`          | Using ingress access Apache APISIX service                                       |                                                         |
+| Parameter                       | Description                                                                      | Default                                                 |
+|---------------------------------|----------------------------------------------------------------------------------|---------------------------------------------------------|
+| `gateway.type`                  | Apache APISIX service type for user access itself                                | `NodePort`                                              |
+| `gateway.externalTrafficPolicy` | Setting how the Service route external traffic                                   | `Cluster`                                               |
+| `gateway.http`                  | Apache APISIX service settings for http                                          |                                                         |
+| `gateway.tls`                   | Apache APISIX service settings for tls                                           |                                                         |
+| `gateway.stream`                | Apache APISIX service settings for stream                                        |                                                         |
+| `gateway.ingress`               | Using ingress access Apache APISIX service                                       |                                                         |
 
 
 ### admin parameters
diff --git a/charts/apisix/templates/service-gateway.yaml b/charts/apisix/templates/service-gateway.yaml
index 482e7e4..6d99468 100644
--- a/charts/apisix/templates/service-gateway.yaml
+++ b/charts/apisix/templates/service-gateway.yaml
@@ -28,6 +28,7 @@ metadata:
     {{- include "apisix.labels" . | nindent 4 }}
 spec:
   type: {{ .Values.gateway.type }}
+  externalTrafficPolicy: {{ .Values.gateway.externalTrafficPolicy }}
   {{- if eq .Values.gateway.type "LoadBalancer" }}
   {{- if .Values.gateway.loadBalancerIP }}
   loadBalancerIP: {{ .Values.gateway.loadBalancerIP }}
diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml
index f656ee7..41de5ab 100644
--- a/charts/apisix/values.yaml
+++ b/charts/apisix/values.yaml
@@ -68,6 +68,9 @@ fullnameOverride: ""
 
 gateway:
   type: NodePort
+  # If you want to keep the client source IP, you can set this to Local.
+  # ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
+  externalTrafficPolicy: Cluster
   # type: LoadBalancer
   # annotations:
   #   service.beta.kubernetes.io/aws-load-balancer-type: nlb