diff --git a/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/Chart.yaml b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/Chart.yaml new file mode 100644 index 0000000..9f651bb --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/Chart.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +appVersion: 6.3.7 +description: "A Helm chart for FortiWeb" +name: fortinet-cnf +type: application +version: 0.5.0-1 diff --git a/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/templates/deployment.yaml b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/templates/deployment.yaml new file mode 100644 index 0000000..8c1e578 --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/templates/deployment.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fortiweb-cnf +spec: + replicas: {{.Values.replicaCount}} + selector: + matchLabels: + app: fortiweb-cnf + template: + metadata: + labels: + app: fortiweb-cnf + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + image: '{{.Values.global.registry.url}}/{{ .Values.global.imageName }}:{{ .Values.global.imageTag }}' + imagePullPolicy: Always + ports: + - containerPort: 8 + name: mgmt + - containerPort: 43 + name: gui + - containerPort: 996 + name: mgmt6 + - containerPort: 997 + name: mgmt7 + - name: http + containerPort: 80 + protocol: TCP + - name: https + containerPort: 443 + protocol: TCP + livenessProbe: + tcpSocket: + port: mgmt + initialDelaySeconds: 120 + periodSeconds: 10 + readinessProbe: + tcpSocket: + port: mgmt + initialDelaySeconds: 120 + periodSeconds: 10 + imagePullSecrets: + - name: {{ .Values.global.registry.pullSecret }} diff --git a/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/templates/service.yaml b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/templates/service.yaml new file mode 100644 index 0000000..76da2bd --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: fortiweb-cnf +spec: + type: LoadBalancer + loadBalancerIP: {{.Values.global.loadBalancerIP}} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + - port: {{ .Values.service.portssl }} + targetPort: https + protocol: TCP + name: https + - port: {{ .Values.service.gui }} + targetPort: gui + protocol: TCP + name: gui + selector: + app: fortiweb-cnf \ No newline at end of file diff --git a/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/values.yaml b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/values.yaml new file mode 100644 index 0000000..b7b8ff5 --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1/values.yaml @@ -0,0 +1,18 @@ +--- +global: + imageName: fortiweb-cnf + imageTag: 6.3.7 + loadBalancerIP: "10.223.160.60" + registry: + pullSecret: fortiweb-cnf + url: "registry.eccd-cnf.partnervnflab.xgic.ericsson.se:443" + replicaCount: 1 +imageCredentials: + registry: + url: "registry.eccd-cnf.partnervnflab.xgic.ericsson.se:443" + repoPath: "" +service: + type: NodePort + port: 80 + portssl: 443 + gui: 8443 diff --git a/fortiweb/fortiweb-cnf.csar/Definitions/fortiweb-cnf.yaml b/fortiweb/fortiweb-cnf.csar/Definitions/fortiweb-cnf.yaml new file mode 100644 index 0000000..9f988be --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/Definitions/fortiweb-cnf.yaml @@ -0,0 +1,76 @@ +--- +description: "fortiweb-cnf created to verify the lifecycle management on top of Ericsson NFVI" +ericsson.datatypes.nfv.ChangePackageVnfOperationAdditionalParameters: + derived_from: tosca.datatypes.nfv.VnfOperationAdditionalParameters + properties: + replicaCount: + default: 1 + required: true + type: string +metadata: + data_types: + ericsson.datatypes.nfv.InstantiateVnfOperationAdditionalParameters: + derived_from: tosca.datatypes.nfv.VnfOperationAdditionalParameters + properties: + load_balancer_IP: + default: "10.223.160.60" + metadata: + chart_param: global.loadBalancerIP + required: true + type: string + replicaCount: + default: 1 + required: true + type: string + name: fortiweb-cnf-descriptor + vendor: Fortinet + version: 0.5.0-1 +node_types: + derived_from: tosca.nodes.nfv.VNF + descriptor_id: + default: 31f8c39b-9a60-4040-bf9b-2a7a6155df1f + type: string + descriptor_version: + default: 0.5.0-1 + type: string + interfaces: + Vnflcm: + change_package: + inputs: + additional_parameters: + required: false + type: ericsson.datatypes.nfv.ChangePackageVnfOperationAdditionalParameters + instantiate: + inputs: + additional_parameters: + required: false + type: ericsson.datatypes.nfv.InstantiateVnfOperationAdditionalParameters + terminate: ~ + type: tosca.interfaces.nfv.Vnflcm + artifacts: + helm_package: + description: "Helm package associated with this descriptor" + file: Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1.tgz + type: tosca.artifacts.File + software_images: + description: "Location of the CNF images being used in this package" + file: Files/fortiweb-6.3.7.tgz + type: tosca.artifacts.nfv.SwImage + product_name: + default: fortiweb-cnf + type: string + properties: + provider: + default: Fortinet + type: string + fortiweb-cnf: ~ + software_version: + default: 6.3.7 + type: string + vnfm_info: + default: + - EVNFM + entry_schema: + type: string + type: list +tosca_definitions_version: tosca_simple_yaml_1_2 diff --git a/fortiweb/fortiweb-cnf.csar/TOSCA-Metadata/TOSCA.meta b/fortiweb/fortiweb-cnf.csar/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 0000000..f68239f --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,6 @@ +CSAR-Version: '1.1' +Created-By: Fortinet +Entry-Definitions: Definitions/fortiweb-cnf.yaml +Entry-Helm-Definitions: Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1.tgz +Entry-Images: Files/fortiweb-6.3.7.tgz +TOSCA-Meta-File-Version: '1.0' \ No newline at end of file diff --git a/fortiweb/fortiweb-cnf.csar/build.sh b/fortiweb/fortiweb-cnf.csar/build.sh new file mode 100755 index 0000000..cc65af8 --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash -ex + +echo "build CSAR" +TEMPDIR=`mktemp -d` +ROOT=`pwd` +FILES=$(fgrep "Entry-" TOSCA-Metadata/TOSCA.meta |awk '{print $2}') +cd Definitions/OtherTemplates/fortiweb-cnf-0.5.0-1 +tar cvzf ../fortiweb-cnf-0.5.0-1.tgz * +cd $ROOT +cp fortiweb-cnf.mf.meta fortiweb-cnf.mf +echo "" >> fortiweb-cnf.mf +echo "Artifacts:" >> fortiweb-cnf.mf +for file in $FILES +do + SHA512=$(sha512sum $file|awk '{print $1}') + echo "Source: $file" >>fortiweb-cnf.mf + echo "Algorithm: SHA512" >>fortiweb-cnf.mf + echo "Hash: $SHA512" >>fortiweb-cnf.mf + echo "" >> fortiweb-cnf.mf +done +tar cvzf fortiweb-cnf.csar.tgz fortiweb-cnf.mf Definitions/ Files/ TOSCA-Metadata/ diff --git a/fortiweb/fortiweb-cnf.csar/fortiweb-cnf.mf.meta b/fortiweb/fortiweb-cnf.csar/fortiweb-cnf.mf.meta new file mode 100644 index 0000000..8219514 --- /dev/null +++ b/fortiweb/fortiweb-cnf.csar/fortiweb-cnf.mf.meta @@ -0,0 +1,5 @@ +metadata: +vnf_product_name: fortinet-cnf +vnf_provider_id: Fortinet +vnf_package_version: 1 +vnf_release_date_time: 2020-22-05T13:00:00+01:00