Skip to content

Infra to deploy a simple Golang application on GKE that is backed by a Postgres database.

Notifications You must be signed in to change notification settings

tbernacchi/terraform-gcp-gke-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-gcp-gke-postgresql

Infra to deploy a GKE kubernetes cluster on GCP plus a HA Postgres database.

Terraform

Instructions

This project contains three directories:

  • app - It's the application itself. Read the readme.md.
  • k8s - kubernetes manifests to deploy the application;
  • terraform - .tf files to deploy the GKE cluster and the PostgreSQL database;

Requirements

  • Docker;
  • Terraform;
  • gcloud CLI;
  • GCP;
  • kubectl;

GCP

Before you deploy your terraform you've to make sure you have all the necessary permissions:

Examples:

setup

gcloud auth login
gcloud projects list
gcloud config set project <my-project>
gcloud auth application-default login
gcloud iam service-accounts create sa-terraform — display-name
gcloud projects add-iam-policy-binding PROJECT_ID — member="serviceAccount:sa-terraform@PROJECT_ID.iam.gserviceaccount.com" — role="roles/cloudsql.admin"

References

https://cloud.google.com/iam/docs/service-accounts https://cloud.google.com/sql/docs/postgres/admin-api https://cloud.google.com/service-infrastructure/docs/service-networking/getting-started https://cloud.google.com/compute/docs/reference/rest/v1 https://cloud.google.com/sdk/docs

Author

👤 Tadeu Bernacchi

Show your support

Give a ⭐️ if this project helped you!

About

Infra to deploy a simple Golang application on GKE that is backed by a Postgres database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published