You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2015/02/26 09:13:17 UTC

stratos git commit: Adding single-group-cartridge sample

Repository: stratos
Updated Branches:
  refs/heads/master-deployment-policy-fix-merge 0b7091300 -> f5e2a81db


Adding single-group-cartridge sample


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f5e2a81d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f5e2a81d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f5e2a81d

Branch: refs/heads/master-deployment-policy-fix-merge
Commit: f5e2a81dba3f807327ed2799b9bbc156eca9ae30
Parents: 0b70913
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Thu Feb 26 13:43:09 2015 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Thu Feb 26 13:43:09 2015 +0530

----------------------------------------------------------------------
 .../single-group-cartridge/README.md            | 15 +++++
 .../artifacts/application-policy.json           | 12 ++++
 .../artifacts/application.json                  | 70 ++++++++++++++++++++
 .../artifacts/autoscaling-policy.json           | 14 ++++
 .../artifacts/deployment-policy.json            | 15 +++++
 .../artifacts/ec2/deployment-policy.json        | 56 ++++++++++++++++
 .../artifacts/kubernetes/deployment-policy.json | 57 ++++++++++++++++
 .../kubernetes/kubernetes-cluster.json          | 56 ++++++++++++++++
 .../artifacts/mock/deployment-policy.json       | 56 ++++++++++++++++
 .../artifacts/network-partition-2.json          | 15 +++++
 .../artifacts/network-partition.json            | 15 +++++
 .../artifacts/openstack/deployment-policy.json  | 56 ++++++++++++++++
 .../scripts/common/deploy.sh                    | 53 +++++++++++++++
 .../scripts/common/undeploy.sh                  | 25 +++++++
 .../scripts/ec2/deploy.sh                       |  9 +++
 .../scripts/ec2/undeploy.sh                     |  7 ++
 .../scripts/kubernetes/deploy.sh                | 15 +++++
 .../scripts/kubernetes/undeploy.sh              | 13 ++++
 .../scripts/mock/deploy.sh                      |  9 +++
 .../scripts/mock/undeploy.sh                    |  7 ++
 .../scripts/openstack/deploy.sh                 |  9 +++
 .../scripts/openstack/undeploy.sh               |  7 ++
 22 files changed, 591 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/README.md b/samples/applications/single-group-cartridge/README.md
new file mode 100644
index 0000000..294a1a2
--- /dev/null
+++ b/samples/applications/single-group-cartridge/README.md
@@ -0,0 +1,15 @@
+single_group_v1
+==============
+
+Application folder structure
+----------------------------
+-- artifacts/<iaas>/ IaaS specific artifacts
+-- scripts/common/ Common scripts for all iaases
+-- scripts/<iaas> IaaS specific scripts
+
+How to run
+----------
+cd scripts/<iaas>/
+./deploy.sh
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/application-policy.json b/samples/applications/single-group-cartridge/artifacts/application-policy.json
new file mode 100644
index 0000000..5aa91dd
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/application-policy.json
@@ -0,0 +1,12 @@
+{
+   "networkPartition":[
+      {
+         "id":"network-partition-1",
+         "activeByDefault":"true"
+      },
+      {
+         "id":"network-partition-2",
+         "activeByDefault":"false"
+      }
+   ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/application.json b/samples/applications/single-group-cartridge/artifacts/application.json
new file mode 100644
index 0000000..a508609
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/application.json
@@ -0,0 +1,70 @@
+{
+    "applicationId": "cartridge-group-app",
+    "alias": "my-cartridge-group-app",
+    "components": {
+        "groups": [
+            {
+                "name": "esb-php-group",
+                "alias": "my-esb-php-group",
+                "groupMinInstances": 1,
+                "groupMaxInstances": 2,
+                "cartridges": [
+                    {
+                        "type": "esb",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "my-esb",
+                            "autoscalingPolicy": "autoscaling-policy-1",
+                	    "deploymentPolicy":"deployment-policy-1",
+			    "artifactRepository":{
+                                "privateRepo":false,
+                                "repoUrl":"https://github.com/imesh/stratos-esb-applications.git",
+                                "repoUsername":"",
+                                "repoPassword":""
+                            }
+                        }
+                    },
+                    {
+                        "type": "php",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "my-php",
+                            "autoscalingPolicy": "autoscaling-policy-1",
+                 	    "deploymentPolicy":"deployment-policy-1",
+                            "artifactRepository":{
+                                "privateRepo":false,
+                                "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
+                                "repoUsername":"",
+                                "repoPassword":""
+                            }
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 2,
+                "cartridgeMax": 4,
+                "subscribableInfo": {
+                    "alias": "my-tomcat",
+                    "autoscalingPolicy": "autoscaling-policy-1",
+                    "deploymentPolicy":"deployment-policy-1",
+                    "artifactRepository":{
+                        "privateRepo":false,
+                        "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+                        "repoUsername":"",
+                        "repoPassword":""
+                    }
+                }
+            }
+        ],
+        "dependencies": {
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/autoscaling-policy.json b/samples/applications/single-group-cartridge/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..2f670f6
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 50
+        },
+        "memoryConsumption": {
+            "threshold": 70
+        },
+        "loadAverage": {
+            "threshold": 1000
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/deployment-policy.json b/samples/applications/single-group-cartridge/artifacts/deployment-policy.json
new file mode 100644
index 0000000..666c299
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/deployment-policy.json
@@ -0,0 +1,15 @@
+{
+   "id": "deployment-policy-1",
+   "networkPartition": [
+      {
+         "id": "network-partition-1",
+         "partitionAlgo": "one-after-another",
+         "partitions": [
+            {
+               "id": "partition-1",
+               "max": 5
+            }
+         ]
+      }
+   ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/ec2/deployment-policy.json b/samples/applications/single-group-cartridge/artifacts/ec2/deployment-policy.json
new file mode 100644
index 0000000..8f58f61
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/ec2/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "cartridge-group-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "network-partition-1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "partition-1",
+                        "provider": "ec2",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "ap-southeast-1"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "my-tomcat",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "my-esb-php-group",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/kubernetes/deployment-policy.json b/samples/applications/single-group-cartridge/artifacts/kubernetes/deployment-policy.json
new file mode 100644
index 0000000..7b19958
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/kubernetes/deployment-policy.json
@@ -0,0 +1,57 @@
+{
+    "applicationId": "cartridge-group-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id":"network-partition-1",
+                "kubernetesClusterId":"kubernetes-cluster-1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "partition-1",
+                        "provider": "kubernetes",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "default"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "my-tomcat",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "my-esb-php-group",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/single-group-cartridge/artifacts/kubernetes/kubernetes-cluster.json
new file mode 100644
index 0000000..2988ed1
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/kubernetes/kubernetes-cluster.json
@@ -0,0 +1,56 @@
+{
+    "clusterId": "kubernetes-cluster-1",
+    "description": "Kubernetes CoreOS cluster",
+    "kubernetesMaster": {
+        "hostId": "KubHostMaster1",
+        "hostname": "master.dev.kubernetes.example.org",
+        "privateIPAddress": "172.17.8.100",
+        "publicIPAddress": "172.17.8.100",
+        "property": [
+        ]
+    },
+    "portRange": {
+        "upper": "5000",
+        "lower": "4500"
+    },
+    "kubernetesHosts": [
+        {
+            "hostId": "KubHostSlave1",
+            "hostname": "slave1.dev.kubernetes.example.org",
+            "privateIPAddress": "172.17.8.101",
+            "publicIPAddress": "172.17.8.101",
+            "property": [
+            ]
+        },
+        {
+            "hostId": "KubHostSlave2",
+            "hostname": "slave2.dev.kubernetes.example.org",
+            "privateIPAddress": "172.17.8.102",
+            "publicIPAddress": "172.17.8.102",
+            "property": [
+            ]
+        }
+    ],
+    "property": [
+        {
+            "name": "payload_parameter.MB_IP",
+            "value": "172.17.8.1"
+        },
+        {
+            "name": "payload_parameter.MB_PORT",
+            "value": "1883"
+        },
+        {
+            "name": "payload_parameter.CEP_IP",
+            "value": "172.17.8.1"
+        },
+        {
+            "name": "payload_parameter.CEP_PORT",
+            "value": "7711"
+        },
+        {
+            "name": "payload_parameter.LOG_LEVEL",
+            "value": "DEBUG"
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/mock/deployment-policy.json b/samples/applications/single-group-cartridge/artifacts/mock/deployment-policy.json
new file mode 100644
index 0000000..bce6767
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/mock/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "cartridge-group-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "network-partition-1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "partition-1",
+                        "provider": "mock",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "my-tomcat",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "my-esb-php-group",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/network-partition-2.json b/samples/applications/single-group-cartridge/artifacts/network-partition-2.json
new file mode 100644
index 0000000..0d07838
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/network-partition-2.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-2",
+    "partitions": [
+        {
+            "id": "partition-2",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/network-partition.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/network-partition.json b/samples/applications/single-group-cartridge/artifacts/network-partition.json
new file mode 100644
index 0000000..2a5b7ec
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/network-partition.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-1",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/openstack/deployment-policy.json b/samples/applications/single-group-cartridge/artifacts/openstack/deployment-policy.json
new file mode 100644
index 0000000..b205147
--- /dev/null
+++ b/samples/applications/single-group-cartridge/artifacts/openstack/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "cartridge-group-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "network-partition-1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "partition-1",
+                        "provider": "openstack",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "my-tomcat",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "myesb-php-group",
+            "networkPartition": [
+                {
+                    "id": "network-partition-1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "partition-1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/common/deploy.sh b/samples/applications/single-group-cartridge/scripts/common/deploy.sh
new file mode 100755
index 0000000..63ad95d
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/common/deploy.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
+cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+    echo "Usage: deploy.sh [iaas]"
+    exit
+fi
+
+echo ${artifacts_path}/autoscaling-policy.json
+echo "Adding autoscale policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+
+echo "Adding deployment policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding esb cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/esb.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding esb-php-group group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/esb-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+sleep 1
+
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
+
+sleep 1
+
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/cartridge-group-app/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/common/undeploy.sh b/samples/applications/single-group-cartridge/scripts/common/undeploy.sh
new file mode 100644
index 0000000..fc3ca90
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/common/undeploy.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Undeploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/cartridge-group-app/undeploy
+
+sleep 10
+
+echo "Deleting application..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/cartridge-group-app
+
+echo "Removing groups..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/esb-php-group
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/esb
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh b/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="ec2"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh b/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh b/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..32eff3c
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+iaas="kubernetes"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+
+bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh b/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
+
+echo "Removing kubernetes cluster..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters/kubernetes-cluster-1

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/mock/deploy.sh b/samples/applications/single-group-cartridge/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+iaas="mock"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/mock/undeploy.sh b/samples/applications/single-group-cartridge/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/mock/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/openstack/deploy.sh b/samples/applications/single-group-cartridge/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/openstack/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="openstack"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e2a81d/samples/applications/single-group-cartridge/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/openstack/undeploy.sh b/samples/applications/single-group-cartridge/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/single-group-cartridge/scripts/openstack/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh