description: TOSCA example
imports:
- nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
- capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
- policies: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
- interfaces: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml
topology_template:
  node_templates:
    compute:
      interfaces:
        Standard:
          create: dumy.yaml
      properties:
        disk_size: 50000 MB
        host_name: vm
        mem_size: 6000 MB
        num_cores: 2
        os: ubuntu 16
        role: master
        user_name: vm_user
      type: tosca.nodes.ARTICONF.VM.Compute
    compute_1:
      interfaces:
        Standard:
          create: dumy.yaml
      properties:
        disk_size: 50000 MB
        host_name: vm
        mem_size: 6000 MB
        num_cores: 2
        os: ubuntu 16
        role: worker
        user_name: vm_user
      type: tosca.nodes.ARTICONF.VM.Compute
    compute_3:
      interfaces:
        Standard:
          create: dumy.yaml
      properties:
        disk_size: 50000 MB
        host_name: vm
        mem_size: 6000 MB
        num_cores: 2
        os: ubuntu 16
        role: worker
        user_name: vm_user
      type: tosca.nodes.ARTICONF.VM.Compute      
    kubernetes:
      interfaces:
        Standard:
          create: interfaces/playbooks/kubernetes_install.yaml
      requirements:
      - host:
          capability: tosca.capabilities.ARTICONF.VM.topology
          node: topology
          relationship: tosca.relationships.HostedOn
      - host:
          capability: tosca.capabilities.ARTICONF.VM.topology
          node: topology_1
          relationship: tosca.relationships.HostedOn          
      type: tosca.nodes.ARTICONF.Orchestrator.Kubernetes
    mysql:
      artifacts:
        image:
          file: mysql:5.7
          repository: docker_hub
          type: tosca.artifacts.Deployment.Image.Container.Docker
      properties:
        environment:
          MYSQL_DATABASE: wordpress
          MYSQL_PASSWORD: wordpress
          MYSQL_ROOT_PASSWORD: somewordpress
          MYSQL_USER: wordpress
        ports:
        - 3306:3306
        volumes:
        - db_data:/var/lib/mysql
      requirements:
      - host:
          capability: tosca.capabilities.ARTICONF.Orchestrator
          node: kubernetes
          relationship: tosca.relationships.HostedOn
      type: tosca.nodes.ARTICONF.Container.Application.Docker
    topology:
      interfaces:
        Standard:
          create: dumy.yaml
      properties:
        domain: UvA (Amsterdam, The Netherlands) XO Rack
        provider: ExoGeni
      requirements:
      - vm:
          capability: tosca.capabilities.ARTICONF.VM
          node: compute
          relationship: tosca.relationships.DependsOn
      - vm:
          capability: tosca.capabilities.ARTICONF.VM
          node: compute_1
          relationship: tosca.relationships.DependsOn
      type: tosca.nodes.ARTICONF.VM.topology
    topology_1:
      interfaces:
        Standard:
          create: dumy.yaml
      properties:
        domain: NICTA (Sydney, Australia) XO Rack
        provider: ExoGeni
      requirements:
      - vm:
          capability: tosca.capabilities.ARTICONF.VM
          node: compute_3
          relationship: tosca.relationships.DependsOn
      type: tosca.nodes.ARTICONF.VM.topology      
    wordpress:
      artifacts:
        image:
          file: wordpress:latest
          repository: docker_hub
          type: tosca.artifacts.Deployment.Image.Container.Docker
      properties:
        environment:
          WORDPRESS_DB_HOST: mysql:3306
          WORDPRESS_DB_NAME: wordpress
          WORDPRESS_DB_PASSWORD: wordpress
          WORDPRESS_DB_USER: wordpress
        ports:
        - 8000:80
      requirements:
      - service:
          node: mysql
          relationship:
            type: tosca.relationships.DependsOn
      - host:
          capability: tosca.capabilities.ARTICONF.Orchestrator
          node: kubernetes
          relationship: tosca.relationships.HostedOn
      type: tosca.nodes.ARTICONF.Container.Application.Docker
  policies:
  - scalability:
      properties:
        fault_tolerance_level: 0
      targets:
      - mysql
      type: tosca.policies.ARTICONF.FaultTolerance
tosca_definitions_version: tosca_simple_yaml_1_0
