Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -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 "base-openstack.fixtureTosca" -}} |
| 18 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 19 | |
| 20 | imports: |
| 21 | - custom_types/deployment.yaml |
| 22 | - custom_types/site.yaml |
| 23 | - custom_types/networktemplate.yaml |
| 24 | - custom_types/network.yaml |
| 25 | - custom_types/networkslice.yaml |
| 26 | - custom_types/sitedeployment.yaml |
| 27 | |
| 28 | description: set up site and deployment and link them |
| 29 | |
| 30 | topology_template: |
| 31 | node_templates: |
| 32 | |
| 33 | {{ .Values.cordSiteName }}: |
| 34 | type: tosca.nodes.Site |
| 35 | properties: |
| 36 | name: {{ .Values.cordSiteName }} |
| 37 | site_url: http://mysite.opencord.us/ |
| 38 | hosts_nodes: true |
| 39 | |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 40 | {{- end -}} |
| 41 | |
| 42 | {{- define "base-openstack.serviceGraphTosca" -}} |
| 43 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 44 | |
| 45 | imports: |
| 46 | - custom_types/onosapp.yaml |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 47 | - custom_types/onosservice.yaml |
Andy Bavier | 8b94591 | 2018-06-12 16:10:04 -0700 | [diff] [blame] | 48 | - custom_types/servicedependency.yaml |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 49 | - custom_types/servicegraphconstraint.yaml |
Matteo Scandolo | 8209638 | 2018-06-12 15:07:05 -0700 | [diff] [blame] | 50 | - custom_types/servicedependency.yaml |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 51 | - custom_types/serviceinstance.yaml |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 52 | - custom_types/serviceinstancelink.yaml |
| 53 | - custom_types/vtnservice.yaml |
| 54 | |
| 55 | description: Configures the base-openstack service graph |
| 56 | |
| 57 | topology_template: |
| 58 | node_templates: |
| 59 | |
| 60 | service#vtn: |
| 61 | type: tosca.nodes.VTNService |
| 62 | properties: |
| 63 | name: vtn |
| 64 | must-exist: true |
| 65 | resync: false |
| 66 | |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 67 | service#ONOS_CORD: |
| 68 | type: tosca.nodes.ONOSService |
| 69 | properties: |
| 70 | name: ONOS_CORD |
| 71 | must-exist: true |
| 72 | |
| 73 | # NOTE this is defined in the onos-service TOSCA |
| 74 | onos_app#vtn: |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 75 | type: tosca.nodes.ONOSApp |
| 76 | properties: |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 77 | name: vtn |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 78 | must-exist: true |
| 79 | |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 80 | # NOTE this is defined in the vtn-service TOSCA |
| 81 | vtn_service_instance: |
| 82 | type: tosca.nodes.ServiceInstance |
| 83 | properties: |
| 84 | name: VTN config |
| 85 | must-exist: true |
| 86 | |
| 87 | onos_app#vtn_VTN_Service: |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 88 | type: tosca.nodes.ServiceInstanceLink |
| 89 | requirements: |
| 90 | - provider_service_instance: |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 91 | node: onos_app#vtn |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 92 | relationship: tosca.relationships.BelongsToOne |
| 93 | - subscriber_service: |
| 94 | node: service#vtn |
| 95 | relationship: tosca.relationships.BelongsToOne |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 96 | |
| 97 | link#vtn_to_vtn-config: |
| 98 | type: tosca.nodes.ServiceInstanceLink |
| 99 | requirements: |
| 100 | - subscriber_service_instance: |
| 101 | node: vtn_service_instance |
| 102 | relationship: tosca.relationships.BelongsToOne |
| 103 | - provider_service_instance: |
| 104 | node: onos_app#vtn |
| 105 | relationship: tosca.relationships.BelongsToOne |
| 106 | |
| 107 | service_dependency#onos-cord_vtn: |
| 108 | type: tosca.nodes.ServiceDependency |
| 109 | properties: |
Scott Baker | 1d40803 | 2018-08-29 08:34:49 -0700 | [diff] [blame] | 110 | connect_method: none |
Matteo Scandolo | 979695d | 2018-06-08 17:47:01 -0700 | [diff] [blame] | 111 | requirements: |
| 112 | - subscriber_service: |
| 113 | node: service#ONOS_CORD |
| 114 | relationship: tosca.relationships.BelongsToOne |
| 115 | - provider_service: |
| 116 | node: service#vtn |
| 117 | relationship: tosca.relationships.BelongsToOne |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 118 | {{- end -}} |
| 119 | |
| 120 | {{- define "base-openstack.testTosca" -}} |
| 121 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 122 | |
| 123 | imports: |
| 124 | - custom_types/flavor.yaml |
| 125 | - custom_types/image.yaml |
| 126 | - custom_types/site.yaml |
| 127 | - custom_types/network.yaml |
| 128 | - custom_types/networkslice.yaml |
| 129 | - custom_types/slice.yaml |
| 130 | |
| 131 | description: for testing basic openstack functionality |
| 132 | |
| 133 | topology_template: |
| 134 | node_templates: |
| 135 | |
| 136 | Ubuntu-14.04: |
| 137 | type: tosca.nodes.Image |
| 138 | properties: |
| 139 | name: "Ubuntu 14.04 64-bit" |
| 140 | disk_format: QCOW2 |
| 141 | container_format: BARE |
| 142 | path: https://github.com/opencord/platform-install/releases/download/vms/trusty-server-cloudimg-amd64-disk1.img.20170201 |
| 143 | |
| 144 | {{ .Values.cordSiteName }}: |
| 145 | type: tosca.nodes.Site |
| 146 | properties: |
| 147 | name: {{ .Values.cordSiteName }} |
| 148 | must-exist: true |
| 149 | |
| 150 | # Define a test slice |
| 151 | {{ .Values.cordSiteName }}_test: |
| 152 | description: Test Slice |
| 153 | type: tosca.nodes.Slice |
| 154 | properties: |
| 155 | # network: noauto |
| 156 | name: {{ .Values.cordSiteName }}_test |
| 157 | requirements: |
| 158 | - site: |
| 159 | node: {{ .Values.cordSiteName }} |
| 160 | relationship: tosca.relationships.BelongsToOne |
| 161 | - default_image: |
| 162 | node: Ubuntu-14.04 |
| 163 | relationship: tosca.relationships.BelongsToOne |
| 164 | |
| 165 | management: |
| 166 | type: tosca.nodes.Network |
| 167 | properties: |
| 168 | name: management |
| 169 | must-exist: true |
| 170 | |
| 171 | # Connect test slice to management net |
| 172 | networkslice#management_to_{{ .Values.cordSiteName }}_test: |
| 173 | type: tosca.nodes.NetworkSlice |
| 174 | requirements: |
| 175 | - network: |
| 176 | node: management |
| 177 | relationship: tosca.relationships.BelongsToOne |
| 178 | - slice: |
| 179 | node: {{ .Values.cordSiteName }}_test |
| 180 | relationship: tosca.relationships.BelongsToOne |
Andy Bavier | 6e6191a | 2018-05-22 14:53:10 -0700 | [diff] [blame] | 181 | {{- end -}} |
| 182 | |
| 183 | {{- define "base-openstack.computeNodeTosca" -}} |
| 184 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 185 | |
| 186 | imports: |
| 187 | - custom_types/deployment.yaml |
| 188 | - custom_types/node.yaml |
| 189 | - custom_types/site.yaml |
| 190 | - custom_types/sitedeployment.yaml |
| 191 | |
| 192 | description: Adds OpenStack compute nodes |
| 193 | |
| 194 | topology_template: |
| 195 | node_templates: |
| 196 | |
| 197 | # Site/Deployment, fully defined in deployment.yaml |
| 198 | site: |
| 199 | type: tosca.nodes.Site |
| 200 | properties: |
| 201 | name: {{ .Values.cordSiteName }} |
| 202 | must-exist: true |
| 203 | |
Andy Bavier | 6e6191a | 2018-05-22 14:53:10 -0700 | [diff] [blame] | 204 | site_deployment: |
| 205 | type: tosca.nodes.SiteDeployment |
| 206 | requirements: |
| 207 | - site: |
| 208 | node: site |
| 209 | relationship: tosca.relationships.BelongsToOne |
| 210 | - deployment: |
| 211 | node: deployment |
| 212 | relationship: tosca.relationships.BelongsToOne |
| 213 | |
| 214 | # OpenStack compute nodes |
| 215 | |
| 216 | {{- range .Values.computeNodes }} |
| 217 | {{ .name }}: |
| 218 | type: tosca.nodes.Node |
| 219 | properties: |
| 220 | name: {{ .name }} |
| 221 | bridgeId: {{ .bridgeId }} |
| 222 | dataPlaneIntf: {{ .dataPlaneIntf }} |
| 223 | dataPlaneIp: {{ .dataPlaneIp }} |
| 224 | requirements: |
| 225 | - site_deployment: |
| 226 | node: site_deployment |
| 227 | relationship: tosca.relationships.BelongsToOne |
| 228 | {{- end }} |
| 229 | {{- end -}} |