Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
__test__
terraform
xebialabs
README.md
blueprint.yaml
xebialabs.yaml

README.md

Microservice Application on Google Kubernetes Engine

Introduction

Google Kubernetes Engine (GKE) allows you to deploy, manage, and scale containerized applications in the cloud using Kubernetes.

Use this blueprint to deploy a sample microservice-based application on GKE using Terraform, which defines the infrastructure that will run on GKE. The release template that the blueprint generates connects to an existing GKE cluster or provisions a new cluster and deploys a sample application to it.

Before you get started

If you're new to XebiaLabs blueprints, check out:

Usage

To use this blueprint, run xl blueprint and select:

gcp/microservice-ecommerce

Tools and technologies

This blueprint includes the following tools and technologies:

Minimum required versions

This blueprint version requires at least the following versions of the specified tools to work properly:

XL Release: Version 9.0.0 XL Deploy: Version 9.0.0 XL CLI: Version 9.0.0

Prerequisites

To run the YAML that this blueprint generates, you need:

  • XebiaLabs Release Orchestration and Deployment Automation up and running
  • Access to a Google Cloud Platform (GCP) account to deploy the application to
  • A Jenkins server up and running

Information required

This blueprint requires:

  • GCP project ID (see section below for instructions)
  • A GCP region
  • The GKE cluster endpoint (if deploying to an existing cluster)
  • Kubernetes cluster credentials
  • The Kubernetes namespace
  • Jenkins credentials (if enabling CI integration)

Creating Google Cloud project

Authenticate to gcloud

Before configuring gcloud CLI you can check available Zones and Regions nearest to your location

gcloud compute regions list

gcloud compute zones list

Follow gcloud init and select default Zone Ex. europe-west1, make sure you use the same zone as the one selected during blueprint execution.

gcloud init

NOTE: You need to have proper permissions and privileges in the GCP account to execute these commands. If you are using a personal account you should be having these as you will be the admin. If you are using a company/enterprise account please check with your account administrator.

Set up environment

NOTE: If you are creating the Project via GUI instead of below commands, there will be a project number, a project name and a project ID when you initialize the project, and only ID should be exported as TF_ADMIN variable.

export TF_ADMIN=[GCP project ID]

Create the GCP Project

Create a new project and link it to your billing account (You could do it from the GCP console GUI as well, in that case skip the below command)

NOTE: The value of YOUR_ORG_ID and YOUR_BILLING_ACCOUNT_ID can be found by running below commands

gcloud organizations list

gcloud beta billing accounts list

Once you have the details run the below commands

gcloud projects create ${TF_ADMIN} \
--organization [YOUR_ORG_ID] \
--set-as-default

gcloud beta billing projects link ${TF_ADMIN} \
--billing-account [YOUR_BILLING_ACCOUNT_ID]

Output

This blueprint will output:

  • Release templates
  • Terraform templates
  • Infrastructure:
    • GKE cluster (master, nodes)
    • Networking infrastructure: Virtual Private Cloud (VPC), subnets
    • Security infrastructure
  • A docker-compose setup for XL Release, XL Deploy and Jenkins

Tips and tricks

  • If you opt to use Jenkins in the release template that this blueprint generates, before you run the xl apply command, define a Jenkins server as a shared configuration in XL Release and put its name in the xlr-pipeline-ci-cd.yaml file. If you use the provided docker-compose files this will be automatically setup for you.
  • The YAML that the blueprint generates includes optional steps to remove the application and deprovision the cluster.

Labels

  • Cloud
  • Google
  • Kubernetes
  • Terraform
You can’t perform that action at this time.