From 3e902a57a961b20780fd39e532f94fc259457774 Mon Sep 17 00:00:00 2001 From: Leroy Shirto Date: Wed, 21 Jun 2023 12:14:36 +0100 Subject: [PATCH] feat(helm): make sessionAffinity configurable (#4623) Co-authored-by: knqyf263 --- helm/trivy/README.md | 1 + helm/trivy/templates/service.yaml | 3 ++- helm/trivy/values.yaml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/helm/trivy/README.md b/helm/trivy/README.md index 74d5a9301608..5b4e2690bd57 100644 --- a/helm/trivy/README.md +++ b/helm/trivy/README.md @@ -81,6 +81,7 @@ The following table lists the configurable parameters of the Trivy chart and the | `service.name` | If specified, the name used for the Trivy service | | | `service.type` | Kubernetes service type | `ClusterIP` | | `service.port` | Kubernetes service port | `4954` | +| `service.sessionAffinity` | Kubernetes service session affinity | `ClientIP` | | `httpProxy` | The URL of the HTTP proxy server | | | `httpsProxy` | The URL of the HTTPS proxy server | | | `noProxy` | The URLs that the proxy settings do not apply to | | diff --git a/helm/trivy/templates/service.yaml b/helm/trivy/templates/service.yaml index 4de493d2513f..8744b2201424 100644 --- a/helm/trivy/templates/service.yaml +++ b/helm/trivy/templates/service.yaml @@ -14,4 +14,5 @@ spec: protocol: TCP port: {{ .Values.service.port | default 4954 }} targetPort: {{ .Values.service.port | default 4954 }} - sessionAffinity: ClientIP + sessionAffinity: {{ .Values.service.sessionAffinity | default "ClientIP" }} + diff --git a/helm/trivy/values.yaml b/helm/trivy/values.yaml index 250010ce06b0..a969f10b7899 100644 --- a/helm/trivy/values.yaml +++ b/helm/trivy/values.yaml @@ -136,6 +136,8 @@ service: type: ClusterIP # port Kubernetes service port port: 4954 + # sessionAffinity Kubernetes service session affinity + sessionAffinity: ClientIP ingress: enabled: false