A template to generate a new project with built-in structure and features to accelerate your project setup.
Solutions Template is a boilerplate template for building repeatable solutions with the best practices in architecture on Google Cloud, including GKE clusters, Test Automation, CI/CD, as well as development process.
This template provides built-in and ready-to-ship sample features including:
- Kubernetes-based microservices
- Simplified deployment using Skaffold and Kustomize
- Terraform Google Cloud foundation setup
- CI/CD deployment (with Github Actions)
- CloudRun templates
- [In Progress] CI/CD deployment with CloudBuild
Install Cookiecutter (Github):
-
For MacOS:
brew install cookiecutter
-
For Windows, refer this installation guide
Install other required dependencies:
-
For MacOS:
brew install --cask skaffold kustomize google-cloud-sdk
-
For Windows:
choco install -y skaffold kustomize gcloudsdk
Tool | Current Version |
---|---|
Skaffold | v1.39.2 |
GKE | v1.22 |
Kustomize | v4.3.1 |
Run the following to generate skeleton code in a new folder:
cookiecutter git@github.com:GoogleCloudPlatform/solutions-template.git
Provide the required variables to Cookiecutter prompt, e.g.:
project_id: my-project-id
project_name [My Awesome Project]:
project_short_description [My Awesome Project]:
project_slug [my_project]:
Google Cloud_region [us-central1]:
version [0.1.0]:
admin_email [admin@example.com]:
- You may leave variables as blank if you'd like to use the default value (except projdct_id).
- Notes: If you run into any issues with
cookiecutter
, please add--verbose
at the end of the command to show detailed errors.
Once cookiecutter
completes, you will see the folder <project_id>
created in
the path where you ran cookiecutter
command.
You will see the file structure like below:
<project_id>/
│ README.md
│ skaffold.yaml
│
└───microservices/
│ └───sample_service/
│ └───kustomize/
│ └───src/
│ │ Dockerfile
│ │ requirements.txt
│ │ skaffold.yaml
│ │ ...
│
└───common/
│ └───src/
│ │ Dockerfile
│ │ requirements.txt
│ │ skaffold.yaml
│ │ ...
│
└───.github/
- README.md - This contains all details regarding the development and deployment.
- skaffold.yaml - This is the master Skaffold YAML file that defines how everything is built and deployed, depending on different profiles.
- microservices - The main directory for all microservices, can be broken down into individual folder for each microservie, e.g.
sample_service
. - common - The common image contains shared data models and util libraries used by all other microservices.
In a nutshell, Solutions Template offers the following built-in features with working sample code:
- A sample microservice with CRUD API endpoints on Kubernetes (GKE).
- A built-in Ingress supporting custom DNS domain.
- Test Automation and CI/CD with Github Action.
- CloudRun Services
We are also working on the following features:
- Test Automation and Ci/CD with CloudBuild
TBD
TBD