diff --git a/_includes/doc_menu.html b/_includes/doc_menu.html index e3dcc59..67fbff9 100644 --- a/_includes/doc_menu.html +++ b/_includes/doc_menu.html @@ -37,4 +37,9 @@
  • Nomad
  • +
  • Apcera + +
  • diff --git a/deployment/apcera.md b/deployment/apcera.md new file mode 100644 index 0000000..f1a260c --- /dev/null +++ b/deployment/apcera.md @@ -0,0 +1,90 @@ +--- +layout: default +deployDoc: true +--- + +## Socks Shop on Apcera + +These instructions will help you deploy and run the Socks Shop application on the [Apcera Platform](https://www.apcera.com/platform), an enterprise-grade container management platform for cloud-native and legacy applications. Apcera is secure by default, only permitting things explicitly authorized by policy, and supports multi-cloud deployments. + +Apcera has tested Socks Shop on the Apcera Community Edition running single-cloud clusters in Amazon AWS, Google Cloud Platform, Microsoft Azure, and VMware. We have also tested Socks Shop on the Apcera Enterprise Edition running a multi-cloud cluster that spanned across AWS, GCP, and VMware. + +### Packaging + +The Socks Shop application is packaged and configured for Apcera using a [Multi-Resource Manifest file](https://docs.apcera.com/jobs/multi-resource-manifests/) called socksshop-docker.json which is similar to a Docker Compose file. Scripts are provided to make it easy to deploy all the services and a network from the manifest, to start and stop the services, and to delete everything that was deployed. + +### Pre-requisites + +- Set up your preferred private or public cloud environment, preferably AWS, Google, Azure, or VMware. +- Install [Apcera Community Edition (CE)](https://docs.apcera.com/setup/apcera-setup/) in your cloud or use the Apcera Enterprise Edition (EE) if you own it. +- Download the Apcera command line tool [APC](https://docs.apcera.com/quickstart/installing-apc/) from the Apcera [Web Console](https://docs.apcera.com/quickstart/using_console/) and install it. + +``` +git clone https://github.com/microservices-demo/microservices-demo +cd microservices-demo/deploy/apcera +``` +- *(Optional)* If you are not an admin user in your Apcera cluster, you might need an Apcera administrator to import a [policy](https://docs.apcera.com/policy/introduction/) file to give you permission to create the Socks Shop services and network in your sandbox. + +``` +apc import policy socksShop.pol +``` + +### Networking and Security + +In this demo scenario, we create a single [virtual network](https://docs.apcera.com/jobs/virtual-networks/) to which all the services except *zipkin* and *user-sim* are added. Services inside the virtual network can all talk to each other. Apcera [job links](https://docs.apcera.com/jobs/job-links/) are used to let the *user-sim* load testing service send requests to the *front-end* service and to let the main Socks Shop services send traces to the *zipkin* service. Using job links in this fashion simulates how real, cloud-based load testing and APM solutions can be integrated into applications running on Apcera without sacrificing security. + +### Deployment + +All of the Socks Shop services and the network are deployed to Apcera with a single script. However, you first need to target your cluster and login to it with APC. After that, just run the deploySocksShop.sh script. + + + +``` +apc target +apc login +``` + + + ./deploySocksShop.sh + + + +After determining your targeted cluster and default namespace, this script does the following: + +- It sets your current namespace to \/socksshop. +- It runs the "apc manifest deploy" command against the socksshop-docker.json manifest to create the services and the socksshop-network virtual network. +- It creates [job affinity tags](https://docs.apcera.com/jobs/job-affinity/) to make sure that each service that uses a database is deployed to the same Apcera instance manager as the database. +- It then runs the startSocksShop.sh script to start all of the Socks Shop services. + +Altogether, the script should take under two minutes to run. + +### Using + +- You can access the Socks Shop front-end service in a browser with the URL: + - http://front-end.\ +- Note that the *edge-router* service is not used since Apcera provides its own router. +- You can view logs for the services in the Apcera Web Console or by using the "apc app logs" command. + +### Testing + +A load testing service, *user-sim*, is provided in the socksshop-docker.json manifest file. It will run when the manifest is deployed after a delay of 60 seconds. This is a load test provided to simulate user traffic to the application. You can view the results of the test in the *user-sim* log. + +### Tracing +[Zipkin](http://zipkin.io/) has been written into some of the services. While the system is up you can view the traces at http://zipkin.\. Currently *orders* provides the most comprehensive traces. + +### Starting and Stopping + +You can use the startSocksShop.sh and stopSocksShop.sh scripts to start and stop all the services. + +### Cleaning up + +Run the deleteSocksShop.sh script to delete the Socks Shop services and network. + + + + ./deleteSocksShop.sh + +