From a830d2eb178d696548110d4fbbce3144a2acef84 Mon Sep 17 00:00:00 2001 From: Niklas Wagner Date: Tue, 1 Dec 2020 15:45:13 +0100 Subject: [PATCH] Support for Session Affinity option in service template --- Chart.yaml | 2 +- README.md | 2 ++ templates/service.yaml | 7 +++++++ values.yaml | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 1aad45f..82d4171 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A Helm chart for Docker Registry name: docker-registry -version: 1.9.7 +version: 1.10.0 appVersion: 2.7.1 home: https://hub.docker.com/_/registry/ icon: https://hub.docker.com/public/images/logos/mini-logo.svg diff --git a/README.md b/README.md index 3015339..00f1fd5 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ their default values. | `service.nodePort` | if `service.type` is `NodePort` and this is non-empty, sets the node port of the service | `nil` | | `service.loadBalancerIP` | if `service.type` is `LoadBalancer` and this is non-empty, sets the loadBalancerIP of the service | `nil` | | `service.loadBalancerSourceRanges`| if `service.type` is `LoadBalancer` and this is non-empty, sets the loadBalancerSourceRanges of the service | `nil` | +| `service.sessionAffinity` | service session affinity | `nil` | +| `service.sessionAffinityConfig` | service session affinity config | `nil` | | `replicaCount` | k8s replicas | `1` | | `updateStrategy` | update strategy for deployment | `{}` | | `podAnnotations` | Annotations for pod | `{}` | diff --git a/templates/service.yaml b/templates/service.yaml index 70893ab..801a509 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -21,6 +21,13 @@ spec: {{- end }} {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges))) }} loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} +{{- end }} +{{- if .Values.service.sessionAffinity }} + sessionAffinity: {{ .Values.service.sessionAffinity }} + {{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: + {{ toYaml .Values.service.sessionAffinityConfig | nindent 4 }} + {{- end -}} {{- end }} ports: - port: {{ .Values.service.port }} diff --git a/values.yaml b/values.yaml index c368abc..46ea691 100644 --- a/values.yaml +++ b/values.yaml @@ -21,6 +21,8 @@ image: service: name: registry type: ClusterIP + # sessionAffinity: None + # sessionAffinityConfig: {} # clusterIP: port: 5000 # nodePort: