Skip to content

💲 Golang, Go Fiber, RabbitMQ, MongoDB, Docker, Kubernetes, GitHub Actions

Notifications You must be signed in to change notification settings

JailtonJunior94/bank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank

Projeto para simular empréstimos financeiros em um banco para clientes

Tecnologias Utilizadas

  1. Golang
  2. MongoDB
  3. RabbitMQ
  4. Github Actions
  5. Docker Hub
  6. Docker
  7. Kubernetes
  8. Minikube

Funcionalidades

  1. Registrar cliente
  2. Buscar cliente por documento
  3. Solicitar empréstimo
  4. Aprovar/Reprovar empréstimos
  5. Listar empréstimos de um cliente

Desenho da Solução

Executar em ambiente local (Docker Compose)

  1. Na raiz do projeto executar o seguinte comando:
    docker-compose up -d 
    

Executar em ambiente local (Minikube)

  1. Instalando minikube (Windows)

    choco install minikube
    
  2. Instalando kubernetes-cli (Windows)

    choco install kubernetes-cli
    
  3. Para iniciar o ambiente minikube (local)

    minikube start
    
  4. Para aplicar os manifestos do k8s

    kubectl apply -f .\.k8s\metrics\ -R
    kubectl apply -f .\.k8s\namespaces\ -R
    kubectl apply -f .\.k8s\deployments\ -R -n bank
    kubectl apply -f .\.k8s\services\ -R -n bank
    kubectl apply -f .\.k8s\certmanager\ -R -n bank
    kubectl apply -f .\.k8s\ingress\ -R -n bank
    kubectl apply -f .\.k8s\hpas\ -R -n bank
    
  5. Habilitar dashboard kubernetes

    minikube dashboard
    minikube tunnel
    
  6. Habilitar portas dos serviços para utilizar localmente

    minikube service mongodb-service -n bank
    minikube service rabbitmq-service -n bank
    minikube service customer-api-service -n bank
    minikube service loan-api-service -n bank
    
  7. Alternando entre contextos

    kubectl config get-contexts
    kubectl config use-context (nome do contexto)
    
  8. Listando pods

    kubectl get pods -n bank
    
  9. Listando services

    kubectl get svc -n bank
    
  10. Listando hpa (HorizontalPodAutoscaler)

    kubectl get hpa -n bank
    

Microsoft Azure (AKS)

  1. Autenticação no azure (Precisamos instalar o (Azure CLI)
    az login
    
  2. Obtendo credenciais do cluster AKS
    az aks get-credentials --resource-group $RESOURCE_GROUP --name $NAME
    
  3. Instalando nginx (Nginx)
    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml
    
  4. Instalando cert-manager (Cert-Manager)
    kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.3/cert-manager.yaml
    

Habilitando Istio

  1. Instalando istio
    istioctl install --set profile=default -y
    
  2. Habilitando no namespace
    kubectl label namespace <namespace> istio-injection=enabled
    
  3. Habilitando Prometheus
    kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/prometheus.yaml
    istioctl dashboard prometheus
    
  4. Habilitando Grafana
    kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/grafana.yaml
    istioctl dashboard grafana
    
  5. Habilitando Kiali
    kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/kiali.yaml
    istioctl dashboard kiali
    

Executar teste de carga (Artillery.io)

  1. Executando o teste de carga
    artillery run -o artillery-report.json artillery.yaml
    

About

💲 Golang, Go Fiber, RabbitMQ, MongoDB, Docker, Kubernetes, GitHub Actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published