Skip to content

firegnome/spring-cloud-prototype-gcp

Repository files navigation

Architecture Prototype of a Spring Cloud Application on GCP - Blog Application

The blog application is a fictitious blog system demonstrating microservices as well as domain-driven-design.

The system provides the functionality of creating blogs, posts and comments as well as user authentification and authorisation. Furthermore, statistics over activities are kept.

Blog Post Overview

Architecture Overview

The following diagram shows an overview of the blog microservices, datastores and the interaction between these components, as well as the used technologies of each. Architecture Overview

Microservices and components running in a Kubernetes Cluster:

Getting Started

The detailed instruction for each service can be found in the README file of the associated subfolder.

Prequisites for cloud build

Configure Google Cloud SDK

Authorize gcloud:

gcloud auth login
gcloud auth application-default login

Install kubectl

gcloud components install kubectl

Configure docker

gcloud auth configure docker

Build

Make sure that the prequisites are fullfilled

Open variables.properties and change GCP_PROJECT_NAME to a unique name, which isn't used in any other google cloud project.

Local Build

NOTE: The setup-local script may take up to 5 minutes.

  1. Run setup-local
  2. The script will open the webbrowser for your project to activate payment for this project. Press any key to continue.
  3. Navigate to http://localhost:8181 to open the Blog-Application.

The local build will generate following:

  • Google Cloud Project with name and zone configured in variables.properties and payment enabled
  • App Engine
  • Enable datastore.googleapis.com API
  • Run projects locally

The Google Cloud Project is on the local build only needed for the Datastore.

Cloud Build

NOTE: The setup-cloud script may take up to 20 minutes.

  1. Run setup-cloud.bat or setup-cloud.sh
  2. The script will open the webbrowser for your project to activate payment for this project. Press any key to continue when payment is activated.
  3. Go to https://console.cloud.google.com to your project (you may must reload the whole page to see kubernetes cluster). Navigate to Kubernetes Engine > Services and click on the gateway-microservice url to open the Blog-Application.

The cloud build will generate following:

  • Google Cloud Project with name and zone configured in variables.properties and payment enabled
  • App Engine
  • Enable compute.googleapis.com API
  • Enable container.googleapis.com API
  • Enable datastore.googleapis.com API
  • Enable storage-component.googleapis.com API
  • Enable pubsub.googleapis.com API
  • Enable redis.googleapis.com API
  • Enable sqladmin.googleapis.com API
  • Create Kubernetes Cluster application
  • Deploy all microservices

Cleanup

To prevent the project to constantly create you costs, you can simply delete the whole project and you won't have any further costs:

gcloud projects delete [GCP_PROJECT_NAME]

Devtools

If you are inerested in what development tools could be used, have a look at the Devtools Folder.

Contributors

  • Moritz Habegger
  • Micha Schena

License

This project is made available under the MIT License. See the LICENSE file for the full license.

The logos used in the diagrams are registered trademarks of Google LLC (Google Cloud), Pivotal Software Inc (Spring), Docker Inc. (Docker), Salvatore Sanfilippo (Redis) and Igor Sysoev (nginx).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published