Giter Club home page Giter Club logo

querido-diario-infra's Introduction

querido-diario-infra

This repository contains a bunch of different script to deploy the infrastructure used in the Querido Diário project. Terraform is used to deploy all the Digital Ocean infrastructure used to run the workloads. The Terraform script deploy a database, Kubernetes cluster, digital ocean spaces (s3ish storage) and everything necessary to support the project applications.

Once you have the base infrastructure in place, Helm charts are used to deploy the some applications required to run our workloads.

How to use it?

First of all, it is necessary sipping up the base infrastructure. For that, you can go to the terraform directory and initialize the Terraform working directory. It will create some initial files, downloads providers and everything else that is necessary to run the deploy. After the initialization, you can run the command to ask Terraform to plan the changes in your infrastructure and then, apply it. All the commands for the previously described process is:

terraform init
terraform plan
terraform apply

After this process, if everything run successfully, you will have a kubeconfig file inside the terraform directory. This file, give you access to the Kubernetes cluster deployed. This file is used in the further step to install some base applications needed by the project. For that, you export the KUBECONFIG environment variable or copy the file to the $HOME/.kube/config file. To export the environment variable you can use a command similar to this:

export KUBECONFIG=/path/to/the/querido-diario-automation/repo/terraform/kubeconfig

Once you did that, if you have the kubectl installed in the local machine, check if you have access to the cluster:

kubectl get nodes

Now you have the infrastructure in place, you can start deploy some apps in the cluster. In this documentation we will show how to deploy two requirements to run the Querido Diário project: Nginx ingress controller and Elasticsearch.

Nginx Ingress Controller

Nginx ingress controller is used to give access to services running inside the cluster to the external world. For that, we will create some required resources to run in our cloud provider (Digital Ocean) and than run the helm command to install the Nginx Ingress Controller chart:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.46.0/deploy/static/provider/do/deploy.yaml
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update

helm install ingress-nginx ingress-nginx/ingress-nginx

Elasticsearch

Elasticsearch (a.k.a. ES) is our search index of choice. Querido Diário index all the crawled documents in a ES index. So, we need to deploy it in our cluster as well. We will use again the Helm chart available in the Elastic (ES main developer) repository:

helm repo add elastic https://helm.elastic.co
helm install elasticsearch --version 7.12.1 elastic/elasticsearch

Once you follow all these steps you should have the base infrastructure used to run Querido Diário workloads.

querido-diario-infra's People

Contributors

jvanz avatar ogecece 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.