Skip to content

LogstonEducation/PDL-Deployments

Repository files navigation

PDL-Deployments

Outline

Background

  • Why do we need it?
  • Why can't I just build on my local machine?
  • What is infrastructure?
  • Where is it?

Setup

gcloud auth login
gcloud config set project <YOUR PROJECT ID>

Virtual Machine

  • Create new VM (debian), Allow http traffic!
  • sudo python3 -m http.server 80
  •   sudo apt update
      sudo apt-get install -y python3-venv git
      git clone https://github.com/LogstonEducation/PDL-Deployments.git
      cd pdl-deployments
      python3 -m venv env
      source env/bin/activate
      pip install -r requirements.txt
      
      which python
      sudo /home/pl2648/PDL-Deployments/env/bin/python manage.py runserver 0.0.0.0:80

GAE

GKE

  • First, let's dockerize the application

    • Dockerfile
    • uWSGI file
  • Create a cluster named "cluster-1" in us-central1-a

  • Push to GCR

    •   docker build -t gcr.io/pdl-deployments-pl2648/proj:v1 .
        gcloud auth configure-docker gcr.io 
        docker push gcr.io/pdl-deployments-pl2648/proj:v1
        gcloud container clusters get-credentials --zone us-central1-a cluster-1
        
        kubectl config current-context
        kubectl create deployment proj --image=gcr.io/pdl-deployments-pl2648/proj:v1
        kubectl get pods
        kubectl expose deployment proj --type=LoadBalancer --port 80 --target-port 8000
        kubectl get service

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published