From da9564a9b0b78bbe341de9b039aab3c378eb027f Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Mon, 22 Jan 2018 15:25:53 -0800 Subject: Implement component deployment via cloudify JIRA: VES-2 Change-Id: Ic696f13d2a32e10663f50cd4e26b9a060525ff92 Signed-off-by: Bryan Sullivan --- tools/cloudify/ves-grafana/blueprint.yaml | 123 ++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 tools/cloudify/ves-grafana/blueprint.yaml (limited to 'tools/cloudify/ves-grafana/blueprint.yaml') diff --git a/tools/cloudify/ves-grafana/blueprint.yaml b/tools/cloudify/ves-grafana/blueprint.yaml new file mode 100644 index 0000000..00963b3 --- /dev/null +++ b/tools/cloudify/ves-grafana/blueprint.yaml @@ -0,0 +1,123 @@ +tosca_definitions_version: cloudify_dsl_1_3 +# +# Copyright 2018 AT&T Intellectual Property, Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# What this is: Cloudify blueprint for running a grafana service for OPNFV VES +# under kubernetes. + +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: + + spec_port: + default: 3000 + + container_port: + default: 3000 + + 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: + kubernetes_master: + type: cloudify.kubernetes.nodes.Master + properties: + configuration: + file_content: { get_input: kubernetes_configuration_file_content } + + ves_grafana_service: + type: cloudify.kubernetes.resources.Service + properties: + definition: + apiVersion: v1 + metadata: + name: ves-grafana-service + spec: + type: NodePort + ports: + - port: { get_input: spec_port } + selector: + app: ves-grafana + relationships: + - type: cloudify.kubernetes.relationships.managed_by_master + target: kubernetes_master + - type: cloudify.relationships.depends_on + target: ves_grafana_pod + + ves_grafana_pod: + type: cloudify.kubernetes.resources.Pod + properties: + definition: + apiVersion: v1 + metadata: + name: ves-grafana-pod + labels: + app: ves-grafana + spec: + containers: + - name: ves-grafana + image: grafana/grafana + env: + ports: + - containerPort: { get_input: container_port } + relationships: + - type: cloudify.kubernetes.relationships.managed_by_master + target: kubernetes_master -- cgit 1.2.3-korg