diff options
Diffstat (limited to 'src/tools/emcoctl')
-rw-r--r-- | src/tools/emcoctl/cmd/utils.go | 2 | ||||
-rw-r--r-- | src/tools/emcoctl/examples/test.yaml | 73 | ||||
-rw-r--r-- | src/tools/emcoctl/examples/vfw.yaml | 137 |
3 files changed, 105 insertions, 107 deletions
diff --git a/src/tools/emcoctl/cmd/utils.go b/src/tools/emcoctl/cmd/utils.go index d266a00f..5e063d12 100644 --- a/src/tools/emcoctl/cmd/utils.go +++ b/src/tools/emcoctl/cmd/utils.go @@ -332,7 +332,7 @@ func GetURL(anchor string) (string, error) { baseUrl = GetDcmURL() break } - if len(s) >= 6 && s[5] == "network-controller-intent" { + if len(s) >= 8 && s[7] == "network-controller-intent" { baseUrl = GetOvnactionURL() break } diff --git a/src/tools/emcoctl/examples/test.yaml b/src/tools/emcoctl/examples/test.yaml index e54ff36e..f660f748 100644 --- a/src/tools/emcoctl/examples/test.yaml +++ b/src/tools/emcoctl/examples/test.yaml @@ -8,8 +8,8 @@ metadata : userData1: test1 userData2: test2 spec: - host: localhost - port: 9031 + host: rsync + port: 9041 --- #creating cluster provider @@ -33,7 +33,7 @@ metadata : userData1: test1 userData2: test2 file: - /home/otc/.kube/config + /home/vagrant/.kube/config --- #Add label cluster @@ -137,23 +137,51 @@ file: --- +#create deployment intent group +version: emco/v2 +resourceContext: + anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups +metadata : + name: collection-deployment-intent-group + description: "description" + userData1: test1 + userData2: test2 +spec: + profile: collection-composite-profile + version: r1 + logical-cloud: NA + override-values: [] + +--- +#create intent in deployment intent group +version: emco/v2 +resourceContext: + anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups/collection-deployment-intent-group/intents +metadata : + name: collection-deployment-intent + description: "description" + userData1: test1 + userData2: test2 +spec: + intent: + genericPlacementIntent: collection-placement-intent + +--- #create the generic placement intent version: emco/v2 resourceContext: - anchor: projects/proj1/composite-apps/collection-composite-app/v1/generic-placement-intents + anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups/collection-deployment-intent-group/generic-placement-intents metadata : name: collection-placement-intent description: "description for app" userData1: test1 userData2: test2 -spec: - logical-cloud: NA --- #add the prometheus app placement intent to the generic placement intent version: emco/v2 resourceContext: - anchor: projects/proj1/composite-apps/collection-composite-app/v1/generic-placement-intents/collection-placement-intent/app-intents + anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups/collection-deployment-intent-group/generic-placement-intents/collection-placement-intent/app-intents metadata: name: prometheus-placement-intent description: description of placement_intent @@ -169,7 +197,7 @@ spec: #add the prometheus app placement intent to the generic placement intent version: emco/v2 resourceContext: - anchor: projects/proj1/composite-apps/collection-composite-app/v1/generic-placement-intents/collection-placement-intent/app-intents + anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups/collection-deployment-intent-group/generic-placement-intents/collection-placement-intent/app-intents metadata: name: collectd-placement-intent description: description of placement_intent @@ -183,35 +211,6 @@ spec: cluster-label-name: edge-cluster --- -#create deployment intent group -version: emco/v2 -resourceContext: - anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups -metadata : - name: collection-deployment-intent-group - description: "description" - userData1: test1 - userData2: test2 -spec: - profile: collection-composite-profile - version: r1 - override-values: [] - ---- -#create intent in deployment intent group -version: emco/v2 -resourceContext: - anchor: projects/proj1/composite-apps/collection-composite-app/v1/deployment-intent-groups/collection-deployment-intent-group/intents -metadata : - name: collection-deployment-intent - description: "description" - userData1: test1 - userData2: test2 -spec: - intent: - genericPlacementIntent: collection-placement-intent - ---- #Approve version: emco/v2 resourceContext: diff --git a/src/tools/emcoctl/examples/vfw.yaml b/src/tools/emcoctl/examples/vfw.yaml index c84a1bab..251c892d 100644 --- a/src/tools/emcoctl/examples/vfw.yaml +++ b/src/tools/emcoctl/examples/vfw.yaml @@ -3,7 +3,7 @@ version: emco/v2 resourceContext: anchor: controllers metadata : - name: rsync + name: rsync spec: host: "192.168.121.6" port: 30546 @@ -14,10 +14,10 @@ version: emco/v2 resourceContext: anchor: controllers metadata : - name: ovnaction + name: ovnaction spec: - host: "192.168.121.6" - port: 32259 + host: "ovnaction" + port: 9053 type: "action" priority: 1 @@ -28,7 +28,7 @@ version: emco/v2 resourceContext: anchor: cluster-providers metadata : - name: vfw-cluster-provider + name: vfw-cluster-provider --- #creating cluster @@ -36,7 +36,7 @@ version: emco/v2 resourceContext: anchor: cluster-providers/vfw-cluster-provider/clusters metadata : - name: edge01 + name: edge01 file: /home/otc/.kube/config @@ -65,7 +65,7 @@ version: emco/v2 resourceContext: anchor: cluster-providers/vfw-cluster-provider/clusters/edge01/networks metadata: - name: emco-unprotected-net + name: unprotected-private-net spec: cniType: ovn4nfv ipv4Subnets: @@ -184,20 +184,52 @@ file: /opt/csar/cb009bfe-bbee-11e8-9766-525400435678/profile.tar.gz --- -#create the generic placement intent +#create deployment intent group version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/generic-placement-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups metadata : - name: fw-placement-intent + name: vfw_deployment_intent_group spec: + profile: vfw_composite-profile + version: r1 logical-cloud: NA + override-values: + - app-name: packetgen + values: + ".Values.service.ports.nodePort": '30888' + - app-name: firewall + values: + ".Values.global.dcaeCollectorIp": 1.2.3.4 + ".Values.global.dcaeCollectorPort": '8888' + - app-name: sink + values: + ".Values.service.ports.nodePort": '30677' + +--- +version: emco/v2 +resourceContext: + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/intents +metadata : + name: fw-deployment-intent +spec: + intent: + genericPlacementIntent: fw-placement-intent + ovnaction: vfw_ovnaction_intent + +--- +#create the generic placement intent +version: emco/v2 +resourceContext: + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/generic-placement-intents +metadata : + name: fw-placement-intent --- #add the packetgen app placement intent to the generic placement intent version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/generic-placement-intents/fw-placement-intent/app-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/generic-placement-intents/fw-placement-intent/app-intents metadata: name: packetgen-placement-intent spec: @@ -210,7 +242,7 @@ spec: #add the firewall app placement intent to the generic placement intent version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/generic-placement-intents/fw-placement-intent/app-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/generic-placement-intents/fw-placement-intent/app-intents metadata: name: firewall-placement-intent spec: @@ -224,7 +256,7 @@ spec: #add the sink app placement intent to the generic placement intent version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/generic-placement-intents/fw-placement-intent/app-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/generic-placement-intents/fw-placement-intent/app-intents metadata: name: sink-placement-intent spec: @@ -235,20 +267,20 @@ spec: cluster-label-name: LabelA --- -#creating cluster provider +#creating network intents version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent metadata : - name: vfw_ovnaction_intent + name: vfw_ovnaction_intent --- # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents metadata : - name: packetgen_workload_intent + name: packetgen_workload_intent spec: application-name: packetgen workload-resource: r1-packetgen @@ -258,9 +290,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents metadata : - name: firewall_workload_intent + name: firewall_workload_intent spec: application-name: firewall workload-resource: r1-firewall @@ -270,9 +302,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents metadata : - name: sink_workload_intent + name: sink_workload_intent spec: application-name: sink workload-resource: r1-sink @@ -282,9 +314,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/packetgen_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/packetgen_workload_intent/interfaces metadata : - name: packetgen_unprotected_if + name: packetgen_unprotected_if spec: interface: eth1 name: unprotected-private-net @@ -295,9 +327,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/packetgen_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/packetgen_workload_intent/interfaces metadata : - name: packetgen_emco_if + name: packetgen_emco_if spec: interface: eth2 name: emco-private-net @@ -308,9 +340,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/firewall_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/firewall_workload_intent/interfaces metadata : - name: firewall_emco_if + name: firewall_emco_if spec: interface: eth3 name: emco-private-net @@ -321,9 +353,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/firewall_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/firewall_workload_intent/interfaces metadata : - name: firewall_unprotected_if + name: firewall_unprotected_if spec: interface: eth1 name: unprotected-private-net @@ -334,9 +366,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/firewall_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/firewall_workload_intent/interfaces metadata : - name: firewall_protected_if + name: firewall_protected_if spec: interface: eth2 name: protected-private-net @@ -347,9 +379,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/sink_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/sink_workload_intent/interfaces metadata : - name: sink_protected_if + name: sink_protected_if spec: interface: eth1 name: protected-private-net @@ -360,9 +392,9 @@ spec: # version: emco/v2 resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/network-controller-intent/vfw_ovnaction_intent/workload-intents/sink_workload_intent/interfaces + anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/network-controller-intent/vfw_ovnaction_intent/workload-intents/sink_workload_intent/interfaces metadata : - name: sink_emco_if + name: sink_emco_if spec: interface: eth2 name: emco-private-net @@ -370,39 +402,6 @@ spec: ipAddress: 10.10.20.4 --- -#create deployment intent group -version: emco/v2 -resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups -metadata : - name: vfw_deployment_intent_group -spec: - profile: vfw_composite-profile - version: r1 - override-values: - - app-name: packetgen - values: - ".Values.service.ports.nodePort": '30888' - - app-name: firewall - values: - ".Values.global.dcaeCollectorIp": 1.2.3.4 - ".Values.global.dcaeCollectorPort": '8888' - - app-name: sink - values: - ".Values.service.ports.nodePort": '30677' - ---- -version: emco/v2 -resourceContext: - anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/intents -metadata : - name: fw-deployment-intent -spec: - intent: - genericPlacementIntent: fw-placement-intent - ovnaction: vfw_ovnaction_intent - ---- version: emco/v2 resourceContext: anchor: projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/approve |