From 6b4f4a7389915f69d268f13d151bd32d39e8e23c Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Tue, 7 Nov 2017 15:54:47 -0800 Subject: Add cloudify API method for demo start/stop JIRA: MODELS-2 more bug fixes Change-Id: Ic617fd5ca030eed0beb850f97f54fa213fee87e3 Signed-off-by: Bryan Sullivan --- .../blueprints/k8s-hello-world/blueprint.yaml | 37 +++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'tools/cloudify/blueprints/k8s-hello-world') diff --git a/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml b/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml index bdfa80c..bdbba8c 100644 --- a/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml +++ b/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml @@ -1,5 +1,7 @@ tosca_definitions_version: cloudify_dsl_1_3 -# Following part based upon https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/blob/master/examples/simple-blueprint-defined-resource.yaml +# Based upon +# https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/blob/master/examples/simple-blueprint-defined-resource.yaml +# https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/blob/1.2.0/examples/example-blueprint.yaml imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml @@ -7,6 +9,12 @@ imports: inputs: + spec_port: + default: 80 + + container_port: + default: 80 + kubernetes_configuration_file_content: default: kube.config @@ -55,12 +63,31 @@ inputs: default: { get_input: kubernetes_master_configuration } node_templates: - master: + kubernetes_master: type: cloudify.kubernetes.nodes.Master properties: configuration: file_content: { get_input: kubernetes_configuration_file_content } + nginx_service: + type: cloudify.kubernetes.resources.Service + properties: + definition: + apiVersion: v1 + metadata: + name: nginx-service + spec: + type: NodePort + ports: + - port: { get_input: spec_port } + selector: + app: nginx + relationships: + - type: cloudify.kubernetes.relationships.managed_by_master + target: kubernetes_master + - type: cloudify.relationships.depends_on + target: nginx_pod + # Following part based upon http://docs.getcloudify.org/4.1.0/plugins/kubernetes/ nginx_pod: type: cloudify.kubernetes.resources.Pod @@ -69,12 +96,14 @@ node_templates: apiVersion: v1 metadata: name: nginx + labels: + app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - - containerPort: 80 + - containerPort: { get_input: container_port } relationships: - type: cloudify.kubernetes.relationships.managed_by_master - target: master + target: kubernetes_master -- cgit 1.2.3-korg