Basic updates of k8s resources

* no new commands/flags implemented - if object already exists,
it will be updated
* only Deployment, ConfigMap, Service can be updated
* if deployment spec was not updated, but related configmaps were,
deployment will be updated
* deployments will be updated with RollingUpdate strategy

Change-Id: If8fe78d6bea95b11d87f243cadc79490736745e7
This commit is contained in:
Andrey Pavlov
2016-09-13 13:59:11 +03:00
parent a069ddb9ac
commit 6a864bb4ba
7 changed files with 76 additions and 48 deletions

View File

@@ -98,7 +98,11 @@ def serialize_daemon_container_spec(container):
"command": _get_readiness_cmd(container["name"])
},
"timeoutSeconds": 1
}
},
"env": [{
"name": "CM_VERSION",
"value": container['cm_version']
}]
}
if container.get("probes", {}).get("liveness"):
cont_spec["livenessProbe"] = {
@@ -265,6 +269,12 @@ def serialize_deployment(name, spec, affinity):
},
"spec": {
"replicas": 1,
"strategy": {
"rollingUpdate": {
"maxSurge": 1,
"maxUnavailable": 0
}
},
"template": {
"metadata": {
"annotations": affinity,