Add plugin testing blueprints 93/111193/1
authorJack Lucas <jflos@sonoris.net>
Wed, 12 Aug 2020 15:30:41 +0000 (11:30 -0400)
committerJack Lucas <jflos@sonoris.net>
Wed, 12 Aug 2020 15:33:09 +0000 (11:33 -0400)
Issue-ID: DCAEGEN2-2352
Signed-off-by: Jack Lucas <jflos@sonoris.net>
Change-Id: Icacef912fc24d2814d513bd2df2a6aaed117ebb5

27 files changed:
k8s/plugin_testing_blueprints/blueprints/README.md [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-appconfig.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-bad.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-dmaap-dr-sub.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-dmaap-mr-pub.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-env.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-lifecycle-inputs.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-loc.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-log.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-nodeport.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-noports.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-override.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy-loc.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy-no-notify.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-script-bad.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-script.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-tls-client.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-tls-server.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc-udp.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/blueprints/nginx-svc.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/operations/README.md [new file with mode: 0644]
k8s/plugin_testing_blueprints/operations/policy_update-bad.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/operations/policy_update.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/operations/scaleto1.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/operations/scaleto3.yaml [new file with mode: 0644]
k8s/plugin_testing_blueprints/operations/update_image-1.15.yaml [new file with mode: 0644]

diff --git a/k8s/plugin_testing_blueprints/blueprints/README.md b/k8s/plugin_testing_blueprints/blueprints/README.md
new file mode 100644 (file)
index 0000000..560a51b
--- /dev/null
@@ -0,0 +1,21 @@
+# Blueprints for testing the DCAE Kubernetes plugin
+The blueprints in this directory are designed as test cases for the DCAE
+Kubernetes Cloudify plugin (`k8splugin`).  Each blueprint tests a single
+feature, or small set of features, supported by the plugin.
+
+The testing strategy here is simple and not very automated.  Deploying a DCAE
+component using a Cloudify blueprint typically has a number of effects (creating a
+Kubernetes deployment, creating a Kubernetes service, populating configuration information
+into Consul, mounting certain volumes on a container, and so forth).  For now at least, we use a
+manual process to verify that deployment has had the expected effects:
+- we use `kubectl` to checkthat the expected Kubernetes artifacts are created
+-  we look into Consul to see that the appropriateconfiguration information has been populated (including configuration information that comes
+from DMaaP and policy where the blueprint calls for it)
+- we `kubectl exec` into the container to verify that the expected environment variables have been set and the expected volumes are mounted and have the correct content
+
+All of the blueprints deploy the `nginx` image from the public Docker Hub.  The blueprints
+will generally deploy the `nginx` Web server so that it serves the default Web page on port 80
+of the container and on a NodePort if the blueprint specifies an external port address.
+Some of the blueprints set up TLS.  The expected result is that the appropriate directories
+will be created and will hold the TLS artifacts.   We don't actually configure `nginx` to use
+TLS.
\ No newline at end of file
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-appconfig.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-appconfig.yaml
new file mode 100644 (file)
index 0000000..4373680
--- /dev/null
@@ -0,0 +1,32 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Set nested application configuration
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        application_config:
+          prop1: "val1"
+          prop2: 1434
+          prop3: ["a", "b", "c"]
+          prop4:
+            prop4a:
+              prop4a1: "val4a1"
+              prop4a2: 4343
+              prop4a3: ["x", "y", "z"]
+            prop4b: "val4b"
+        docker_config:
+            healthcheck:
+              type: "http"
+              endpoint: "/"
+            ports:
+              - '80:0'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-bad.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-bad.yaml
new file mode 100644 (file)
index 0000000..2b51650
--- /dev/null
@@ -0,0 +1,30 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Fails because nginx port (80) isn't exposed and health check fails\r
+  max_wait set to 120 so timeout occurs quickly\r
+  expect k8s service/deployment to be created, pod started\r
+  but plugin will clean up k8s after timeout\r
+\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+\r
+node_templates:\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+      service_component_type: 'nginx-web'\r
+      image: nginx\r
+      docker_config:\r
+        healthcheck:\r
+          type: "http"\r
+          endpoint: "/"\r
+        ports:\r
+          - '20880:0'\r
+    interfaces:\r
+      cloudify.interfaces.lifecycle:\r
+        start:\r
+          inputs:\r
+            max_wait: 120\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-dmaap-dr-sub.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-dmaap-dr-sub.yaml
new file mode 100644 (file)
index 0000000..1bbbf34
--- /dev/null
@@ -0,0 +1,41 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Creates DR feed and sets up component as subscriber
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:dmaap?version=1.5.0
+  - plugin:k8splugin?version=3.0.0
+node_templates:
+  feed00:
+    type: dcaegen2.nodes.Feed
+    properties:
+      feed_name: feed-000
+      feed_version: 2.0.0
+
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        docker_config:
+          ports:
+            - "80:0"
+            - "443:0"
+          healthcheck:
+            type: "http"
+            endpoint: "/"
+        streams_subscribes:
+          - name: feed00
+            type: data_router
+            location: san-francisco
+            username: fred
+            password: fredzW0rd
+            route: app
+            scheme: http
+
+    relationships:
+      - type: dcaegen2.relationships.subscribe_to_files
+        target: feed00
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-dmaap-mr-pub.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-dmaap-mr-pub.yaml
new file mode 100644 (file)
index 0000000..177598c
--- /dev/null
@@ -0,0 +1,36 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Create MR topic and set up component as subscriber
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+  - plugin:dmaap?version=1.5.0
+
+node_templates:
+  topic00:
+    type: dcaegen2.nodes.Topic
+    properties:
+      topic_name: topic-002
+
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
+    properties:
+      service_component_type: 'nginx-web'
+      image: nginx
+      docker_config:
+        healthcheck:
+          type: "http"
+          endpoint: "/"
+        ports:
+          - '80:0'
+      streams_publishes:
+        - name: topic00
+          location: san-francisco
+          client_role: org.onap.dmaap.mr.topic-002.publisher
+
+    relationships:
+      - type: dcaegen2.relationships.publish_events
+        target: topic00
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-env.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-env.yaml
new file mode 100644 (file)
index 0000000..b9e3fae
--- /dev/null
@@ -0,0 +1,25 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Set environment variables
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        docker_config:
+          healthcheck:
+            type: "http"
+            endpoint: "/"
+          ports:
+            - '80:0'
+          envs:
+            MY_ENV1: value1
+            MY_ENV0: value0
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-lifecycle-inputs.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-lifecycle-inputs.yaml
new file mode 100644 (file)
index 0000000..61c9de4
--- /dev/null
@@ -0,0 +1,29 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Set ports and envs via input to lifecycle operation
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+      service_component_type: 'nginx-web'
+      image: nginx
+      docker_config:
+        healthcheck:
+          type: "http"
+          endpoint: "/"
+    interfaces:
+      cloudify.interfaces.lifecycle:
+        start:
+          inputs:
+            ports:
+              - '80:0'
+            envs:
+              MY_ENV1: value1
+              MY_ENV0: value0
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-loc.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-loc.yaml
new file mode 100644 (file)
index 0000000..e1863c6
--- /dev/null
@@ -0,0 +1,30 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Specify a location  (need to set up a multi-site configuration)
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        location_id: gallus
+        image: nginx
+        docker_config:
+            healthcheck:
+                type: "http"
+                endpoint: "/"
+            policy:
+                trigger_type: "docker"
+                script_path: "/notify.sh"
+    interfaces:
+      cloudify.interfaces.lifecycle:
+        start:
+          inputs:
+            ports:
+              - '80:0'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-log.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-log.yaml
new file mode 100644 (file)
index 0000000..61dc274
--- /dev/null
@@ -0,0 +1,24 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Specifies a log directory--expect logging sidecar to be deployed
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        log_info:
+          log_directory: "/opt/logs"
+        docker_config:
+            healthcheck:
+              type: "http"
+              endpoint: "/"
+            ports:
+              - '80:0'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-nodeport.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-nodeport.yaml
new file mode 100644 (file)
index 0000000..c22a96b
--- /dev/null
@@ -0,0 +1,22 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Exposes port as a NodePort service
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        docker_config:
+            healthcheck:
+              type: "http"
+              endpoint: "/"
+            ports:
+              - '80:30580'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-noports.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-noports.yaml
new file mode 100644 (file)
index 0000000..bf93df4
--- /dev/null
@@ -0,0 +1,20 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Don't specify any ports -- expect no k8s Service to be created
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+      service_component_type: 'nginx-web'
+      image: nginx
+      docker_config:
+        healthcheck:
+          type: "script"
+          script: "/bin/true"
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-override.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-override.yaml
new file mode 100644 (file)
index 0000000..fdaf1b0
--- /dev/null
@@ -0,0 +1,23 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Override service component name
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        service_component_name_override: 'dcae-web-server'
+        image: nginx
+        docker_config:
+          healthcheck:
+            type: "http"
+            endpoint: "/"
+          ports:
+            - '80:0'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy-loc.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy-loc.yaml
new file mode 100644 (file)
index 0000000..c09b610
--- /dev/null
@@ -0,0 +1,41 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Policy and location specified.  Need a multi-site configuration.\r
+\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+  - plugin:dcaepolicyplugin?version=2.4.0\r
+\r
+node_templates:\r
+\r
+  a_policy:\r
+    type: dcae.nodes.policy\r
+    properties:\r
+      policy_id: org.onap.policy007\r
+      policy_required: false\r
+\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+        service_component_type: 'nginx-web'\r
+        image: nginx\r
+        location_id: jfldub\r
+        docker_config:\r
+            healthcheck:\r
+                type: "http"\r
+                endpoint: "/"\r
+            policy:\r
+                trigger_type: "docker"\r
+                script_path: "echo"\r
+    interfaces:\r
+      cloudify.interfaces.lifecycle:\r
+        start:\r
+          inputs:\r
+            ports:\r
+              - '80:0'\r
+    relationships:\r
+      - type: cloudify.relationships.depends_on\r
+        target: a_policy\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy-no-notify.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy-no-notify.yaml
new file mode 100644 (file)
index 0000000..7ae6c36
--- /dev/null
@@ -0,0 +1,36 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Component gets config from policy, but we don't require a_policy\r
+  to be configured in the policy system.  Expect to see policy\r
+  plugin pulling empty policy from DCAE policy handler.\r
+  This version does not set up a script that would run when\r
+  a policy is updated.\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+  - plugin:dcaepolicyplugin?version=2.4.0\r
+\r
+node_templates:\r
+\r
+  a_policy:\r
+    type: dcae.nodes.policy\r
+    properties:\r
+      policy_id: org.onap.policy007\r
+      policy_required: false\r
+\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+      service_component_type: 'nginx-web'\r
+      image: nginx\r
+      docker_config:\r
+        healthcheck:\r
+          type: "http"\r
+          endpoint: "/"\r
+        ports:\r
+          - '80:0'\r
+    relationships:\r
+      - type: cloudify.relationships.depends_on\r
+        target: a_policy\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-policy.yaml
new file mode 100644 (file)
index 0000000..d8bde75
--- /dev/null
@@ -0,0 +1,39 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Component gets config from policy, but we don't require a_policy\r
+  to be configured in the policy system.  Expect to see policy\r
+  plugin pulling empty policy from DCAE policy handler.\r
+\r
+\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+  - plugin:dcaepolicyplugin?version=2.4.0\r
+\r
+node_templates:\r
+\r
+  a_policy:\r
+    type: dcae.nodes.policy\r
+    properties:\r
+      policy_id: org.onap.policy007\r
+      policy_required: false\r
+\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+      service_component_type: 'nginx-web'\r
+      image: nginx\r
+      docker_config:\r
+        healthcheck:\r
+          type: "http"\r
+          endpoint: "/"\r
+        policy:\r
+          trigger_type: "docker"\r
+          script_path: "echo"\r
+        ports:\r
+          - '80:0'\r
+    relationships:\r
+      - type: cloudify.relationships.depends_on\r
+        target: a_policy\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-script-bad.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-script-bad.yaml
new file mode 100644 (file)
index 0000000..d080fd7
--- /dev/null
@@ -0,0 +1,30 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Fails because healthcheck script always returns failure\r
+  max_wait set to 120 so timeout occurs quickly\r
+  expect k8s service/deployment to be created, pod started\r
+  but plugin will clean up k8s after timeout\r
+\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+\r
+node_templates:\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+      service_component_type: 'nginx-web'\r
+      image: nginx\r
+      docker_config:\r
+        healthcheck:\r
+          type: "script"\r
+          script: "/bin/false"\r
+        ports:\r
+          - '80:0'\r
+    interfaces:\r
+      cloudify.interfaces.lifecycle:\r
+        start:\r
+          inputs:\r
+            max_wait: 120\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-script.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-script.yaml
new file mode 100644 (file)
index 0000000..97306d3
--- /dev/null
@@ -0,0 +1,22 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Use a script for the healthcheck\r
+\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+\r
+node_templates:\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+        service_component_type: 'nginx-web'\r
+        image: nginx\r
+        docker_config:\r
+            healthcheck:\r
+              type: "script"\r
+              script: "/bin/true"\r
+            ports:\r
+              - '80:0'\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-tls-client.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-tls-client.yaml
new file mode 100644 (file)
index 0000000..02e61ee
--- /dev/null
@@ -0,0 +1,25 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Put CA cert in non-default directory
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        tls_info:
+          use_tls: false
+          cert_directory: "/opt/altcert"
+        docker_config:
+          healthcheck:
+            type: "http"
+            endpoint: "/"
+          ports:
+            - '80:0'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-tls-server.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-tls-server.yaml
new file mode 100644 (file)
index 0000000..aefc0af
--- /dev/null
@@ -0,0 +1,27 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+  Put full certificate materials in non-default location
+  (Note that we don't configure nginx to actually use the
+  certificate.  This test just installs the certificate.)
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+      service_component_type: 'nginx-web'
+      image: nginx
+      tls_info:
+        use_tls: true
+        cert_directory: "/opt/altcert"
+      docker_config:
+        healthcheck:
+          type: "http"
+          endpoint: "/"
+        ports:
+          - '80:0'
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc-udp.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc-udp.yaml
new file mode 100644 (file)
index 0000000..3eb3019
--- /dev/null
@@ -0,0 +1,26 @@
+tosca_definitions_version: cloudify_dsl_1_3\r
+\r
+description: >\r
+  Simple blueprint to launch nginx as a "service component"\r
+  Create UDP ports, test /tcp, /udp syntax\r
+\r
+imports:\r
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml\r
+  - plugin:k8splugin?version=3.0.0\r
+\r
+node_templates:\r
+  web_server:\r
+    type: dcae.nodes.ContainerizedServiceComponent\r
+    properties:\r
+      service_component_type: 'nginx-web'\r
+      image: nginx\r
+      docker_config:\r
+        healthcheck:\r
+          type: "http"\r
+          endpoint: "/"\r
+        ports:\r
+          - '80:0'\r
+          - '9191/tcp:0'\r
+          - '1919:0'\r
+          - '1919/udp:0'\r
+          - '2060/udp:31060'\r
diff --git a/k8s/plugin_testing_blueprints/blueprints/nginx-svc.yaml b/k8s/plugin_testing_blueprints/blueprints/nginx-svc.yaml
new file mode 100644 (file)
index 0000000..98078b7
--- /dev/null
@@ -0,0 +1,21 @@
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  Simple blueprint to launch nginx as a "service component"
+
+imports:
+  - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+  - plugin:k8splugin?version=3.0.0
+
+node_templates:
+  web_server:
+    type: dcae.nodes.ContainerizedServiceComponent
+    properties:
+        service_component_type: 'nginx-web'
+        image: nginx
+        docker_config:
+            healthcheck:
+              type: "http"
+              endpoint: "/"
+            ports:
+              - '80:0'
diff --git a/k8s/plugin_testing_blueprints/operations/README.md b/k8s/plugin_testing_blueprints/operations/README.md
new file mode 100644 (file)
index 0000000..895427d
--- /dev/null
@@ -0,0 +1,14 @@
+# Parameter Files for Testing Operations
+The k8s plugin supports some operations beyond just installation and uninstallation:
+- `scale`: change the number of replicas of component
+- `update_image`: change the Docker image used for the component
+- `policy_update`: update a component's configuration in Consul and notify the component of the change
+
+The files in this directory contain parameters for testing the additional operations.
+The specific values in the files are tied to values in the blueprints in the `../blueprints` directory.
+
+## Invoking an operation
+Invoking the operations here involves running the Cloudify `execute_operation` workflow.
+
+   `cfy executions start -p `_/path/to/operation_file_`  -d  `_name_of_cloudify_deployment_` execute_operation`
+
diff --git a/k8s/plugin_testing_blueprints/operations/policy_update-bad.yaml b/k8s/plugin_testing_blueprints/operations/policy_update-bad.yaml
new file mode 100644 (file)
index 0000000..29b5bc3
--- /dev/null
@@ -0,0 +1,11 @@
+operation: dcae.interfaces.policy.policy_update
+operation_kwargs:
+  updated_policies:
+    - policy_id:  org.onap.policy008
+      policy_body:
+        policyVersion: "1463"
+        policyName: "org.onap.policy007.1463.xml"
+        config: {"type": "NoParking", "start": "0100", "end": "0630"}
+node_ids:
+  - "web_server"
+allow_kwargs_override: true
diff --git a/k8s/plugin_testing_blueprints/operations/policy_update.yaml b/k8s/plugin_testing_blueprints/operations/policy_update.yaml
new file mode 100644 (file)
index 0000000..ef91df2
--- /dev/null
@@ -0,0 +1,11 @@
+operation: dcae.interfaces.policy.policy_update
+operation_kwargs:
+  updated_policies:
+    - policy_id:  org.onap.policy007
+      policy_body:
+        policyVersion: "1463"
+        policyName: "org.onap.policy007.1463.xml"
+        config: {"type": "NoParking", "start": "0100", "end": "0630"}
+node_ids:
+  - "web_server"
+allow_kwargs_override: true
diff --git a/k8s/plugin_testing_blueprints/operations/scaleto1.yaml b/k8s/plugin_testing_blueprints/operations/scaleto1.yaml
new file mode 100644 (file)
index 0000000..1cbe4a2
--- /dev/null
@@ -0,0 +1,5 @@
+operation: scale
+operation_kwargs:
+  replicas: 1
+node_ids:
+  - "web_server"
diff --git a/k8s/plugin_testing_blueprints/operations/scaleto3.yaml b/k8s/plugin_testing_blueprints/operations/scaleto3.yaml
new file mode 100644 (file)
index 0000000..e188225
--- /dev/null
@@ -0,0 +1,5 @@
+operation: scale
+operation_kwargs:
+  replicas: 3
+node_ids:
+  - "web_server"
diff --git a/k8s/plugin_testing_blueprints/operations/update_image-1.15.yaml b/k8s/plugin_testing_blueprints/operations/update_image-1.15.yaml
new file mode 100644 (file)
index 0000000..27a2c22
--- /dev/null
@@ -0,0 +1,5 @@
+operation: update_image
+operation_kwargs:
+  image: nginx:1.15
+node_ids:
+  - "web_server"