Giter Club home page Giter Club logo

applied-dora-infra-as-code's Introduction

Applied DORA - Infrastructure as Code using Google Cloud

Building upon the findings from the DevOps Research and Assessment (DORA) program, this repo demonstrates an example approach for implementing an Infrastructure as Code strategy using Google Cloud.

This repo contains an example deployment approach using a combination of Terraform and Kubernetes Resource Model (KRM). Terraform is used to deploy the base infrastructure (GKE, Config Connector) and KRM is used to deploy applications (Kubernetes Deployments/Services) and application depedencies (Cloud Firestore).

Prerequisites

  1. A Google Cloud project with billing set up.
  2. gcloud
  3. kubectl
  4. terraform

Terraform Base Infrastructure

The Terraform in the infra directory does the following:

  • Creates a 3-node zonal GKE cluster
  • Configures Workload Identity
  • Enables the Config Connector add-on
  • Creates a service account and service account bindings for Config Connector
  • Creates the required Config Connector resources, necessary to complete deployment

Change to the infra directory:

cd infra/

Update the region, zone, and deployment_name input variables in terraform.tfvars. Then, initialize the Terraform bits:

terraform init

When that's completed, you'll have the necessary providers and modules to deploy.

Now use Terraform's plan mechanism to see what changes will be made:

terraform plan -var project_id=PROJECT_ID

Assuming that all looks good, go ahead and deploy:

terraform apply -auto-approve -var project_id=PROJECT_ID

Once the deployment is complete, we need to complete the Config Connector setup process. But first, setup kubectl:

gcloud container clusters get-credentials adora-iac-cluster --zone ZONE

Now apply the remaining resources to complete the setup:

kubectl apply -f configconnector.yaml
kubectl apply -f namespace.yaml

KRM Application Infrastructure

TODO

Resources

TODO

Cleanup

terraform destroy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.