| garciaale | 76f6a62 | 2020-11-19 17:57:42 -0300 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 Whitestack LLC |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | module kdu { |
| 19 | yang-version 1.1; |
| 20 | namespace "urn:etsi:osm:yang:augments:kdu"; |
| 21 | prefix "kdu"; |
| 22 | |
| 23 | import etsi-nfv-vnfd { |
| 24 | prefix vnfd; |
| 25 | } |
| 26 | |
| garciaale | 76f6a62 | 2020-11-19 17:57:42 -0300 | [diff] [blame] | 27 | grouping extended-ext-cpd { |
| 28 | leaf k8s-cluster-net { |
| 29 | description |
| 30 | "Reference to the K8s cluster network |
| 31 | to which CPs instantiated from this external CP |
| 32 | Descriptor (CPD) connect."; |
| 33 | type leafref { |
| 34 | path "/vnfd:vnfd/kdu:k8s-cluster/kdu:nets/kdu:id"; |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| garciaale | 76f6a62 | 2020-11-19 17:57:42 -0300 | [diff] [blame] | 39 | grouping extended-kdu { |
| 40 | list kdu { |
| 41 | description |
| 42 | "List of K8s Deployment Units"; |
| 43 | key "name"; |
| 44 | |
| 45 | leaf name { |
| 46 | description |
| 47 | "Unique name for the KDU"; |
| 48 | type string; |
| 49 | } |
| 50 | |
| 51 | leaf description { |
| 52 | description |
| 53 | "Description of the KDU."; |
| 54 | type string; |
| 55 | } |
| garciadeblas | 7df1364 | 2020-12-10 17:32:36 +0000 | [diff] [blame] | 56 | |
| 57 | choice kdu-model { |
| 58 | description |
| 59 | "Indicates the KDU model, either as a helm-chart or as a juju-bundle."; |
| 60 | |
| 61 | case helm-chart { |
| 62 | leaf helm-chart { |
| 63 | description |
| 64 | "Helm chart that models the KDU, in any of the following ways: |
| 65 | - <helm-repo>/<helm-chart> |
| 66 | - <helm-chart folder under k8s_models folder in the package> |
| 67 | - <helm-chart tgz file (w/ or w/o extension) under k8s_models folder in the package> |
| 68 | - <URL_where_to_fetch_chart> |
| 69 | "; |
| 70 | type string; |
| 71 | } |
| 72 | |
| 73 | leaf helm-version { |
| 74 | description |
| 75 | "Helm version to use for this helm-chart, v3 by default"; |
| 76 | type enumeration { |
| garciadeblas | 7df1364 | 2020-12-10 17:32:36 +0000 | [diff] [blame] | 77 | enum v3; |
| 78 | } |
| 79 | default v3; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | case juju-bundle { |
| 84 | leaf juju-bundle { |
| 85 | description |
| 86 | "Juju bundle that models the KDU, in any of the following ways: |
| 87 | - <juju-repo>/<juju-bundle> |
| 88 | - <juju-bundle folder under k8s_models folder in the package> |
| 89 | - <juju-bundle tgz file (w/ or w/o extension) under k8s_models folder in the package> |
| 90 | - <URL_where_to_fetch_juju_bundle> |
| 91 | "; |
| 92 | type string; |
| 93 | } |
| 94 | } |
| 95 | } |
| garciadeblas | 1ab5b68 | 2021-09-29 17:24:36 +0200 | [diff] [blame] | 96 | |
| 97 | list service { |
| 98 | description |
| 99 | "List of Kubernetes services exposed by the KDU. |
| 100 | If empty, all services are assumed to be exposed in the CP associated to the first network |
| 101 | in k8s-cluster.nets."; |
| 102 | key name; |
| 103 | |
| 104 | leaf name { |
| 105 | description "Name of the Kubernetes service exposed by he KDU model"; |
| 106 | type string; |
| 107 | } |
| 108 | |
| 109 | leaf external-connection-point-ref { |
| 110 | description |
| 111 | "String representing a leaf reference to the particular external connection point. |
| 112 | This field should match /etsi-nfv-vnfd:vnfd/etsi-nfv-vnfd:ext-cpd/etsi-nfv-vnfd:id |
| 113 | "; |
| 114 | type string; |
| 115 | } |
| 116 | } |
| 117 | |
| garciaale | 76f6a62 | 2020-11-19 17:57:42 -0300 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | container k8s-cluster { |
| 121 | leaf-list version { |
| 122 | description |
| 123 | "List of supported K8s versions. |
| 124 | The cluster where the KDUs will be deployed will have to match |
| 125 | one of these versions."; |
| 126 | |
| 127 | type string; |
| 128 | } |
| 129 | |
| 130 | leaf-list cni { |
| 131 | description |
| 132 | "List of supported CNI plugins. |
| 133 | The cluster where the KDUs will be deployed will have to use |
| 134 | one of these CNI plugins."; |
| 135 | |
| 136 | type enumeration { |
| 137 | enum calico; |
| 138 | enum flannel; |
| 139 | enum multus; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | list nets { |
| 144 | description |
| 145 | "List of required networks in the K8s cluster. |
| 146 | The cluster where the KDUs will be deployed will have to use |
| 147 | one of these CNI plugins."; |
| 148 | |
| 149 | key "id"; |
| 150 | |
| 151 | leaf id { |
| 152 | description |
| 153 | "Internal identifier for the K8s cluster network in this VNF"; |
| 154 | type string; |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | augment "/vnfd:vnfd" { |
| 161 | uses extended-kdu; |
| garciaale | 76f6a62 | 2020-11-19 17:57:42 -0300 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | augment "/vnfd:vnfd/vnfd:ext-cpd/vnfd:cp-connection" { |
| 165 | uses extended-ext-cpd; |
| 166 | } |
| garciadeblas | 5989fe3 | 2020-12-14 15:37:31 +0000 | [diff] [blame] | 167 | } |