diff --git a/stable/redis-ha/Chart.yaml b/stable/redis-ha/Chart.yaml index 3199db308e..ed14951892 100644 --- a/stable/redis-ha/Chart.yaml +++ b/stable/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 2.1.3 +version: 2.2.0 appVersion: 4.0.8-r0 description: Highly available Redis cluster with multiple sentinels and standbys. icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png diff --git a/stable/redis-ha/README.md b/stable/redis-ha/README.md index 72d80a8d60..88449095d0 100644 --- a/stable/redis-ha/README.md +++ b/stable/redis-ha/README.md @@ -67,6 +67,8 @@ The following table lists the configurable parameters of the Redis chart and the | `replicas.sentinels` | Number of sentinel pods | 3 | | `nodeSelector` | Node labels for pod assignment | {} | | `tolerations` | Toleration labels for pod assignment | [] | +| `sentinelAffinity` | Affinity for pod assignment of sentinels | hard antiaffinity between sentinels | +| `serverAffinity` | Affinity for pod assignment of servers | hard antiaffinity between servers | | `servers.serviceType` | Set to "LoadBalancer" to enable access from the VPC | ClusterIP | | `servers.annotations` | See Appliance mode | `` | | `rbac.create` | whether RBAC resources should be created | true | diff --git a/stable/redis-ha/templates/redis-sentinel-deployment.yaml b/stable/redis-ha/templates/redis-sentinel-deployment.yaml index 413dd3b1ab..8ac5bdb50d 100644 --- a/stable/redis-ha/templates/redis-sentinel-deployment.yaml +++ b/stable/redis-ha/templates/redis-sentinel-deployment.yaml @@ -23,6 +23,8 @@ spec: tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} + affinity: +{{ tpl .Values.sentinelAffinity . | indent 8 }} containers: - name: sentinel image: {{ .Values.redis_image }} diff --git a/stable/redis-ha/templates/redis-server-deployment.yaml b/stable/redis-ha/templates/redis-server-deployment.yaml index d8a1560e5c..e7bf8d9099 100644 --- a/stable/redis-ha/templates/redis-server-deployment.yaml +++ b/stable/redis-ha/templates/redis-server-deployment.yaml @@ -27,6 +27,8 @@ spec: tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} + affinity: +{{ tpl .Values.serverAffinity . | indent 8 }} containers: - name: redis image: {{ .Values.redis_image }} diff --git a/stable/redis-ha/values.yaml b/stable/redis-ha/values.yaml index de8c7aa752..31a9956d47 100644 --- a/stable/redis-ha/values.yaml +++ b/stable/redis-ha/values.yaml @@ -15,11 +15,30 @@ resources: limits: memory: 200Mi -## Node labels and tolerations for pod assignment +## Node labels, tolerations, and affinities for pod assignment ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity nodeSelector: {} tolerations: [] +sentinelAffinity: | + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app: {{ template "redis-ha.name" . }} + release: {{ .Release.Name | quote }} + component: sentinel + topologyKey: kubernetes.io/hostname +serverAffinity: | + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app: {{ template "redis-ha.name" . }} + release: {{ .Release.Name | quote }} + component: server + topologyKey: kubernetes.io/hostname ## Redis image version redis_image: quay.io/smile/redis:4.0.8r0