DAY10介紹了TOSCA通用樣板,而今天要來實際去透過樣板去部屬FREE5GC
example: amf樣板
tosca_definitions_version: tosca_simple_yaml_1_0
topology_template:
node_templates:
VNF1:
type: tosca.nodes.nfv.VNF
properties:
descriptor_id: 367f45fd-1dd2-11b2-8001-080027b24amf
descriptor_version: 1.0
provider: imac
product_name: amf
software_version: latest
VDU1:
type: tosca.nodes.nfv.Vdu.Compute
properties:
sw_image_data:
name: free5gc-control-plane
provider: free5gmano
version: stage3.2.1-amd64
diskFormat: raw
capabilities:
virtual_compute:
properties:
virtual_memory:
virtual_mem_size: 512Mi
virtual_cpu:
num_virtual_cpu: 250m
artifacts:
sw_image:
type: tosca.artifacts.nfv.SwImage
file: free5gmano/free5gc-control-plane:stage3.2.1-amd64
amf:
type: tosca.artifacts.File
file: Files/Artifacts/amfcfg.conf
deploy_path: /free5gc/config/amfcfg.yaml
attributes:
namespace: default
name_of_service: free5gc-amf-svc
ports: [38412,29518]
name_of_nodeport: free5gc-amf-nodeport
protocol: [SCTP]
nodeport: [38412]
nodeport_protocol: [SCTP]
virtualport: [38412]
apply_cluster: Cloud-218
stateful_application: 0
replicas: 1
command: [sh, -c, sleep 15s && ./bin/amf]
CP1:
type: tosca.nodes.nfv.Cpd
properties:
layer_protocol: ipv4
requirements:
virtual_binding: VDU1
virtual_link: VL1
VL1:
type: tosca.nodes.nfv.VnfVirtualLink
properties:
network_name: management
vl_profile:
virtual_link_protocol_data:
l3_protocol_data:
dhcp_enabled: False
從amf的範例可以看到 這邊image名稱修改成我們之前部屬yaml的image,attributes中也新增了許多欄位(這部分是和所使用的nfvo能夠使用的欄位有關),artifacts裡面有定義free5gc的config file位置
而其他的樣板也是依照通樣的方式
撰寫好的3.2.1部屬的樣板有PR到nfvo的example中
free5gc 3.2.1 TOSCA
之後就上傳到free5gMANO
之後到NSS Template進行建立並實例化
到機器上可以看到部屬成功了
到這邊NFVO部屬就完成了,DAY12之後會開始講一些自製的服務,包含如何抓取PFCP封包與GTPU封包等