Merge "Changing "daemonset" flag in service def to "kind" param"

This commit is contained in:
Jenkins 2016-10-25 20:35:27 +00:00 committed by Gerrit Code Review
commit 6cff14568f
3 changed files with 24 additions and 22 deletions

View File

@ -11,9 +11,9 @@ Application definition template
service:
name: service-name
kind: DaemonSet
ports:
- internal-port:external-port
daemonset: true
host-net: true
hostPID: true
containers:
@ -77,24 +77,26 @@ Parameters description
**service**
+---------------+-----------------------------------------------+----------+------------------+---------+
| Name | Description | Required | Schema | Default |
+===============+===============================================+==========+==================+=========+
| name | Name of the service. | true | string | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| containers | List of containers under multi-container pod | true | container_ array | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| ports | k8s Service will be created if specified | false | internal-port: | |
| | (with NodePort type for now) | | external-port | |
| | Only internal or both internal:external ports | | array | |
| | can be specified | | | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| daemonset | Create DaemonSet instead of Deployment | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+---------+
| host-net | Use the hosts network namespace | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+---------+
| hostPID | Use the hosts pid namespace | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+---------+
+---------------+-----------------------------------------------+----------+------------------+------------+
| Name | Description | Required | Schema | Default |
+===============+===============================================+==========+==================+============+
| name | Name of the service. | true | string | |
+---------------+-----------------------------------------------+----------+------------------+------------+
| kind | Kind of k8s object to use for containers | false | one of: | Deployment |
| | deployment | | ["Deployment", | |
| | | | "Daemonset"] | |
+---------------+-----------------------------------------------+----------+------------------+------------+
| containers | List of containers under multi-container pod | true | container_ array | |
+---------------+-----------------------------------------------+----------+------------------+------------+
| ports | k8s Service will be created if specified | false | internal-port: | |
| | (with NodePort type for now) | | external-port | |
| | Only internal or both internal:external ports | | array | |
| | can be specified | | | |
+---------------+-----------------------------------------------+----------+------------------+------------+
| host-net | Use the hosts network namespace | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+------------+
| hostPID | Use the hosts pid namespace | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+------------+
.. _container:

View File

@ -98,7 +98,7 @@ def parse_role(component, topology, configmaps):
affinity = templates.serialize_affinity(service, topology)
replicas = CONF.replicas.get(service_name)
if service.get("daemonset", False):
if service.get("kind") == 'DaemonSet':
if replicas is not None:
LOG.error("Replicas was specified for %s, but it's implemented "
"using Kubernetes DaemonSet that will deploy service on "

View File

@ -138,8 +138,8 @@ SERVICE_SCHEMA = {
]
}
},
"daemonset": {
"type": "boolean"
"kind": {
"enum": ["Deployment", "DaemonSet"]
},
"host-net": {
"type": "boolean"