Update the TOSCA monitoring use case

Update the template with remaining components including elasticsearch,
logstash, kibana, rsyslog, collectd and nodejs samplea application. These
templates has been discussed and reviewed by TOSCA TC.

Change-Id: Ie842c288cbb2bd2d81e50c85b8b417ad7c5716dc
This commit is contained in:
spzala 2015-04-30 17:42:27 -07:00
parent ef3357f9c5
commit 0c98bb5fe2
8 changed files with 234 additions and 67 deletions

View File

@ -58,6 +58,8 @@ class NodeType(StatefulEntityType):
for key, req in require.items():
if 'relationship' in req:
relation = req.get('relationship')
if 'type' in relation:
relation = relation.get('type')
node_type = req.get('node')
value = req
if node_type:

View File

@ -1,8 +1,13 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
description: >
collectd is a daemon which gathers statistics about the system it is running on.
node_types:
tosca.nodes.SoftwareComponent.Collectd:
derived_from: tosca.nodes.SoftwareComponent
requirements:
- collectd_endpoint: tosca.nodes.SoftwareComponent.Logstash
relationship: tosca.relationships.ConnectsTo
- log_endpoint:
capability: tosca.capabilities.Endpoint
node: tosca.nodes.SoftwareComponent.Logstash
relationship: tosca.relationships.ConnectsTo

View File

@ -1,23 +1,12 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
dsl_definitions:
search_api_port: &search_api_port
required: yes
type: integer
description: The default elasticsearch http client port.
default: 9200
description: >
Elasticsearch is an open-source search engine built on top of Apache Lucene,
a full-text search-engine library.
node_types:
tosca.nodes.SoftwareComponent.Elasticsearch:
derived_from: tosca.nodes.SoftwareComponent
properties:
search_api_port: *search_api_port
capabilities:
search_endpoint:
type: tosca.capabilities.Endpoint
capability_types:
tosca.capabilities.Elasticsearch:
derived_from: tosca.capabilities.Endpoint
properties:
search_api_port: *search_api_port

View File

@ -1,9 +1,14 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
description: >
Kibana is an open source analytics and visualization platform designed to work with Elasticsearch.
You use Kibana to search, view, and interact with data stored in Elasticsearch.
node_types:
tosca.nodes.SoftwareComponent.Kibana:
derived_from: tosca.nodes.SoftwareComponent
requirements:
- search_endpoint: tosca.nodes.SoftwareComponent.Elasticsearch
relationship: tosca.relationships.ConnectsTo
- search_endpoint:
capability: tosca.capabilities.Endpoint
node: tosca.nodes.SoftwareComponent.Elasticsearch
relationship: tosca.relationships.ConnectsTo

View File

@ -1,23 +1,25 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
description: >
Logstash is a tool for receiving, processing and outputting logs. All kinds
of logs. System logs, webserver logs, error logs, application logs, and just
about anything you can throw at it.
node_types:
tosca.nodes.SoftwareComponent.Logstash:
derived_from: tosca.nodes.SoftwareComponent
requirements:
- search_endpoint: tosca.nodes.SoftwareComponent.Elasticsearch
relationship: tosca.relationships.ConnectsTo
interfaces:
tosca.interfaces.relationship.Configure:
pre_configure_source:
implementation:
type: string
inputs:
host:
type: string
port:
type: integer
- search_endpoint:
capability: tosca.capabilities.Endpoint
node: tosca.nodes.SoftwareComponent.Elasticsearch
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_source:
inputs:
elasticsearch_ip:
type: string
capabilities:
collectd_endpoint:
type: tosca.capabilities.Endpoint
rsyslog_endpoint:
log_endpoint:
type: tosca.capabilities.Endpoint

View File

@ -0,0 +1,29 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
description: >
Pizza store app that allows you to explore the features provided by PayPal's REST APIs.
More detail can be found at https://github.com/paypal/rest-api-sample-app-nodejs/
node_types:
tosca.nodes.WebApplication.PayPalPizzaStore:
derived_from: tosca.nodes.WebApplication
properties:
github_url:
required: no
type: string
description: location of the application on the github.
default: https://github.com/sample.git
requirements:
#WebApplication inherits Computer, so host implied.
- database_connection:
capability: tosca.capabilities.Endpoint.Database
node: tosca.nodes.Database
relationship: tosca.relationships.ConnectsTo
interfaces:
tosca.interfaces.node.lifecycle.Standard:
configure:
inputs:
github_url:
type: string
mongodb_ip:
type: string

View File

@ -1,8 +1,13 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
description: >
RSYSLOG is the Rocket-fast SYStem for LOG processing.
node_types:
tosca.nodes.SoftwareComponent.Rsyslog:
derived_from: tosca.nodes.SoftwareComponent
requirements:
- rsyslog_endpoint: tosca.nodes.SoftwareComponent.Logstash
relationship: tosca.relationships.ConnectsTo
- log_endpoint:
capability: tosca.capabilities.Endpoint
node: tosca.nodes.SoftwareComponent.Logstash
relationship: tosca.relationships.ConnectsTo

View File

@ -1,12 +1,18 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
description: >
TOSCA simple profile with nodejs and mongodb.
this template will be extended with paypal sample app,
elasticsearch, logstash, kibana, rsyslog and collectd
This TOSCA simple profile deployes nodejs, mongodb, elasticsearch, logstash
and kibana each on a separate server with monitoring enabled for nodejs
server where a sample nodejs application is running. The rsyslog and collectd
are insatlled on a nodejs server.
imports:
- custom_types/nodejs.yaml
- custom_types/paypalpizzastore_nodejs_app.yaml
- custom_types/elasticsearch.yaml
- custom_types/logstash.yaml
- custom_types/kibana.yaml
- custom_types/collectd.yaml
- custom_types/rsyslog.yaml
dsl_definitions:
ubuntu_node: &ubuntu_node
@ -31,53 +37,168 @@ topology_template:
github_url:
type: string
description: The URL to download nodejs.
default: https://github.com/sample.git
default: https://github.com/sample.git
node_templates:
nodejs:
type: tosca.nodes.SoftwareComponent.Nodejs
paypal_pizzastore:
type: tosca.nodes.WebApplication.PayPalPizzaStore
properties:
github_url: https://github.com/sample.git
github_url: { get_input: github_url }
requirements:
- host:
capability: tosca.capabilities.Container
node: app_server
relationship: tosca.relationships.HostedOn
node: nodejs
- database_connection:
node: mongo_db
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: nodejs/create.sh
configure:
implementation: nodejs/config.sh
inputs:
github_url: { get_property: [ SELF, github_url ] }
mongodb_ip: { get_attribute: [mongo_server, private_address] }
start: nodejs/start.sh
configure:
implementation: Scripts/nodejs/configure.sh
inputs:
github_url: { get_property: [ SELF, github_url ] }
mongodb_ip: { get_attribute: [mongo_server, private_address] }
start: Scripts/nodejs/start.sh
nodejs:
type: tosca.nodes.WebServer
requirements:
- host:
node: app_server
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: Scripts/nodejs/create.sh
mongo_db:
type: tosca.nodes.Database
requirements:
- host:
node: mongo_dbms
mongo_dbms:
type: tosca.nodes.DBMS
requirements:
- host:
capability: tosca.capabilities.Container
- host:
node: mongo_server
relationship: tosca.relationships.HostedOn
properties:
dbms_port: 27017
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: mongodb/create.sh
create: Scripts/mongodb/create.sh
configure:
implementation: mongodb/config.sh
implementation: Scripts/mongodb/config.sh
inputs:
mongodb_ip: { get_attribute: [mongo_server, private_address] }
start: mongodb/start.sh
start: Scripts/mongodb/start.sh
elasticsearch:
type: tosca.nodes.SoftwareComponent.Elasticsearch
requirements:
- host:
node: elasticsearch_server
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: Scripts/elasticsearch/create.sh
start: Scripts/elasticsearch/start.sh
logstash:
type: tosca.nodes.SoftwareComponent.Logstash
requirements:
- host:
node: logstash_server
- search_endpoint:
node: elasticsearch
capability: search_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_source:
implementation: Python/logstash/configure_elasticsearch.py
inputs:
elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: Scripts/lostash/create.sh
configure: Scripts/logstash/config.sh
start: Scripts/logstash/start.sh
kibana:
type: tosca.nodes.SoftwareComponent.Kibana
requirements:
- host:
node: kibana_server
- search_endpoint:
node: elasticsearch
capability: search_endpoint
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: Scripts/kibana/create.sh
configure:
implementation: Scripts/kibana/config.sh
inputs:
elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
kibana_ip: { get_attribute: [kibana_server, private_address] }
start: Scripts/kibana/start.sh
app_collectd:
type: tosca.nodes.SoftwareComponent.Collectd
requirements:
- host:
node: app_server
- log_endpoint:
node: logstash
capability: log_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_target:
implementation: Python/logstash/configure_collectd.py
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: Scripts/collectd/create.sh
configure:
implementation: Python/collectd/config.py
inputs:
logstash_ip: { get_attribute: [logstash_server, private_address] }
start: Scripts/collectd/start.sh
app_rsyslog:
type: tosca.nodes.SoftwareComponent.Rsyslog
requirements:
- host:
node: app_server
- log_endpoint:
node: logstash
capability: log_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_target:
implementation: Python/logstash/configure_rsyslog.py
interfaces:
tosca.interfaces.node.lifecycle.Standard:
create: Scripts/rsyslog/create.sh
configure:
implementation: Scripts/rsyslog/config.sh
inputs:
logstash_ip: { get_attribute: [logstash_server, private_address] }
start: Scripts/rsyslog/start.sh
app_server:
type: tosca.nodes.Compute
properties: *ubuntu_node
capabilities:
os:
properties: *os_capabilities
mongo_server:
type: tosca.nodes.Compute
properties: *ubuntu_node
capabilities:
os:
properties: *os_capabilities
app_server:
elasticsearch_server:
type: tosca.nodes.Compute
properties: *ubuntu_node
capabilities:
os:
properties: *os_capabilities
logstash_server:
type: tosca.nodes.Compute
properties: *ubuntu_node
capabilities:
os:
properties: *os_capabilities
kibana_server:
type: tosca.nodes.Compute
properties: *ubuntu_node
capabilities:
@ -87,7 +208,16 @@ topology_template:
outputs:
nodejs_url:
description: URL for the nodejs server, http://<IP>:3000
value: { get_attribute: [app_server, private_address] }
value: { get_attribute: [ app_server, private_address ] }
mongodb_url:
description: URL for the mongodb server.
value: { get_attribute: [mongo_server, private_address] }
value: { get_attribute: [ mongo_server, private_address ] }
elasticsearch_url:
description: URL for the elasticsearch server.
value: { get_attribute: [ elasticsearch_server, private_address ] }
logstash_url:
description: URL for the logstash server.
value: { get_attribute: [ logstash_server, private_address ] }
kibana_url:
description: URL for the kibana server.
value: { get_attribute: [ kibana_server, private_address ] }