Skip to content

Commit

Permalink
fix: publishNotReadyAddresses K8s version check (#242)
Browse files Browse the repository at this point in the history
* fix: publishNotReadyAddresses K8s version check

The annotation `service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"` is deprecated since Kubernetes 1.11, following kubernetes/kubernetes#63742
The template input both fields, the annotation and the substituted field `.spec.publishNotReadyAddresses=True` but it becomes incompatible with Kubernetes <=1.10 so a check Kubernetes version resolve it put the right fields based on Kubernetes version.

* Bumping chart version

* Update Chart.yaml

---------

Co-authored-by: Aaron Layfield <Aaron.Layfield@gmail.com>
  • Loading branch information
trombini77 and DandyDeveloper committed Mar 2, 2023
1 parent c0fe916 commit f2f71d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/redis-ha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
- redis
- keyvalue
- database
version: 4.22.5
version: 4.22.6
appVersion: 7.0.4
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-announce-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
{{- if (semverCompare "<=1.10-0" $.Capabilities.KubeVersion.GitVersion) }}
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
{{- end }}
{{- if $root.Values.serviceAnnotations }}
{{ toYaml $root.Values.serviceAnnotations | indent 4 }}
{{- end }}
spec:
{{- if (semverCompare ">=1.11-0" $.Capabilities.KubeVersion.GitVersion) }}
publishNotReadyAddresses: true
{{- end }}
type: ClusterIP
ports:
{{- if ne (int $root.Values.redis.port) 0 }}
Expand Down

0 comments on commit f2f71d5

Please sign in to comment.