Giter Club home page Giter Club logo

gcp-final-project's Introduction

GCP Final Project:

Project Requirements:

  • 1 VPC

  • 2 subnets (management subnet & restricted subnet):

    1. Management subnet has the following: • NAT gateway • Private VM
    2. Restricted subnet has the following: • Private standard GKE cluster (private control plan)

    Restrictions:

    1. Restricted subnet must not have access to internet
    2. All images deployed on GKE must come from GCR or Artifacts registry.
    3. The VM must be private.
    4. Deployment must be exposed to public internet with a public HTTP load balancer.
    5. All infra is to be created on GCP using terraform.
    6. Deployment on GKE can be done by terraform or manually by kubectl tool.
    7. The python code to be build/dockerized and pushed to GCR is on here: https://github.com/atefhares/DevOps-Challenge-Demo-Code
    8. Don’t use default compute service account while creating the gke cluster, create custom SA and attach it to your nodes.
    9. Only the management subnet can connect to the gke cluster.

Create Infrastructure Using Terraform :

  • VPC(As-required).
  • Subnets(As-required).
  • Cloud Router.
  • Cloud Nat.
  • Private Instance.
  • Firewall rule.
  • Service accounts.
  • GKE cluster. (note: all configurations files used in infrastructure is provided in this repo)
terraform init
terraform apply 

Create Image of Python Code Using Docker:

  • Dockerfile of python app.
  • Docker image of redis.
  • Configure Docker & gcloud to work with GCR of your project. (note: all configurations files used in containerization is provided in this repo)
docker build -t <image-name>
docker push gcr.io/<project-name>/<image-name>

Use the private-instance to get into the cluster:

  • you could do it by just adding the configuration script file(provided) into the instance and run it.
  • then CONGRATULATIONS you are into cluster and all tools required is installed.

Create GKE cluster yaml files:

  • deployment of python app.
  • deployment of redis database.
  • service (ClusterIP).
  • service (loadbalancer). (note: all yaml files used is provided in this repo)
kubectl apply -f python_deploy.yaml
kubectl apply -f redis_deploy.yaml
kubectl apply -f service.yaml
kubectl apply -f loadbalancer.yaml

Check running application:

kubectl get service
  • take the loadbalancer external-ip.
  • put it into your browser followed by the exposed port.

alt text alt text

gcp-final-project's People

Contributors

daviddeif avatar

Watchers

 avatar

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.