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.yaml80
1 files changed, 80 insertions, 0 deletions
diff --git a/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml b/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml
new file mode 100644
index 0000000..bdfa80c
--- /dev/null
+++ b/tools/cloudify/blueprints/k8s-hello-world/blueprint.yaml
@@ -0,0 +1,80 @@
+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
+
+imports:
+ - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
+ - https://raw.githubusercontent.com/cloudify-incubator/cloudify-kubernetes-plugin/1.2.1/plugin.yaml
+
+inputs:
+
+ kubernetes_configuration_file_content:
+ default: kube.config
+
+ kubernetes_master_ip:
+ type: string
+ default: { get_secret: kubernetes_master_ip }
+
+ kubernetes_master_port:
+ type: string
+ default: { get_secret: kubernetes_master_port }
+
+ kubernetes_certificate_authority_data:
+ default: { get_secret: kubernetes_certificate_authority_data }
+
+ kubernetes-admin_client_certificate_data:
+ default: { get_secret: kubernetes-admin_client_certificate_data }
+
+ kubernetes-admin_client_key_data:
+ default: { get_secret: kubernetes-admin_client_key_data }
+
+ kubernetes_master_configuration:
+ default:
+ apiVersion: v1
+ kind: Config
+ preferences: {}
+ current-context: kubernetes-admin@kubernetes
+ clusters:
+ - name: kubernetes
+ cluster:
+ certificate-authority-data: { get_input: kubernetes_certificate_authority_data }
+ server: { concat: [ 'https://', { get_input: kubernetes_master_ip}, ':', { get_input: kubernetes_master_port } ] }
+ contexts:
+ - name: kubernetes-admin@kubernetes
+ context:
+ cluster: kubernetes
+ user: kubernetes-admin
+ users:
+ - name: kubernetes-admin
+ user:
+ client-certificate-data: { get_input: kubernetes-admin_client_certificate_data }
+ client-key-data: { get_input: kubernetes-admin_client_key_data }
+
+ kubernetes_configuration_file_content:
+ description: >
+ File content of kubernetes master YAML configuration
+ default: { get_input: kubernetes_master_configuration }
+
+node_templates:
+ master:
+ type: cloudify.kubernetes.nodes.Master
+ properties:
+ configuration:
+ file_content: { get_input: kubernetes_configuration_file_content }
+
+# Following part based upon http://docs.getcloudify.org/4.1.0/plugins/kubernetes/
+ nginx_pod:
+ type: cloudify.kubernetes.resources.Pod
+ properties:
+ definition:
+ apiVersion: v1
+ metadata:
+ name: nginx
+ spec:
+ containers:
+ - name: nginx
+ image: nginx:1.7.9
+ ports:
+ - containerPort: 80
+ relationships:
+ - type: cloudify.kubernetes.relationships.managed_by_master
+ target: master