{"id":19759609,"url":"https://github.com/linuxacademy/content-minikube-robotshop","last_synced_at":"2025-04-30T12:33:09.120Z","repository":{"id":37341295,"uuid":"227869620","full_name":"linuxacademy/content-minikube-robotshop","owner":"linuxacademy","description":"Michael McClaren, Ubuntu Minikube 12.13.2019","archived":false,"fork":false,"pushed_at":"2022-06-21T02:26:31.000Z","size":17085,"stargazers_count":5,"open_issues_count":5,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2023-02-26T05:36:53.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxacademy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-13T15:35:53.000Z","updated_at":"2022-08-14T16:18:54.000Z","dependencies_parsed_at":"2022-09-12T22:31:40.178Z","dependency_job_id":null,"html_url":"https://github.com/linuxacademy/content-minikube-robotshop","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxacademy%2Fcontent-minikube-robotshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxacademy%2Fcontent-minikube-robotshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxacademy%2Fcontent-minikube-robotshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxacademy%2Fcontent-minikube-robotshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxacademy","download_url":"https://codeload.github.com/linuxacademy/content-minikube-robotshop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224211699,"owners_count":17274330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T03:30:06.990Z","updated_at":"2024-11-12T03:30:07.636Z","avatar_url":"https://github.com/linuxacademy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample Microservice Application\n\nStan's Robot Shop is a sample microservice application you can use as a sandbox to test and learn containerised application orchestration and monitoring techniques. It is not intended to be a comprehensive reference example of how to write a microservices application, although you will better understand some of those concepts by playing with Stan's Robot Shop. To be clear, the error handling is patchy and there is not any security built into the application.\n\nYou can get more detailed information from my [blog post](https://www.instana.com/blog/stans-robot-shop-sample-microservice-application/) about this sample microservice application.\n\nThis sample microservice application has been built using these technologies:\n- NodeJS ([Express](http://expressjs.com/))\n- Java ([Spark Java](http://sparkjava.com/))\n- Python ([Flask](http://flask.pocoo.org))\n- Golang\n- PHP (Apache)\n- MongoDB\n- Redis\n- MySQL ([Maxmind](http://www.maxmind.com) data)\n- RabbitMQ\n- Nginx\n- AngularJS (1.x)\n\nThe various services in the sample application already include all required Instana components installed and configured. The Instana components provide automatic instrumentation for complete end to end [tracing](https://docs.instana.io/core_concepts/tracing/), as well as complete visibility into time series metrics for all the technologies.\n\nTo see the application performance results in the Instana dashboard, you will first need an Instana account. Don't worry a [trial account](https://instana.com/trial?utm_source=github\u0026utm_medium=robot_shop) is free.\n\n## Build from Source\nTo optionally build from source (you will need a newish version of Docker to do this) use Docker Compose. Optionally edit the *.env* file to specify an alternative image registry and version tag; see the official [documentation](https://docs.docker.com/compose/env-file/) for more information. \n\n    $ docker-compose build\n\nIf you modified the *.env* file and changed the image registry, you may need to push the images to that registry\n\n    $ docker-compose push\n\n## Run Locally\nYou can run it locally for testing.\n\nIf you did not build from source, don't worry all the images are on Docker Hub. Just pull down those images first using:\n\n    $ docker-compose pull\n\nFire up Stan's Robot Shop with:\n\n    $ docker-compose up\n\nIf you are running it locally on a Linux host you can also run the Instana [agent](https://docs.instana.io/quick_start/agent_setup/container/docker/) locally, unfortunately the agent is currently not supported on Mac.\n\n## Marathon / DCOS\n\nThe manifests for robotshop are in the *DCOS/* directory. These manifests were built using a fresh install of DCOS 1.11.0. They should work on a vanilla HA or single instance install.\n\nYou may install Instana via the DCOS package manager, instructions are here: https://github.com/dcos/examples/tree/master/instana-agent/1.9\n\n## Kubernetes\nThe Docker container images are all available on [Docker Hub](https://hub.docker.com/u/robotshop/). The deployment and service definition files using these images are in the *K8s* directory, use these to deploy to a Kubernetes cluster. If you pushed your own images to your registry the deployment files will need to be updated to pull from your registry; using [kompose](https://github.com/kubernetes/kompose) may be of assistance here.\n\nIf you want to deploy Stan's Robot Shop to Google Compute you will need to edit the *K8s/web-service.yaml* file and change the type from NodePort to LoadBalancer. This can also be done in the Google Compute console.\n\n#### NOTE\nI have found some issues with kompose reading the *.env* correctly, just export the variables in the shell environment to work around this.\n\nYou can also run Kubernetes locally using [minikube](https://github.com/kubernetes/minikube).\n\n    $ kubectl create namespace robot-shop\n    $ kubectl -n robot-shop create -f K8s/descriptors\n\nTo deploy the Instana agent to Kubernetes, just use the [helm](https://github.com/instana/instana-helm-chart) chart. Edit *values.yaml* and set zone, endpoint and key to your values, see the README file for the helm chart.\n\n    $ cd instana-helm-chart\n    $ helm install --name instana-agent --namespace instana-agent .\n\nIf you are having difficulties get helm running with your K8s install it is most likely due to RBAC, most K8s now have RBAC enabled by default. Therefore helm requires a [service account](https://github.com/helm/helm/blob/master/docs/rbac.md) to have permission to do stuff.\n\n## Acessing the Store\nIf you are running the store locally via *docker-compose up* then, the store front is available on localhost port 8080 [http://localhost:8080](http://localhost:8080/)\n\nIf you are running the store on Kubernetes via minikube then, to make the store front accessible edit the *web* service definition and change the type to *NodePort* and add a port entry *nodePort: 30080*.\n\n    $ kubectl -n robot-shop edit service web\n\nSnippet\n\n    spec:\n      ports:\n      - name: \"8080\"\n        port: 8080\n        protocol: TCP\n        targetPort: 8080\n        nodePort: 30080\n      selector:\n        io.kompose.service: web\n      sessionAffinity: None\n      type: NodePort\n\nThe store front is then available on the IP address of minikube port 30080. To find the IP address of your minikube instance.\n\n    $ minikube ip\n\nIf you are using a cloud Kubernetes / Openshift / Mesosphere then it will be available on the load balancer of that system. There will be specific blog posts on the Instana site covering these scenarios.\n\n## Load Generation\nA separate load generation utility is provided in the *load-gen* directory. This is not automatically run when the application is started. The load generator is built with Python and [Locust](https://locust.io). The *build.sh* script builds the Docker image, optionally taking *push* as the first argument to also push the image to the registry. The registry and tag settings are loaded from the *.env* file in the parent directory. The script *load-gen.sh* runs the image, edit this and set the HOST environment variable to point the load at where you are running the application. You could run this inside an orchestration system (K8s) as well if you want to, how to do this is left as an exercise for the reader.\n\n## End User Monitoring\nTo enable End User Monitoring (EUM) see the official [documentation](https://docs.instana.io/products/website_monitoring/) for how to create a configuration. There is no need to inject the javascript fragment into the page, this will be handled automatically. Just make a note of the unique key and set the environment variable INSTANA_EUM_KEY for the *web* image, see *docker-compose.yaml* for an example.\n\nIf you are running the Instana backend on premise, you will also need to set the Reporting URL to your local instance. Set the environment variable INSTANA_EUM_REPORTING_URL as above. See the Instana EUM API [reference](https://docs.instana.io/products/website_monitoring/api/#api-structure)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxacademy%2Fcontent-minikube-robotshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxacademy%2Fcontent-minikube-robotshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxacademy%2Fcontent-minikube-robotshop/lists"}