Code Monkey home page Code Monkey logo

devops-terraform-kubernetes-python's Introduction

[DevOps-Automation] Terraform-Kubernetes-Python

A fun script to create and deploy a Python application, using Terraform for Kubernetes Cluster provisioning in GCP, enjoy!

Getting Started

This project are made using the following tools:

Platform Version
OS Windows 10 Pro
Bash Tool Git Bash
Code Editor Visual Studio Code

Prerequisites

Before running the project, make sure you have those applications:

  1. Docker Desktop
  2. GCloud SDK
  3. kubectl
  4. Helm
  5. Python
  6. jq

How to run

At the top of the 'main.sh' file replace the initial values with the GCP service account credentials.

  • GCP Project Name - Example: devops-manuel
GCP_PROJECT="PUT_GCP_PROJECT_HERE"
  • GCP Private Key ID - Example: 282b19cf817f43240aw984feaca8623aa29af233
GPC_PRIVATE_KEY_ID="PUT_GCP_PRIVATE_KEY_ID_HERE"
  • GCP Private Key - Example: -----BEGIN PRIVATE KEY-----\-----END PRIVATE KEY-----\n
GPC_PRIVATE_KEY="PUT_PRIVATE_KEY_HERE"
GPC_CLIENT_MAIL="PUT_GCP_CLIENT_MAIL_HERE"
  • GCP Client ID - Example: 106512508332840639292
GPC_CLIENT_ID="PUT_GCP_CLIENT_ID_HERE"
  • GCP CLIENT X509 CERT URL - Example: https://www.googleapis.com/gcp-devops%40devop-manu.iam.gserviceaccount.com
GPC_CLIENT_CERT_URL="PUT_CLIENT_CERT_URL_HERE"

Deployment

Only one bash command line is needed to run the script:

sh .\src\main.sh

Testing

To test the two Python tendpoints, we need to open a new windows and use the following URL's. Change the Public IP's with those generated by the Kubernetes Cluster.

  1. /greetings:
http://34.68.146.239/greetings
  1. /square:
http://34.68.146.239/square?number=43

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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.