No description
Find a file
Ahmet Alp Balkan 08a62d81fc
add LICENSE, CONTRIBUTING.md
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-25 21:17:04 -07:00
.vscode latest 2018-07-16 14:29:14 -07:00
istio-manifests Add LICENSE headers to source files 2018-07-25 09:54:28 -07:00
kubernetes-manifests add named port for frontend-external so that istio metrics aren't blocked 2018-07-19 09:53:28 -07:00
pb checkoutservice: remove PrepareOrder rpc 2018-06-29 11:08:09 -07:00
src Add LICENSE headers to source files 2018-07-25 09:54:28 -07:00
tests/cartservice Making cartservice more reliable 2018-07-02 13:26:37 -07:00
.gitignore Making cartservice more reliable 2018-07-02 13:26:37 -07:00
CONTRIBUTING.md add LICENSE, CONTRIBUTING.md 2018-07-25 21:17:04 -07:00
LICENSE add LICENSE, CONTRIBUTING.md 2018-07-25 21:17:04 -07:00
README.md add LICENSE, CONTRIBUTING.md 2018-07-25 21:17:04 -07:00
skaffold.yaml skaffold: remove unused gcb profile 2018-07-17 22:26:02 -07:00

Microservices demo

This project contains a 10-tier microservices application. The application is a web-based e-commerce app called “Hipster Shop” where users can browse items, add them to the cart, and purchase them.

Google has used this application to demonstrate Kubernetes, GKE, Istio, Stackdriver, gRPC and similar cloud-native technologies.

Running locally

  1. Install tools to run a Kubernetes cluster locally:

    • kubectl (can be installed via gcloud components install kubectl)
    • Docker for Desktop (Mac/Windows): Download the Edge release; not the stable. Edge release provides Kubernetes support as noted here.
    • skaffold
  2. Launch “Docker for Desktop”. Go to Preferences and choose “Enable Kubernetes”.

  3. Run kubectl get nodes to verify you're connected to “Kubernetes on Docker”.

  4. Run skaffold run (first time will be slow). This will build and deploy the application. If you need to rebuild the images automatically as you refactor the code, run skaffold dev command.

  5. Run kubectl get pods to verify the Pods are ready and running. The application frontend should be available at http://localhost:80 on your machine.

Setup on GKE

  1. Install tools specified in the previous section (Docker, kubectl, skaffold)

  2. Create a Google Kubernetes Engine cluster and make sure kubectl is pointing to the cluster.

  3. Enable Google Container Registry (GCR) on your GCP project:

    gcloud services enable containerregistry.googleapis.com
    
  4. Configure docker to authenticate to GCR:

    gcloud auth configure-docker -q
    
  5. Edit skaffold.yaml, prepend your GCR registry host (gcr.io/YOUR_PROJECT/) to all imageName: fields (or update the existing project name).

  6. Edit the Deployment manifests at kubernetes-manifests directory and update the image fields to match the changes you made in the previous step.

  7. Run skaffold run. This builds the container images, pushes them to GCR, and deploys the application to Kubernetes.

  8. Find the IP address of your application:

    kubectl get service frontend-external
    

    then visit the application on your browser to confirm installation.

Istio Deployment

  1. Create a GKE cluster.

  2. Install Istio without mutual TLS option. (Istio mTLS is not yet supported on this demo.)

  3. Install the automatic sidecar injection (annotate the default namespace with the label):

    kubectl label namespace default istio-injection=enabled
    
  4. Deploy the application with.

  5. Apply the manifests in ./istio-manifests directory.

    kubectl apply -f ./istio-manifests
    
  6. Run kubectl get pods to see pods are in a healthy and ready state.


This is not an official Google project.