From b84e68bbdead4c95542b02fa95a604205c721db8 Mon Sep 17 00:00:00 2001 From: Yves Vogl <39190668+yves-vogl@users.noreply.github.com> Date: Wed, 20 Feb 2019 10:01:45 +0100 Subject: [PATCH] Support configuration of externalTrafficPolicy for services from type NodePort (#11302) * Adding externalTrafficPolicy to service definition to preserve the client source IP by default Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Yves Vogl * Bumping version Signed-off-by: Yves Vogl * Adding variable to README Signed-off-by: Yves Vogl --- stable/chartmuseum/Chart.yaml | 2 +- stable/chartmuseum/README.md | 1 + stable/chartmuseum/templates/service.yaml | 3 +++ stable/chartmuseum/values.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stable/chartmuseum/Chart.yaml b/stable/chartmuseum/Chart.yaml index 373e7fa684..7bcd1f78a6 100644 --- a/stable/chartmuseum/Chart.yaml +++ b/stable/chartmuseum/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Host your own Helm Chart Repository name: chartmuseum -version: 1.9.0 +version: 1.9.1 appVersion: 0.8.1 home: https://github.com/helm/chartmuseum icon: https://raw.githubusercontent.com/helm/chartmuseum/master/logo2.png diff --git a/stable/chartmuseum/README.md b/stable/chartmuseum/README.md index 07b0e048c7..833cc1dfb7 100644 --- a/stable/chartmuseum/README.md +++ b/stable/chartmuseum/README.md @@ -131,6 +131,7 @@ their default values. See values.yaml for all available options. | `gcp.secret.key` | Secret key for te GCP json file | `credentials.json` | | `service.type` | Kubernetes Service type | `ClusterIP` | | `service.clusterIP` | Static clusterIP or None for headless services| `nil` | +| `service.externalTrafficPolicy` | Source IP preservation (only for Service type NodePort) | `Local` | | `service.servicename` | Custom name for service | `` | | `service.labels` | Additional labels for service | `{}` | | `deployment.labels` | Additional labels for deployment | `{}` | diff --git a/stable/chartmuseum/templates/service.yaml b/stable/chartmuseum/templates/service.yaml index 65ce7a2883..7d42601ccb 100644 --- a/stable/chartmuseum/templates/service.yaml +++ b/stable/chartmuseum/templates/service.yaml @@ -17,6 +17,9 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} + {{- end }} {{- if eq .Values.service.type "ClusterIP" }} {{- if .Values.service.clusterIP }} clusterIP: {{ .Values.service.clusterIP }} diff --git a/stable/chartmuseum/values.yaml b/stable/chartmuseum/values.yaml index 28d1a19d85..355125e077 100644 --- a/stable/chartmuseum/values.yaml +++ b/stable/chartmuseum/values.yaml @@ -118,6 +118,7 @@ replica: service: servicename: type: ClusterIP + externalTrafficPolicy: Local # clusterIP: None externalPort: 8080 nodePort: