Code Monkey home page Code Monkey logo

gke_django's Introduction

Setting Up Django Application on GKE

This guide provides a straightforward approach to deploying a Django application on Google Kubernetes Engine (GKE). It's designed to be simple and educational.

1. Create an Autopilot GKE Cluster

Follow the Google Cloud Platform (GCP) documentation for creating an Autopilot GKE cluster.

2. Set Up Cloud SQL Instance

Create a Cloud SQL instance along with the necessary user and database. Detailed instructions can be found in the GCP documentation.

3. Configure Artifacts Registry

Refer to the GCP documentation to create an Artifacts Registry. You will need this registry later in your .env file under DOCKER_TAG.

4. Clone the Repository

Clone the repository from GitHub:

git clone [email protected]:MarkosMuche/gke_django.git

5. Configure Environment Variables

Remove the .sample extension from .env.sample and populate the values:

POSTGRES_PASS= <your_cloudsql_password>
POSTGRES_HOST= <your_cloudsql_public_ip>
POSTGRES_USER= <your_cloudsql_user>
POSTGRES_PORT=5432
POSTGRES_DB= <your_cloudsql_database_name>
DOCKER_TAG= <path_to_your_artifacts_registry>/<your_image_name>:<your_tag>

6. Build and Push Docker Image

Execute the script to build and push the Docker image:

bash build_and_push.sh

7. Create Kubernetes Secrets

Run the script to create Kubernetes secrets:

bash create_secrets.sh

8. Deploy the Application

Deploy the application by running:

kubectl create -f app.yaml

That's it! Your Django application is now deployed and running on GKE.

gke_django's People

Contributors

markosmuche 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.