Changing "daemonset" flag in service def to "kind" param
We want to alling with k8s definitions and it would be more convenient to have one param instead of several flags. Change-Id: I2db5a09dba5af508ad0f40f3c17ab22395e86576 Depends-On: I378f7fd3e89ac12e9f6d16fca3591d09ff33d4f9 Depends-On: Iecff0370dbec342779b0d07a96b84a196522ca77 Depends-On: I44b62597413322846c1ac538df860175ba560956
This commit is contained in:
parent
f6ae9c6884
commit
6885730b6e
|
@ -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 host’s network namespace | false | boolean | false |
|
||||
+---------------+-----------------------------------------------+----------+------------------+---------+
|
||||
| hostPID | Use the host’s 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 host’s network namespace | false | boolean | false |
|
||||
+---------------+-----------------------------------------------+----------+------------------+------------+
|
||||
| hostPID | Use the host’s pid namespace | false | boolean | false |
|
||||
+---------------+-----------------------------------------------+----------+------------------+------------+
|
||||
|
||||
.. _container:
|
||||
|
||||
|
|
|
@ -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 "
|
||||
|
|
|
@ -138,8 +138,8 @@ SERVICE_SCHEMA = {
|
|||
]
|
||||
}
|
||||
},
|
||||
"daemonset": {
|
||||
"type": "boolean"
|
||||
"kind": {
|
||||
"enum": ["Deployment", "DaemonSet"]
|
||||
},
|
||||
"host-net": {
|
||||
"type": "boolean"
|
||||
|
|
Loading…
Reference in New Issue