You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
2.0 KiB

  1. # eShopOnContainers on Kubernetes
  2. This directory contains Kubernetes configuration for the eShopOnContainers app and a PowerShell script to deploy it to a cluster. Each microservice has a deployment configuration in `deployments.yaml`, and is exposed to the cluster by a service in `services.yaml`. The microservices are exposed externally on individual routes (`/basket-api`, `/webmvc`, etc.) by an nginx reverse proxy as specified in `frontend.yaml` and `nginx.conf`.
  3. ## Deploying the application
  4. ### Prerequisites
  5. * A Docker build host.
  6. * A private Docker registry. Follow Azure Container Registry's [guide](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) to create one.
  7. * A Kubernetes cluster. Follow Azure Container Service's [walkthrough](https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough) to create one.
  8. ### Run the deployment script
  9. 1. Open a PowerShell command line at `eShopOnContainers/k8s`.
  10. 1. Ensure `docker`, `docker-compose`, and `kubectl` are on the path, and configured for your Docker machine and Kubernetes cluster.
  11. 1. Run `deploy.ps1` with your registry information. For example:
  12. ```
  13. ./deploy.ps1 -registry myregistry.azurecr.io -dockerUser User -dockerPassword SecretPassword
  14. ```
  15. The Docker username and password are provided by Azure Container Registry, and can be retrieved from the Azure portal.
  16. The script will build the code and corresponding Docker images, push the latter to your registry, and deploy the application to your Kubernetes cluster.
  17. TODOs
  18. =====
  19. * Host WebSPA at `/webspa`
  20. * This is blocked on correct relative URLs for images. Presently these are set at build by webpack, which isn't aware of where the app will be sited. An Angular solution might exist. Another option is to encode the images in base64.
  21. * Debug microservice resiliency issues--some microservices can enter failure states requiring their pod to be recreated.
  22. * Respond to `kubectl` failures in `deploy.ps1`.