Skip to content

wsitecreater/guestbook

Repository files navigation

Guestbook with Cloud Code

The Guestbook sample demonstrates how to deploy a Kubernetes application with a front end service and a back end service using the Cloud Code IDE extension.

For details on how to use this sample as a template in Cloud Code, read the documentation for Cloud Code for VS Code or IntelliJ.

Table of Contents


What's in this sample

Kubernetes architecture

Kubernetes Architecture Diagram

Directory contents

  • skaffold.yaml - A schema file that defines skaffold configurations (skaffold.yaml reference)

  • kubernetes-manifests/ - Contains Kubernetes YAML files for the Guestbook services and deployments, including:

    • guestbook-frontend.deployment.yaml - deploys a pod with the frontend container image
    • guestbook-frontend.service.yaml - creates a load balancer and exposes the frontend service on an external IP in the cluster
    • guestbook-backend.deployment.yaml - deploys a pod with the backend container image
    • guestbook-backend.service.yaml - exposes the backend service on an internal IP in the cluster
    • guestbook-mongodb.deployment.yaml - deploys a pod containing a MongoDB instance
    • guestbook-mongodb.service.yaml - exposes the MongoDB service on an internal IP in the cluster

Getting Started with VS Code

Run the app locally with minikube

  1. To run your application, click on the Cloud Code status bar and select ‘Run on Kubernetes’.
    image

  2. Select ‘Run locally using minikube’ when prompted. Cloud Code runs your app in a local minikube cluster.
    image

  3. View the build progress in the OUTPUT window. Once the build has finished, click on the front end service's URL in the OUTPUT window to view your live application.
    image

  4. To stop the application, click the stop icon on the Debug Toolbar.


Getting Started with IntelliJ

Run the app locally with minikube

Edit run configuration

  1. Click the Run/Debug Configurations dropdown on the top taskbar and select 'Edit Configurations'.
    image

  2. In the Run/Debug Configurations dialog, select 'Develop on Kubernetes'. This configuration watches for changes, then uses skaffold to rebuild and rerun your app.

  3. Under Run > Deployment, select 'Deploy locally to a minikube cluster'. image

  4. Click 'OK' to save your configuration.

Run the app on minikube

  1. Select 'Develop on Kubernetes' from the configuration drop down and click the run icon. Cloud Code runs your app in a local minikube cluster.
    image

  2. View the build process in the output window. Once the build has finished, you will receive a notification from the Event Log. Click 'View' to access the local URLs for your deployed services. The URLs remain accessible through the Event Log dialog.
    image

  3. To stop the application, click the stop icon next to the configuration dropdown.


Sign up for User Research

We want to hear your feedback!

The Cloud Code team is inviting our user community to sign-up to participate in Google User Experience Research.

If you’re invited to join a study, you may try out a new product or tell us what you think about the products you use every day. At this time, Google is only sending invitations for upcoming remote studies. Once a study is complete, you’ll receive a token of thanks for your participation such as a gift card or some Google swag.

Sign up using this link and answer a few questions about yourself, as this will help our research team match you to studies that are a great fit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published