summaryrefslogtreecommitdiffstats
path: root/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml')
-rw-r--r--tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml37
1 files changed, 33 insertions, 4 deletions
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