Introduce hard antiAffinity and simplify config using matchLabels instead of matchExpressions (#1629)

This commit is contained in:
Dhilip
2017-08-07 18:30:12 +01:00
committed by Adnan Abdulhussein
parent e002378c13
commit 4f1e2ea355
3 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: memcached
version: 1.1.0
version: 1.2.0
description: Free & open source, high-performance, distributed memory object caching system.
keywords:
- memcached
+13 -6
View File
@@ -20,16 +20,23 @@ spec:
spec:
affinity:
podAntiAffinity:
{{- if eq .Values.AntiAffinity "hard" }}
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
app: {{ template "fullname" . }}
release: {{ .Release.Name | quote }}
{{- else if eq .Values.AntiAffinity "soft" }}
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 5
podAffinityTerm:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- "{{ template "fullname" . }}"
topologyKey: "kubernetes.io/hostname"
matchLabels:
app: {{ template "fullname" . }}
release: {{ .Release.Name | quote }}
{{- end }}
containers:
- name: {{ template "fullname" . }}
image: {{ .Values.image }}
+3
View File
@@ -12,6 +12,9 @@ image: memcached:1.4.36-alpine
##Replica count
replicaCount: 3
## Select AnitAffinity as either hard or soft, default is hard
AntiAffinity: "hard"
memcached:
## Various values that get set as command-line flags.