Skip to content

Demo project to demonstrate GCP Deployment Manager automation tool capabilities for building GKE clusters and deploying example applications.

Notifications You must be signed in to change notification settings

SoftServeInc/gcp-deployment-manager-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GKE Deployment Manager Demo

Demo project to demonstrate GCP Deployment Manager automation tool capabilities for building GKE clusters and deploying example applications.

Getting Started

These instructions will get you a fully functional GKE Regional Cluster including deployed example applications. See deployment for notes on how to deploy the cluster.

Prerequisites

Secrets and additional settings

  1. Set your project for GCloud command line tool:
gcloud config set project [YOUR_PROJECT_ID]
  1. Create Image with nginx static files from Google Cloud Storage:
export PROJECT_ID=$(gcloud config get-value project)
gcloud compute images create gcp-dm-demo-drupal-nginx-static-files --source-uri https://storage.googleapis.com/gcp-dm-demo/gcp-dm-demo-drupal-nginx-static-files.tar.gz --project $PROJECT_ID
  1. Create Compute Disk from image:
gcloud compute disks create nginx-static-files --image gcp-dm-demo-drupal-nginx-static-files --zone europe-west3-b
  1. Create a service account and download JSON key (Manual instruction):
export PROJECT_ID=$(gcloud config get-value project)
gcloud iam service-accounts create gcp-dm-demo
gcloud iam service-accounts keys create ServiceAccoutKey.json --iam-account gcp-dm-demo@${PROJECT_ID}.iam.gserviceaccount.com
base64 -w 0 ServiceAccoutKey.json > Base64_SA_Key.txt
  1. Assign Cloud SQL Admin Role to service account
export PROJECT_ID=$(gcloud config get-value project)
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:gcp-dm-demo@${PROJECT_ID}.iam.gserviceaccount.com --role roles/cloudsql.admin
  1. Enable the following APIs for your project: Compute Engine API, Kubernetes Engine API, Google Cloud Deployment Manager V2 API, Stackdriver Logging API, Stackdriver Monitoring API, Cloud SQL Admin API
gcloud services enable compute.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable deploymentmanager.googleapis.com
gcloud services enable logging.googleapis.com
gcloud services enable monitoring.googleapis.com
gcloud services enable sqladmin.googleapis.com
  1. Provide secrets in deploy-public.yaml file.
  • MySQL password (<MySQL_PASSWORD> placeholder) for Drupal and Wordpress - (sql.properties.dbUser.password, drupal.properties.env.DB_PASSWORD, wp.properties.env.DB_PASSWORD)
  • GCP ServiceAccount Base64 Key (Base64_SA_Key.txt) (<B64_CRED_KEY> placeholder) for CloudSQL Proxy Container - (secret-service-account-drupal.properties.data and secret-service-account-wp.properties.data)
  1. Set pre-existing GCE Disk (<GCE_DISK> placeholder) for Drupal Nginx static files - pv-nginx.properties.pdName. List available disks (nginx-static-files can be used for DEMO):
gcloud compute disks list
  1. Set Service Account Email Address (<KEY_EMAIL> placeholder) - sql.properties.cloudsql.serviceAccountEmailAddress.
Kubernetes and GCP Resources design Kubernetes Network Policies design
Kubernetes and GCP Resources design Kubernetes Network Policies design

Public Cluster

Infrastructure Architecture

Infrastructure Architecture Public

Deployment

Deploy Dev example

$ gcloud deployment-manager deployments create example-dev --config deploy-public.yaml

Deploy Test example

$ gcloud deployment-manager deployments create example-test --config deploy-public.yaml

Deploy Prod example

$ gcloud deployment-manager deployments create example-prod --config deploy-public.yaml

Private Cluster

TBD

Infrastructure Architecture

Infrastructure Architecture Private

Deployment

TBD

Authors

  • Piotr Kloskowski - Initial work - pklosk

About

Demo project to demonstrate GCP Deployment Manager automation tool capabilities for building GKE clusters and deploying example applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages