Use k8s 1.6 syntax of declaring affinity
K8s 1.6 has affinity/antiaffinity funtionalities as a beta feature. This means we don't need to declare them using annotations. This commit switches usages of affinity to 1.6 syntax. Change-Id: Ia68f4ab28a018617bd44b1295fea58cd30eb4a39
This commit is contained in:
parent
349da76076
commit
a6cd9bac16
@ -29,27 +29,21 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: ceph
|
app: ceph
|
||||||
daemon: mon
|
daemon: mon
|
||||||
annotations:
|
|
||||||
# alanmeadows: this soft requirement allows single
|
|
||||||
# host deployments to spawn several ceph-mon
|
|
||||||
# containers
|
|
||||||
scheduler.alpha.kubernetes.io/affinity: >
|
|
||||||
{
|
|
||||||
"podAntiAffinity": {
|
|
||||||
"preferredDuringSchedulingIgnoredDuringExecution": [{
|
|
||||||
"labelSelector": {
|
|
||||||
"matchExpressions": [{
|
|
||||||
"key": "daemon",
|
|
||||||
"operator": "In",
|
|
||||||
"values":["mon"]
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
"topologyKey": "kubernetes.io/hostname",
|
|
||||||
"weight": 10
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spec:
|
spec:
|
||||||
|
# alanmeadows: this soft requirement allows single
|
||||||
|
# host deployments to spawn several ceph-mon
|
||||||
|
# containers
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values: ["mon"]
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
weight: 10
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
||||||
serviceAccount: default
|
serviceAccount: default
|
||||||
|
@ -84,24 +84,19 @@ single host environment:
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
annotations:
|
# alanmeadows: this soft requirement allows single
|
||||||
# this soft requirement allows single
|
# host deployments to spawn several mariadb containers
|
||||||
# host deployments to spawn several mariadb containers
|
# but in a larger environment, would attempt to spread
|
||||||
# but in a larger environment, would attempt to spread
|
# them out
|
||||||
# them out
|
affinity:
|
||||||
scheduler.alpha.kubernetes.io/affinity: >
|
podAntiAffinity:
|
||||||
{
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
"podAntiAffinity": {
|
- podAffinityTerm:
|
||||||
"preferredDuringSchedulingIgnoredDuringExecution": [{
|
labelSelector:
|
||||||
"labelSelector": {
|
matchExpressions:
|
||||||
"matchExpressions": [{
|
- key: app
|
||||||
"key": "app",
|
operator: In
|
||||||
"operator": "In",
|
values: ["mariadb"]
|
||||||
"values":["mariadb"]
|
topologyKey: kubernetes.io/hostname
|
||||||
}]
|
weight: 10
|
||||||
},
|
|
||||||
"topologyKey": "kubernetes.io/hostname",
|
|
||||||
"weight": 10
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -25,28 +25,22 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: {{ .Values.service_name }}
|
app: {{ .Values.service_name }}
|
||||||
galera: enabled
|
galera: enabled
|
||||||
annotations:
|
|
||||||
# alanmeadows: this soft requirement allows single
|
|
||||||
# host deployments to spawn several mariadb containers
|
|
||||||
# but in a larger environment, would attempt to spread
|
|
||||||
# them out
|
|
||||||
scheduler.alpha.kubernetes.io/affinity: >
|
|
||||||
{
|
|
||||||
"podAntiAffinity": {
|
|
||||||
"preferredDuringSchedulingIgnoredDuringExecution": [{
|
|
||||||
"labelSelector": {
|
|
||||||
"matchExpressions": [{
|
|
||||||
"key": "app",
|
|
||||||
"operator": "In",
|
|
||||||
"values":["mariadb"]
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
"topologyKey": "kubernetes.io/hostname",
|
|
||||||
"weight": 10
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spec:
|
spec:
|
||||||
|
# alanmeadows: this soft requirement allows single
|
||||||
|
# host deployments to spawn several mariadb containers
|
||||||
|
# but in a larger environment, would attempt to spread
|
||||||
|
# them out
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values: ["mariadb"]
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
weight: 10
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
||||||
containers:
|
containers:
|
||||||
|
@ -35,24 +35,19 @@ spec:
|
|||||||
annotations:
|
annotations:
|
||||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||||
# TODO: this needs to be moved to common.
|
|
||||||
scheduler.alpha.kubernetes.io/affinity: >
|
|
||||||
{
|
|
||||||
"podAntiAffinity": {
|
|
||||||
"preferredDuringSchedulingIgnoredDuringExecution": [{
|
|
||||||
"labelSelector": {
|
|
||||||
"matchExpressions": [{
|
|
||||||
"key": "app",
|
|
||||||
"operator": "In",
|
|
||||||
"values":["rabbitmq"]
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
"topologyKey": "kubernetes.io/hostname",
|
|
||||||
"weight": 10
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spec:
|
spec:
|
||||||
|
# TODO: this needs to be moved to common.
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values: ["rabbitmq"]
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
weight: 10
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
||||||
volumes:
|
volumes:
|
||||||
|
Loading…
Reference in New Issue
Block a user