aboutsummaryrefslogtreecommitdiffstats
path: root/message-router-blueprint.yaml
blob: 98a283020bb1ff54e20750363751735322e001c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}
@media (prefers-color-scheme: light) {
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
}
#!/bin/bash
#########
#  ============LICENSE_START====================================================
#  org.onap.aaf
#  ===========================================================================
#  Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
#  ===========================================================================
#  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.
#  ============LICENSE_END====================================================
#
# Pull in AAF Env Variables from AAF install
if [ -e ../../docker/d.props ]; then
  . ../../docker/d.props
fi
DOCKER=${DOCKER:-docker}

$DOCKER exec -it aaf-cass bash
'n372' href='#n372'>372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
tosca_definitions_version: cloudify_dsl_1_3

description: >
  This example deploys the OOM Message Router application. Each service/deployment pair is associated with a single Kubernetes node.
  Node template naming convention: PROVISIONINGAPI_RESOURCETYPE_APPLICATIONCOMPONENT
  The following resources are created:
  - Security Group
  - openstack_port_zookeeper - NIC that connects to the Openstack Server
  - openstack_port_kafka - NIC that connects to the Openstack Server
  - openstack_port_dmaap - NIC that connects to the Openstack Server
  - openstack_server_zookeeper - a VM that a Kubernetes Node is installed on.
  - openstack_server_kafka - a VM that a Kubernetes Node is installed on.
  - openstack_server_dmaap - a VM that a Kubernetes Node is installed on.
  - kubernetes_node_zookeeper - a Kubernetes node that will join the Kubernetes cluster.
  - kubernetes_node_kafka - a Kubernetes node that will join the Kubernetes cluster.
  - kubernetes_node_dmaap - a Kubernetes node that will join the Kubernetes cluster.
  - kubernetes_deployment_zookeeper - a Kubernetes deployment.
  - kubernetes_deployment_kafka - a Kubernetes deployment.
  - kubernetes_deployment_dmaap - a Kubernetes deployment.
  - kubernetes_service_zookeeper - a Kubernetes service.
  - kubernetes_service_kafka - a Kubernetes service.
  - kubernetes_service_dmaap - a Kubernetes service.
  The following pre-setup steps are assumed, but not required:
  - Create Cloudify Example Environment: https://github.com/cloudify-examples/cloudify-environment-setup.
  - Create Kubernetes Cluster: https://github.com/cloudify-examples/simple-kubernetes-blueprint.

imports:
  - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml
  # Plugin required: https://github.com/cloudify-cosmo/cloudify-openstack-plugin/releases/download/2.2.0/cloudify_openstack_plugin-2.2.0-py27-none-linux_x86_64-centos-Core.wgn
  - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-openstack-plugin/2.2.0/plugin.yaml
  # Plugin required: https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.2.5/cloudify_utilities_plugin-1.2.5-py27-none-linux_x86_64-centos-Core.wgn
  - https://raw.githubusercontent.com/cloudify-incubator/cloudify-utilities-plugin/1.2.5/plugin.yaml
  # Plugin required: https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/releases/download/1.2.0/cloudify_kubernetes_plugin-1.2.0-py27-none-linux_x86_64-centos-Core.wgn
  - https://raw.githubusercontent.com/cloudify-incubator/cloudify-kubernetes-plugin/1.2.0/plugin.yaml
  # Plugin required: http://repository.cloudifysource.org/cloudify/wagons/cloudify-diamond-plugin/1.3.5/cloudify_diamond_plugin-1.3.5-py27-none-linux_x86_64-centos-Core.wgn
  - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml
  # Plugin required: http://repository.cloudifysource.org/cloudify/wagons/cloudify-fabric-plugin/1.5/cloudify_fabric_plugin-1.5-py27-none-linux_x86_64-centos-Core.wgn
  - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-fabric-plugin/1.5/plugin.yaml
  - cloudify/types/kubernetes.yaml

inputs:

  configuration_file_content:
    type: string

  NS:
    default: oom

  image:
    description: Image to be used when launching agent VMs
    default: { get_secret: centos_core_image }

  flavor:
    description: Flavor of the agent VMs
    default: { get_secret: large_image_flavor }

  agent_user:
    description: >
      User for connecting to agent VMs
    default: centos

  app_name:
    default: message-router

  security_group:
    default: { concat: [ 'secgrp_', { get_input: app_name } ] }

dsl_definitions:

  openstack_config: &openstack_config
    username: { get_secret: keystone_username }
    password: { get_secret: keystone_password }
    tenant_name: { get_secret: keystone_tenant_name }
    auth_url: { get_secret: keystone_url }
    region: { get_secret: region }

groups:

  openstack_server_port_group_zookeeper:
    members:
      - openstack_server_zookeeper
      - openstack_port_zookeeper

  openstack_server_port_group_kafka:
    members:
      - openstack_server_kafka
      - openstack_port_kafka

  openstack_server_port_group_dmaap:
    members:
      - openstack_server_dmaap
      - openstack_port_dmaap

policies:

  openstack_server_port_policies_scaling:
    type: cloudify.policies.scaling
    properties:
      default_instances:  1
    targets:
    - openstack_server_port_group_zookeeper
    - openstack_server_port_group_kafka
    - openstack_server_port_group_dmaap

node_templates:

  kubernetes_service_zookeeper:
    type: cloudify.kubernetes.resources.Service
    properties:
      definition:
        apiVersion: v1
        kind: Service
        metadata:
          name: zookeeper
          labels:
            app: zookeeper
        spec:
          ports:
          - name: zookeeper1
            port: 2181
          selector:
            app: zookeeper
          clusterIP: None
    relationships:
      - type: cloudify.kubernetes.relationships.managed_by_master
        target: k8s
      - type: cloudify.relationships.depends_on
        target: kubernetes_deployment_zookeeper

  kubernetes_deployment_zookeeper:
    type: cloudify.kubernetes.resources.Deployment
    properties:
      definition:
        file:
          resource_path: kubernetes/message-router/message-router-zookeeper.yaml
    relationships:
      - type: cloudify.kubernetes.relationships.managed_by_master
        target: k8s
      - type: cloudify.relationships.depends_on
        target: kubernetes_node_zookeeper

  kubernetes_node_zookeeper:
    type: cloudify.nodes.Kubernetes.Node
    relationships:
      - type: cloudify.relationships.contained_in
        target: openstack_server_zookeeper
    interfaces:
      cloudify.interfaces.lifecycle:
        start:
          implementation: fabric.fabric_plugin.tasks.run_task
          inputs:
            task_properties:
              hostname: { get_attribute: [ SELF, hostname ] }
              labels:
                app: zookeeper

  openstack_server_zookeeper:
    type: cloudify.openstack.nodes.Server
    properties: &openstack_server_properties
      openstack_config: *openstack_config
      agent_config:
          user: { get_input: agent_user }
          install_method: remote
          port: 22
          key: { get_secret: agent_key_private }
      server:
        key_name: ''
        image: ''
        flavor: ''
      management_network_name: { get_property: [ private_network, resource_id ] }
    relationships:
      - type: cloudify.relationships.contained_in
        target: k8s_node_scaling_tier
      - target: openstack_port_zookeeper
        type: cloudify.openstack.server_connected_to_port
      - type: cloudify.relationships.depends_on
        target: cloud_init_openstack_server
    interfaces: &openstack_server_interfaces
      cloudify.interfaces.lifecycle:
        create:
          inputs:
            args:
              image: { get_input: image }
              flavor: { get_input: flavor }
              userdata: { get_attribute: [ cloud_init_openstack_server, cloud_config ] }
      cloudify.interfaces.monitoring_agent:
          install:
            implementation: diamond.diamond_agent.tasks.install
            inputs:
              diamond_config:
                interval: 1
          start: diamond.diamond_agent.tasks.start
          stop: diamond.diamond_agent.tasks.stop
          uninstall: diamond.diamond_agent.tasks.uninstall
      cloudify.interfaces.monitoring:
          start:
            implementation: diamond.diamond_agent.tasks.add_collectors
            inputs:
              collectors_config:
                CPUCollector: {}
                MemoryCollector: {}
                LoadAverageCollector: {}
                DiskUsageCollector:
                  config:
                    devices: x?vd[a-z]+[0-9]*$
                NetworkCollector: {}
                ProcessResourcesCollector:
                  config:
                    enabled: true
                    unit: B
                    measure_collector_time: true
                    cpu_interval: 0.5
                    process:
                      hyperkube:
                        name: hyperkube

  openstack_port_zookeeper:
    type: cloudify.openstack.nodes.Port
    properties:
      openstack_config: *openstack_config
    relationships: &openstack_port_relationships
      - type: cloudify.relationships.contained_in
        target: k8s_node_scaling_tier
      - type: cloudify.relationships.connected_to
        target: private_network
      - type: cloudify.relationships.depends_on
        target: private_subnet
      - type: cloudify.openstack.port_connected_to_security_group
        target: security_group

  kubernetes_service_kafka:
    type: cloudify.kubernetes.resources.Service
    properties:
      definition:
        apiVersion: v1
        kind: Service
        metadata:
          name: global-kafka
          labels:
            app: global-kafka
        spec:
          ports:
          - name: kafka1
            port: 9092
          selector:
            app: global-kafka
          clusterIP: None
    relationships:
      - type: cloudify.kubernetes.relationships.managed_by_master
        target: k8s
      - type: cloudify.relationships.depends_on
        target: kubernetes_deployment_kafka

  kubernetes_deployment_kafka:
    type: cloudify.kubernetes.resources.Deployment
    properties:
      definition:
        file:
          resource_path: kubernetes/message-router/message-router-kafka.yaml
    relationships:
      - type: cloudify.kubernetes.relationships.managed_by_master
        target: k8s
      - type: cloudify.relationships.depends_on
        target: kubernetes_node_kafka
      - type: cloudify.relationships.depends_on
        target: kubernetes_deployment_zookeeper

  kubernetes_node_kafka:
    type: cloudify.nodes.Kubernetes.Node
    relationships:
      - type: cloudify.relationships.contained_in
        target: openstack_server_kafka
    interfaces:
      cloudify.interfaces.lifecycle:
        start:
          implementation: fabric.fabric_plugin.tasks.run_task
          inputs:
            task_properties:
              hostname: { get_attribute: [ SELF, hostname ] }
              labels:
                app: global-kafka

  openstack_server_kafka:
    type: cloudify.openstack.nodes.Server
    properties: *openstack_server_properties
    relationships:
      - type: cloudify.relationships.contained_in
        target: k8s_node_scaling_tier
      - target: openstack_port_kafka
        type: cloudify.openstack.server_connected_to_port
      - type: cloudify.relationships.depends_on
        target: cloud_init_openstack_server
    interfaces: *openstack_server_interfaces

  openstack_port_kafka:
    type: cloudify.openstack.nodes.Port
    properties:
      openstack_config: *openstack_config
    relationships: *openstack_port_relationships

  kubernetes_service_dmaap:
    type: cloudify.kubernetes.resources.Service
    properties:
      definition:
        apiVersion: v1
        kind: Service
        metadata:
          name: dmaap
          labels:
            app: dmaap
            version: 1.0.0
        spec:
          ports:
          - name: mr1
            port: 3904
            nodePort: 30227
          - name: mr2
            port: 3905
            nodePort: 30226
          selector:
            app: dmaap
          type: NodePort
    relationships:
      - type: cloudify.kubernetes.relationships.managed_by_master
        target: k8s
      - type: cloudify.relationships.depends_on
        target: kubernetes_deployment_dmaap

  kubernetes_deployment_dmaap:
    type: cloudify.kubernetes.resources.Deployment
    properties:
      definition:
        file:
          resource_path: kubernetes/message-router/message-router-dmaap.yaml
    relationships:
      - type: cloudify.kubernetes.relationships.managed_by_master
        target: k8s
      - type: cloudify.relationships.depends_on
        target: kubernetes_node_dmaap
      - type: cloudify.relationships.depends_on
        target: kubernetes_deployment_zookeeper

  kubernetes_node_dmaap:
    type: cloudify.nodes.Kubernetes.Node
    relationships:
      - type: cloudify.relationships.contained_in
        target: openstack_server_dmaap
    interfaces:
      cloudify.interfaces.lifecycle:
        start:
          implementation: fabric.fabric_plugin.tasks.run_task
          inputs:
            task_properties:
              hostname: { get_attribute: [ SELF, hostname ] }
              labels:
                app: global-dmaap

  openstack_server_dmaap:
    type: cloudify.openstack.nodes.Server
    properties: *openstack_server_properties
    relationships:
      - type: cloudify.relationships.contained_in
        target: k8s_node_scaling_tier
      - target: openstack_port_dmaap
        type: cloudify.openstack.server_connected_to_port
      - type: cloudify.relationships.depends_on
        target: cloud_init_openstack_server
    interfaces: *openstack_server_interfaces

  openstack_port_dmaap:
    type: cloudify.openstack.nodes.Port
    properties:
      openstack_config: *openstack_config
    relationships: *openstack_port_relationships

  security_group:
    type: cloudify.openstack.nodes.SecurityGroup
    properties:
      openstack_config: *openstack_config
      security_group:
        name: { get_input: security_group }
        description: kubernetes master security group
      rules:
      rules:
      - remote_ip_prefix: 0.0.0.0/0
        port: 22
      - remote_ip_prefix: 0.0.0.0/0
        port: 53
      - remote_ip_prefix: 0.0.0.0/0
        port: 53
        protocol: udp
      - remote_ip_prefix: 0.0.0.0/0
        port: 80
      - remote_ip_prefix: 0.0.0.0/0
        port: 443
      - remote_ip_prefix: 0.0.0.0/0
        port: 2379
      - remote_ip_prefix: 0.0.0.0/0
        port: 4001
      - remote_ip_prefix: 0.0.0.0/0
        port: 4789
      - remote_ip_prefix: 0.0.0.0/0
        port: 6443
      - remote_ip_prefix: 0.0.0.0/0
        port: 6783
        protocol: tcp
      - remote_ip_prefix: 0.0.0.0/0
        port: 6783
        protocol: udp
      - remote_ip_prefix: 0.0.0.0/0
        port: 6784
        protocol: tcp
      - remote_ip_prefix: 0.0.0.0/0
        port: 6784
        protocol: udp
      - remote_ip_prefix: 0.0.0.0/0
        port: 8000
      - remote_ip_prefix: 0.0.0.0/0
        port: 8080
      - remote_ip_prefix: 0.0.0.0/0
        port: 9090
      - remote_ip_prefix: 0.0.0.0/0
        port: 10250
      - remote_ip_prefix: 0.0.0.0/0
        port: 2181
      - remote_ip_prefix: 0.0.0.0/0
        port: 9092
      - remote_ip_prefix: 0.0.0.0/0
        port: 3904
      - remote_ip_prefix: 0.0.0.0/0
        port: 30227
      - remote_ip_prefix: 0.0.0.0/0
        port: 3905
      - remote_ip_prefix: 0.0.0.0/0
        port: 30226

  private_subnet:
    type: cloudify.openstack.nodes.Subnet
    properties:
      openstack_config: *openstack_config
      use_external_resource: true
      resource_id: { get_secret: private_subnet_name }
    relationships:
      - target: private_network
        type: cloudify.relationships.contained_in

  private_network:
    type: cloudify.openstack.nodes.Network
    properties:
      openstack_config: *openstack_config
      use_external_resource: true
      resource_id: { get_secret: private_network_name }

  external_network:
    type: cloudify.openstack.nodes.Network
    properties:
      openstack_config: *openstack_config
      use_external_resource: true
      resource_id: { get_secret: external_network_name }

  cloud_init_openstack_server:
    type: cloudify.nodes.CloudInit.CloudConfig
    properties:
      resource_config:
        groups:
        - docker
        users:
        - name: { get_input: agent_user }
          primary-group: wheel
          groups: docker
          shell: /bin/bash
          sudo: ['ALL=(ALL) NOPASSWD:ALL']
          ssh-authorized-keys:
            - { get_secret: agent_key_public }
        write_files:
        - path: /etc/yum.repos.d/kubernetes.repo
          owner: root:root
          permissions: '0444'
          content: |
            # installed by cloud-init
            [kubernetes]
            name=Kubernetes
            baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
            enabled=1
            gpgcheck=1
            repo_gpgcheck=1
            gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
                   https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
        packages:
        - [epel-release]
        - [gcc]
        - [python-dev]
        - [python-wheel]
        - [python-setuptools]
        - [libffi-devel]
        - [python-devel]
        - [openssl-devel]
        - [docker, 1.12.6-28.git1398f24.el7.centos]
        - [kubelet, 1.6.4-0]
        - [kubeadm, 1.6.4-0]
        - [kubectl, 1.6.4-0]
        - [kubernetes-cni, 0.5.1-0]
        - [git]
        - [wget]
        runcmd:
        - systemctl enable docker
        - systemctl start docker
        - systemctl enable kubelet
        - systemctl start kubelet
        - yum install -y python-pip
        - pip install --upgrade pip
        - pip install docker-compose
        - pip install backports.ssl_match_hostname --upgrade
        - mkdir -p /tmp/oom/
        - git clone https://gerrit.onap.org/r/oom.git /tmp/oom
        - sleep 15
        - chmod 755 /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh
        - sed -i -e "s/\.\/docker_files/\/tmp\/oom\/kubernetes\/config\/docker\/init\/src\/config\/message-router\/dcae-startup-vm-message-router\/docker_files/g" /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh
        - sed -i -e "s/\/opt\/docker\/docker-compose/\/bin\/docker-compose/g" /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh
        - mv /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/__docker-compose.yml /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/docker-compose.yml
        - mv /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/__MsgRtrApi.properties /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/MsgRtrApi.properties
        - sh -c /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh

  k8s_node_scaling_tier:
    type: cloudify.nodes.Root

  k8s:
    type: cloudify.kubernetes.nodes.Master
    properties:
      configuration:
        file_content: { get_input: configuration_file_content }