Skip to content

Latest commit

 

History

History
106 lines (55 loc) · 4.82 KB

cloudshell-tutorial.md

File metadata and controls

106 lines (55 loc) · 4.82 KB

Online Boutique quickstart

This tutorial shows you how to deploy Online Boutique to a Kubernetes cluster.

You'll be able to run Online Boutique on:

Let's get started!

Kubernetes cluster setup

Set up a Kubernetes cluster using the instructions below for either minikube or GKE.

Minikube instructions

Minikube creates a local Kubernetes cluster on Cloud Shell.

  1. Click minikube on the status bar located at the bottom of the editor window.

  2. The command palette will prompt you to choose which minikube cluster to control. Select minikube and, in the next prompt, click Start if the cluster has not already been started.

  3. If prompted, authorize Cloud Shell to make a GCP API call with your credentials.

It may take a few minutes for minikube to finish starting.

Once minikube has started, you're ready to move on to the next step.

GKE instructions

In order to create a GKE cluster, you'll need to create a Google Cloud project or use an existing project.

  1. Access the command palette by going to View > Find Command.

  2. Run the command "Cloud Code: Create GKE cluster".

  3. Select your GCP project.

  4. Apply the following configurations in the GKE wizard:

  • Zone: us-central1-b
  • Cluster name: onlineboutique
  • Node count: 4
  • Machine type: e2-standard-2
  1. Click Create Cluster. Once your cluster has been created successfully, you can move on to the next step.

Run on Kubernetes

Now you can run Online Boutique on your Kubernetes cluster!

  1. Launch the Cloud Code menu from the status bar and select Run on Kubernetes.

  2. If prompted to select a Skaffold Profile, select [default].

  3. Select Yes to confirm your current context.

  4. If you're using a GKE cluster, you'll need to confirm your container image registry.

  5. If prompted, authorize Cloud Shell to make a GCP API call with your credentials.

Cloud Code uses configurations defined in skaffold.yaml to build and deploy the app. It may take a few minutes for the deploy to complete.

  1. Once the app is running, the local URLs will be displayed in the Output terminal.

  2. To access your Online Boutique frontend service, click on the Web Preview button in the upper right of the editor window.

  3. Select Change Port and enter '4503' as the port, then click Change and Preview. Your app will open in a new window.

Stop the app

To stop running the app:

  1. Go to the Debug view

  2. Click the Stop icon.

  3. Select Yes to clean up deployed resources.

You can start, stop, and debug apps from the Debug view.

Clean up

If you've deployed your app to a GKE cluster in your Google Cloud project, you'll want to delete the cluster to avoid incurring charges.

  1. Navigate to the Cloud Code - Kubernetes view in the Activity bar.

  2. Under the Google Kubernetes Engine Explorer tab, right-click on your cluster and select Delete Cluster.

Conclusion

Congratulations! You've successfully deployed Online Boutique using Cloud Shell.

What's next?

Try other deployment options for Online Boutique:

  • Istio/Anthos Service Mesh: See these instructions.

Learn more about the Cloud Shell IDE environment and the Cloud Code extension.