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