Giter Club home page Giter Club logo

simpleapp-test's Introduction

simpleapp-test

Deploy IaC

Terraform:

## Initiate provider
terraform init
## Apply the modules
terraform apply

Change Kubernetes context:

aws eks --region us-east-1 update-kubeconfig --name k8s-cluster

Build API Image:

cd app/
docker build -t duran750/simpleapptest:v1
docker push duran750/simpleapptest:v1

Kubernetes Manifests:

cd kubernetes/manifests
#Namespace: 
kubectl create -f ns.yaml && \
#ConfigMap:
kubectl create -f simpleapp-cm.yaml && \ 
#Deployment: 
kubectl create -f simpleapp.yaml && \ 
#Service
kubectl create -f simpleapp-svc.yaml && \ 
#Ingress Controller
kubectl create -f challenge-ingress.yaml 
          

K8s Features:

# Deploy Nginx ingress controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-0.32.0/deploy/static/provider/aws/deploy.yaml


# Deploy metric server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

Helm

Install:

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh

Prometheus Stack:

# Deploy Prometheus + Grafana
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts && \
helm repo update && \
helm install prometheus prometheus-community/kube-prometheus-stack -n prova

ELK Stack:

cd kubernetes/helm/elk && \
helm repo add elastic https://Helm.elastic.co && \
helm repo update && \
helm install elasticsearch elastic/elasticsearch -n prova -f elastic-values.yaml  && \
helm install kibana elastic/kibana -n prova -f kibana-values.yaml && \
helm install metricbeat elastic/metricbeat -n prova && \
helm install apm-server elastic/apm-server -n prova

EC2 Instances

Get-ec2 API:

# Configure aws access key and secret key
aws configure

cd list_ec2_api/

# To run this script it is necessary to install the Boto3 library and configure aws cli or running in docker using env vars

pip install -r requirements.txt

python3 api/get_ec2.py

Running Get-ec2 with Docker

Obs: Set your AWS credentials env's

docker run -p 5000:5000 -e AWS_ACCESS_KEY_ID="" \
-e AWS_SECRET_ACCESS_KEY="" \
-e AWS_DEFAULT_REGION=us-east-1 duran750/ec2-api

Acess API in http://localhost:5000/ec2 or Swagger in http://localhost:5000/docs

Samples:

Grafana dashboard

http://grafana.prova/

*obs: Default grafana user: admin and password is prom-operator

Grafana dashboard

Kibana

http://kibana.prova/

Cluster metrics

Kibana metric dashboard

APM metrics

Kibana metric dashboard

Get EC2 API

ec2 api

simpleapp-test's People

Contributors

duranlopes avatar

Stargazers

Roman avatar Leandro Lanza avatar Site Reliability Engineer | DevOps avatar

Watchers

 avatar

Forkers

rafaelparisi

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.