Scott Baker | 6a4fd49 | 2018-06-19 08:12:42 -0700 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Copyright 2018-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */}} |
| 17 | {{- define "demo-exampleservice.publicNetworkTosca" -}} |
| 18 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 19 | description: Setup public network |
| 20 | imports: |
Scott Baker | b6ed440 | 2018-06-22 16:58:28 -0700 | [diff] [blame] | 21 | - custom_types/addressmanagerservice.yaml |
| 22 | - custom_types/addressmanagerserviceinstance.yaml |
| 23 | - custom_types/addresspool.yaml |
Scott Baker | 6a4fd49 | 2018-06-19 08:12:42 -0700 | [diff] [blame] | 24 | - custom_types/networktemplate.yaml |
| 25 | - custom_types/network.yaml |
Scott Baker | b6ed440 | 2018-06-22 16:58:28 -0700 | [diff] [blame] | 26 | - custom_types/serviceinstancelink.yaml |
Scott Baker | 6a4fd49 | 2018-06-19 08:12:42 -0700 | [diff] [blame] | 27 | - custom_types/site.yaml |
| 28 | - custom_types/slice.yaml |
| 29 | topology_template: |
| 30 | node_templates: |
| 31 | mysite: |
| 32 | type: tosca.nodes.Site |
| 33 | properties: |
| 34 | name: {{ .Values.cordSiteName }} |
| 35 | must-exist: true |
| 36 | |
| 37 | public_networking_slice: |
| 38 | description: This slice exists solely to own the public network |
| 39 | type: tosca.nodes.Slice |
| 40 | properties: |
| 41 | network: noauto |
| 42 | name: public_networking |
| 43 | requirements: |
| 44 | - site: |
| 45 | node: mysite |
| 46 | relationship: tosca.relationships.BelongsToOne |
| 47 | |
| 48 | # public network |
| 49 | public_template: |
| 50 | type: tosca.nodes.NetworkTemplate |
| 51 | properties: |
| 52 | name: public_template |
| 53 | visibility: public |
| 54 | translation: none |
| 55 | vtn_kind: PUBLIC |
| 56 | |
| 57 | public: |
| 58 | type: tosca.nodes.Network |
| 59 | properties: |
| 60 | name: public |
| 61 | permit_all_slices: true |
| 62 | subnet: {{ .Values.addresspool_public_cidr }} |
| 63 | # ip_version: 4 |
| 64 | requirements: |
| 65 | - template: |
| 66 | node: public_template |
| 67 | relationship: tosca.relationships.BelongsToOne |
| 68 | - owner: |
| 69 | node: public_networking_slice |
| 70 | relationship: tosca.relationships.BelongsToOne |
Scott Baker | b6ed440 | 2018-06-22 16:58:28 -0700 | [diff] [blame] | 71 | |
| 72 | service#addressmanager: |
| 73 | type: tosca.nodes.AddressManagerService |
| 74 | properties: |
| 75 | name: addressmanager |
| 76 | |
| 77 | addresses_public: |
| 78 | type: tosca.nodes.AddressPool |
| 79 | properties: |
| 80 | name: addresses_public |
| 81 | addresses: {{ .Values.addresspool_public_cidr }} |
| 82 | gateway_ip: {{ .Values.addresspool_public_gateway_ip }} |
| 83 | gateway_mac: {{ .Values.addresspool_public_gateway_mac }} |
| 84 | requirements: |
| 85 | - service: |
| 86 | node: service#addressmanager |
| 87 | relationship: tosca.relationships.BelongsToOne |
| 88 | |
| 89 | AddressManagerServiceInstancePublicNetwork: |
| 90 | type: tosca.nodes.AddressManagerServiceInstance |
| 91 | requirements: |
| 92 | - owner: |
| 93 | node: service#addressmanager |
| 94 | relationship: tosca.relationships.BelongsToOne |
| 95 | - address_pool: |
| 96 | node: addresses_public |
| 97 | relationship: tosca.relationships.BelongsToOne |
| 98 | properties: |
| 99 | name: AM_public_net |
| 100 | |
| 101 | public_to_address_manager: |
| 102 | type: tosca.nodes.ServiceInstanceLink |
| 103 | requirements: |
| 104 | - provider_service_instance: |
| 105 | node: AddressManagerServiceInstancePublicNetwork |
| 106 | relationship: tosca.relationships.BelongsToOne |
| 107 | - subscriber_network: |
| 108 | node: public |
| 109 | relationship: tosca.relationships.BelongsToOne |
| 110 | |
Scott Baker | 6a4fd49 | 2018-06-19 08:12:42 -0700 | [diff] [blame] | 111 | {{- end -}} |