Skip to content

ContainerMeastro provides a streamlined development, testing and deployment pipeline via docker-compose and google-cloud - Example application implemented via Django App

Notifications You must be signed in to change notification settings

CrispyCrafter/ContainerMaestro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContainerMaestro

A streamlined dev pipeline for local container debugging and google cloud deployment.

usage: ./maestro.sh [OPTIONS]
        -h --help       - Display help files
        -i --init       - Initialize environment variables
        -l --local      - Spool up local mysql-docker image with docker compose
        -b --bash       - SSH into local Docker image instance
        -c --create     - Create compute instance on gcloud
        -p --push       - Build updated docker image and push to gcloud
        -k --keys       - Create DB authentication keys
        -d --deploy     - Deploy updated YAML file
        -s --shell      - SSH into google cloud pod/deployment
        -t --terminate  - Terminate all instances

Requirements:

Platform specific requirements

  • MAC-OSX get-opt : brew install gnu-getopt

Local development:

For local development run:

./maestro.sh --local

This will create:

Instance Type Address
MySQL server 127.0.0.1:3306
NGINX server/debug 127.0.0.1:8090/nginx_status
phpmyadmin server 127.0.0.1:8082
Django app 127.0.0.1:80
Django app 127.0.0.1:443

Cloud deployment:

For cloud deployment run:

./maestro.sh -icpkd

This will:

  1. Create cloud compute instance (See maestro.sh for fine tuning )
  2. Build and push local Docker image to a Google cloud bucket
  3. Create Database authentication keys
  4. Deploy test Django app to Kubernetes cluster

Usage (init):

For Google cloud functionality complete the following set of guidelines, making note of the listed environment variables.

  1. Setting up Kubernetes with Google cloud:

https://cloud.google.com/kubernetes-engine/docs/quickstart

Environment Variable importance
PROJECT_ID required
COMPUTE_ZONE required
CLUSTER_NAME reqiured
  1. Setting up MySQL with Docker:

https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine

Environment Variable importance
PROXY_KEY_FILE_PATH required
INSTANCE_CONNECTION_NAME required
DB_PASSWORD reqiured
DB_NAME required

Initialize global environment variables:

./maestro.sh --init

This will create the following files:

env
├── dockerENVs
└── gcloudENVs

k8s
├── main-services.yml
└── main-deployment.yml

To-Do:

  1. Implement Postgres instead of MySQL
  2. Pythonise maestro from BASH

About

ContainerMeastro provides a streamlined development, testing and deployment pipeline via docker-compose and google-cloud - Example application implemented via Django App

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published