Browse Source

Adding headless service

Change-Id: Ie4ccbe0633d66468b722af872376e19141514580
Andrey Pavlov 2 years ago
parent
commit
50459c99aa
4 changed files with 12 additions and 2 deletions
  1. 6
    0
      doc/source/dsl.rst
  2. 1
    1
      fuel_ccp/__init__.py
  3. 2
    1
      fuel_ccp/deploy.py
  4. 3
    0
      fuel_ccp/validation/service.py

+ 6
- 0
doc/source/dsl.rst View File

@@ -14,6 +14,7 @@ Application definition template
14 14
         kind: DaemonSet
15 15
         ports:
16 16
             - internal-port:external-port
17
+        headless: true
17 18
         hostNetwork: true
18 19
         hostPID: true
19 20
         antiAffinity: local
@@ -120,6 +121,11 @@ service
120 121
      - false
121 122
      - boolean
122 123
      - false
124
+   * - headless
125
+     - Create headless service.
126
+     - false
127
+     - boolean
128
+     - false
123 129
    * - hostPID
124 130
      - Use the host’s pid namespace.
125 131
      - false

+ 1
- 1
fuel_ccp/__init__.py View File

@@ -17,4 +17,4 @@ import pbr.version
17 17
 
18 18
 version_info = pbr.version.VersionInfo("fuel_ccp")
19 19
 __version__ = version_info.version_string()
20
-dsl_version = "0.7.0"
20
+dsl_version = "0.8.0"

+ 2
- 1
fuel_ccp/deploy.py View File

@@ -248,7 +248,8 @@ def _process_ports(service):
248 248
                     service["name"], ingress_host, source_port))
249 249
     service_template = templates.serialize_service(
250 250
         service["name"], ports,
251
-        headless=service.get("kind") == "StatefulSet",
251
+        headless=service.get("kind") == "StatefulSet" or service.get(
252
+            "headless", False),
252 253
         annotations=service.get('annotations', {}).get('service'))
253 254
     yield service_template
254 255
 

+ 3
- 0
fuel_ccp/validation/service.py View File

@@ -257,6 +257,9 @@ SERVICE_SCHEMA = {
257 257
                 "kind": {
258 258
                     "enum": ["Deployment", "DaemonSet", "StatefulSet"]
259 259
                 },
260
+                "headless": {
261
+                    "type": "boolean"
262
+                },
260 263
                 "hostNetwork": {
261 264
                     "type": "boolean"
262 265
                 },

Loading…
Cancel
Save