forked from LaconicNetwork/kompose
Add support for placement preferences docker-compose v3.3+ (#1425)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
version: "3"
|
||||
version: "3.3"
|
||||
services:
|
||||
redis:
|
||||
image: redis
|
||||
@@ -10,4 +10,8 @@ services:
|
||||
- node.hostname == machine
|
||||
- engine.labels.operatingsystem == ubuntu 14.04
|
||||
- node.labels.foo != bar
|
||||
- baz != qux
|
||||
- baz != qux
|
||||
preferences:
|
||||
- spread: node.labels.zone
|
||||
- spread: foo
|
||||
- spread: node.labels.ssd
|
||||
@@ -76,24 +76,52 @@
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
"values": [
|
||||
"machine"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "beta.kubernetes.io/os",
|
||||
"key": "kubernetes.io/os",
|
||||
"operator": "In",
|
||||
"values": ["ubuntu 14.04"]
|
||||
"values": [
|
||||
"ubuntu 14.04"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "foo",
|
||||
"operator": "NotIn",
|
||||
"values": ["bar"]
|
||||
"values": [
|
||||
"bar"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"topologySpreadConstraints": [
|
||||
{
|
||||
"maxSkew": 2,
|
||||
"topologyKey": "zone",
|
||||
"whenUnsatisfiable": "ScheduleAnyway",
|
||||
"labelSelector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"maxSkew": 1,
|
||||
"topologyKey": "ssd",
|
||||
"whenUnsatisfiable": "ScheduleAnyway",
|
||||
"labelSelector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
|
||||
@@ -96,24 +96,52 @@
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
"values": [
|
||||
"machine"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "beta.kubernetes.io/os",
|
||||
"key": "kubernetes.io/os",
|
||||
"operator": "In",
|
||||
"values": ["ubuntu 14.04"]
|
||||
"values": [
|
||||
"ubuntu 14.04"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "foo",
|
||||
"operator": "NotIn",
|
||||
"values": ["bar"]
|
||||
"values": [
|
||||
"bar"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"topologySpreadConstraints": [
|
||||
{
|
||||
"maxSkew": 2,
|
||||
"topologyKey": "zone",
|
||||
"whenUnsatisfiable": "ScheduleAnyway",
|
||||
"labelSelector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"maxSkew": 1,
|
||||
"topologyKey": "ssd",
|
||||
"whenUnsatisfiable": "ScheduleAnyway",
|
||||
"labelSelector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user