Deploy Example Application

When trying out Steadybit you may want to start easy instead of directly using your fully fledged system. Therefore, we have a small example application called Shopping Demo which you can easily deploy on a local minikube or AWS EKS using this guide.

Simply follow these two steps:

Prerequisites

Step 1 - Have a look a the example application

In order to give you a quick and easy start, we have developed a small demo application. Our shopping demo is a small product catalog provided by seven distributed backend services and a simple UI.

If you want to learn more about our demo, please take a look at our GitHub repository: https://github.com/steadybit/shopping-demo

Step 2 - Deploy the example application

The example application is already pre-configured to be deployed into a Kubernetes cluster. You can choose whether to deploy it into a) local minikube installation or b) AWS EKS.

Kubernetes, also known as k8s, is an open source system for automating the deployment, scaling, and management of containerized applications. You can use minikube to set up a local Kubernetes cluster on macOS, Linux or Windows. As an alternative choose AWS EKS to set up a Kubernetes cluster in the cloud.

Make sure to install the agents afterwards into the same environment.

Step 2a) Deploy on Minikube

Prerequisite

  • You have a running minikube installation

Start your minikube cluster

From a terminal, run:

minikube start

You can access your cluster with:

kubectl get po -A

Deploy the example application

Now we use helm to deploy the demo by running the following command:

helm repo add steadybit-shopping-demo https://steadybit.github.io/shopping-demo
helm repo update
helm upgrade steadybit-shopping-demo \
    --install \
    --wait \
    --timeout 5m0s \
    steadybit-shopping-demo/steadybit-shopping-demo

Verify that all Shopping Demo pods are running:

kubectl get pods --namespace steadybit-demo

You will see the following result, all pods are ready if you can see the status Running:

NAME                                  READY   STATUS    RESTARTS   AGE
fashion-bestseller-79b9698f88-557vt   1/1     Running   0          11s
gateway-7fc74f7f9b-tshzg              1/1     Running   0          11s
hot-deals-75cb898ff7-wrnxc            1/1     Running   0          10s
postgres-68f9db56cc-wxxth             1/1     Running   0          10s
toys-bestseller-6df5bd864f-kzrt9      1/1     Running   0          11s
orders-dcf644b8-g277b                 1/1     Pending   0          10s
inventory-7895d47cb7-sfdqb            1/1     Pending   0          10s
activemq-6dd55b4b7-wqmk6              1/1     Running   0          11s

The command minikube tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP.

minikube tunnel

With the following command you can now determine the external IP and port to access the gateway service:

kubectl get svc -n steadybit-demo

Example response:

NAME                 TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
fashion-bestseller   NodePort       -------------    <none>        ----:-----/---   ---
gateway              LoadBalancer   10.98.173.27     127.0.0.1     80:30131/TCP     3h15m
hot-deals            NodePort       -------------    <none>        ----:-----/---   ---
product-db           NodePort       -------------    <none>        ----:-----/---   ---
toys-bestseller      NodePort       -------------    <none>        ----:-----/---   ---
orders               NodePort       -------------    <none>        ----:-----/---   ---
inventory            NodePort       -------------    <none>        ----:-----/---   ---
activemq             NodePort       -------------    <none>        ----:-----/---   ---

Visit http://{EXTERNAL-IP}:{PORT}/products in your browser to retrieve the aggregated list of all products or just use curl:

curl http://{EXTERNAL-IP}:{PORT}/products

The result is an aggregated list of all products of the services toys, hot-deals and fashion:

{
  "fashionResponse": {
    "responseType": "REMOTE_SERVICE",
    "products": [
      {
        "id": "e9f0bec4-989c-4b9f-8bf9-334622e915ad",
        "name": "Bob Mailor Slim Jeans",
        "category": "FASHION"
      },
      {
        "id": "b110185b-d808-4104-b605-08a90b1248ce",
        "name": "Lewi's Jeanshose 511 Slim Fit",
        "category": "FASHION"
      },
      {
        "id": "222d7084-3cc7-43c3-890f-4598aa44eb2f",
        "name": "Urban Classics Shirt Shaped Long Tee",
        "category": "FASHION"
      }
    ]
  },
  "toysResponse": {
    "responseType": "REMOTE_SERVICE",
    "products": [
      ...
    ]
  },
  "hotDealsResponse": {
    "responseType": "REMOTE_SERVICE",
    "products": [
      ...
    ]
  },
  "duration": 112,
  "statusFashion": "REMOTE_SERVICE",
  "statusToys": "REMOTE_SERVICE",
  "statusHotDeals": "REMOTE_SERVICE"
}

Step 2b) Deploy on AWS EKS

Prerequisites

Create your AWS Elastic Kubernetes Service (AWS EKS) cluster and nodes

Verfiy your AWS CLI configuration by running:

aws --version

Your output should be similiar to:

aws-cli/2.0.44 Python/3.8.5 Darwin/19.6.0 source/x86_64

Create your Amazon EKS cluster and containing 2 nodes by running the following command. More details are available at AWS documentation

From a terminal, run:

eksctl create cluster \
--name steadybit-demo-cluster \
--region us-west-2

You can access your cluster with:

kubectl get nodes

Your output should be look like:

NAME                                           STATUS   ROLES    AGE    VERSION
ip-192-168-53-195.us-west-2.compute.internal   Ready    <none>   113s   v1.17.12-eks-7684af
ip-192-168-68-23.us-west-2.compute.internal    Ready    <none>   118s   v1.17.12-eks-7684af

Deploy the Shopping Demo

Now we use kubectl to deploy the demo by running the following command:

helm repo add steadybit-shopping-demo https://steadybit.github.io/shopping-demo
helm repo update
helm upgrade steadybit-shopping-demo \
    --install \
    --wait \
    --timeout 5m0s \
    -f <path-to-your-optional-values.yaml> \
    steadybit-shopping-demo/steadybit-shopping-demo

Maybe you need to edit some ingress hosts names in your own values.yaml file.

Verify that all Shopping Demo pods are running:

kubectl get pods --namespace steadybit-demo

You will see the following result, all pods are ready if you can see the status Running:

NAME                                  READY   STATUS    RESTARTS   AGE
fashion-bestseller-79b9698f88-557vt   1/1     Running   0          11s
gateway-7fc74f7f9b-tshzg              1/1     Running   0          11s
hot-deals-75cb898ff7-wrnxc            1/1     Running   0          10s
postgres-68f9db56cc-wxxth             1/1     Running   0          10s
toys-bestseller-6df5bd864f-kzrt9      1/1     Running   0          11s
orders-dcf644b8-g277b                 1/1     Pending   0          10s
inventory-7895d47cb7-sfdqb            1/1     Pending   0          10s
activemq-6dd55b4b7-wqmk6              1/1     Running   0          11s

With the following command you can now determine the external IP and port to access the gateway service:

kubectl get svc -n steadybit-demo

Example response:

NAME                 TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
fashion-bestseller   NodePort       -------------    <none>        ----:-----/---   ---
gateway              LoadBalancer   10.98.173.27     127.0.0.1     80:30131/TCP     3h15m
hot-deals            NodePort       -------------    <none>        ----:-----/---   ---
product-db           NodePort       -------------    <none>        ----:-----/---   ---
toys-bestseller      NodePort       -------------    <none>        ----:-----/---   ---
orders               NodePort       -------------    <none>        ----:-----/---   ---
inventory            NodePort       -------------    <none>        ----:-----/---   ---
activemq             NodePort       -------------    <none>        ----:-----/---   ---

Visit http://{EXTERNAL-IP}:{PORT}/products in your browser to retrieve the aggregated list of all products or just use curl:

curl http://{EXTERNAL-IP}:{PORT}/products

The result is an aggregated list of all products of the services toys, hot-deals and fashion:

{
  "fashionResponse": {
    "responseType": "REMOTE_SERVICE",
    "products": [
      {
        "id": "e9f0bec4-989c-4b9f-8bf9-334622e915ad",
        "name": "Bob Mailor Slim Jeans",
        "category": "FASHION"
      },
      {
        "id": "b110185b-d808-4104-b605-08a90b1248ce",
        "name": "Lewi's Jeanshose 511 Slim Fit",
        "category": "FASHION"
      },
      {
        "id": "222d7084-3cc7-43c3-890f-4598aa44eb2f",
        "name": "Urban Classics Shirt Shaped Long Tee",
        "category": "FASHION"
      }
    ]
  },
  "toysResponse": {
    "responseType": "REMOTE_SERVICE",
    "products": [
      ...
    ]
  },
  "hotDealsResponse": {
    "responseType": "REMOTE_SERVICE",
    "products": [
      ...
    ]
  },
  "duration": 112,
  "statusFashion": "REMOTE_SERVICE",
  "statusToys": "REMOTE_SERVICE",
  "statusHotDeals": "REMOTE_SERVICE"
}

Next Steps

Now, make sure to install the agents into the same environment (minikube or AWS EKS).

Last updated