Add support for negated placement constraint (#1419)
This commit is contained in:
+2
-2
@@ -145,7 +145,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -297,7 +297,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
version: "3"
|
||||
services:
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- "6379"
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.hostname == machine
|
||||
- engine.labels.operatingsystem == ubuntu 14.04
|
||||
- node.labels.foo != bar
|
||||
- baz != qux
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "6379",
|
||||
"port": 6379,
|
||||
"targetPort": 6379
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "redis",
|
||||
"image": "redis",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 6379
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"affinity": {
|
||||
"nodeAffinity": {
|
||||
"requiredDuringSchedulingIgnoredDuringExecution": {
|
||||
"nodeSelectorTerms": [
|
||||
{
|
||||
"matchExpressions": [
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
},
|
||||
{
|
||||
"key": "beta.kubernetes.io/os",
|
||||
"operator": "In",
|
||||
"values": ["ubuntu 14.04"]
|
||||
},
|
||||
{
|
||||
"key": "foo",
|
||||
"operator": "NotIn",
|
||||
"values": ["bar"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "6379",
|
||||
"port": 6379,
|
||||
"targetPort": 6379
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
},
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"redis"
|
||||
],
|
||||
"from": {
|
||||
"kind": "ImageStreamTag",
|
||||
"name": "redis:latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"io.kompose.service": "redis"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "redis",
|
||||
"image": " ",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 6379
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"affinity": {
|
||||
"nodeAffinity": {
|
||||
"requiredDuringSchedulingIgnoredDuringExecution": {
|
||||
"nodeSelectorTerms": [
|
||||
{
|
||||
"matchExpressions": [
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
},
|
||||
{
|
||||
"key": "beta.kubernetes.io/os",
|
||||
"operator": "In",
|
||||
"values": ["ubuntu 14.04"]
|
||||
},
|
||||
{
|
||||
"key": "foo",
|
||||
"operator": "NotIn",
|
||||
"values": ["bar"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"latestVersion": 0,
|
||||
"observedGeneration": 0,
|
||||
"replicas": 0,
|
||||
"updatedReplicas": 0,
|
||||
"availableReplicas": 0,
|
||||
"unavailableReplicas": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"lookupPolicy": {
|
||||
"local": false
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "",
|
||||
"annotations": null,
|
||||
"from": {
|
||||
"kind": "DockerImage",
|
||||
"name": "redis"
|
||||
},
|
||||
"generation": null,
|
||||
"importPolicy": {},
|
||||
"referencePolicy": {
|
||||
"type": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"dockerImageRepository": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -289,7 +289,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -431,7 +431,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -573,7 +573,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -715,7 +715,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -431,7 +431,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -573,7 +573,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
@@ -715,7 +715,7 @@
|
||||
},
|
||||
"resources": {},
|
||||
"postCommit": {},
|
||||
"nodeSelector": null
|
||||
"affinity": null
|
||||
},
|
||||
"status": {
|
||||
"lastVersion": 0
|
||||
|
||||
@@ -19,6 +19,7 @@ services:
|
||||
constraints:
|
||||
- node.hostname == machine
|
||||
- engine.labels.operatingsystem == ubuntu 14.04
|
||||
- node.labels.foo != bar
|
||||
foo: # test labels
|
||||
labels:
|
||||
kompose.service.type: headless
|
||||
|
||||
+42
-5
@@ -77,9 +77,32 @@
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"nodeSelector": {
|
||||
"beta.kubernetes.io/os": "ubuntu 14.04",
|
||||
"kubernetes.io/hostname": "machine"
|
||||
"affinity": {
|
||||
"nodeAffinity": {
|
||||
"requiredDuringSchedulingIgnoredDuringExecution": {
|
||||
"nodeSelectorTerms": [
|
||||
{
|
||||
"matchExpressions": [
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
},
|
||||
{
|
||||
"key": "beta.kubernetes.io/os",
|
||||
"operator": "In",
|
||||
"values": ["ubuntu 14.04"]
|
||||
},
|
||||
{
|
||||
"key": "foo",
|
||||
"operator": "NotIn",
|
||||
"values": ["bar"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"restartPolicy": "Always",
|
||||
"serviceAccountName": "",
|
||||
@@ -182,8 +205,22 @@
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"nodeSelector": {
|
||||
"kubernetes.io/hostname": "machine"
|
||||
"affinity": {
|
||||
"nodeAffinity": {
|
||||
"requiredDuringSchedulingIgnoredDuringExecution": {
|
||||
"nodeSelectorTerms": [
|
||||
{
|
||||
"matchExpressions": [
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"restartPolicy": "Always",
|
||||
"serviceAccountName": "",
|
||||
|
||||
+42
-5
@@ -92,9 +92,32 @@
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"nodeSelector": {
|
||||
"beta.kubernetes.io/os": "ubuntu 14.04",
|
||||
"kubernetes.io/hostname": "machine"
|
||||
"affinity": {
|
||||
"nodeAffinity": {
|
||||
"requiredDuringSchedulingIgnoredDuringExecution": {
|
||||
"nodeSelectorTerms": [
|
||||
{
|
||||
"matchExpressions": [
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
},
|
||||
{
|
||||
"key": "beta.kubernetes.io/os",
|
||||
"operator": "In",
|
||||
"values": ["ubuntu 14.04"]
|
||||
},
|
||||
{
|
||||
"key": "foo",
|
||||
"operator": "NotIn",
|
||||
"values": ["bar"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,8 +357,22 @@
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"nodeSelector": {
|
||||
"kubernetes.io/hostname": "machine"
|
||||
"affinity": {
|
||||
"nodeAffinity": {
|
||||
"requiredDuringSchedulingIgnoredDuringExecution": {
|
||||
"nodeSelectorTerms": [
|
||||
{
|
||||
"matchExpressions": [
|
||||
{
|
||||
"key": "kubernetes.io/hostname",
|
||||
"operator": "In",
|
||||
"values": ["machine"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user