JailtonJunior94 / csharp-finances

💰 .NET 5.0, Sql Server, Docker, Azure Pipeline, ACR and AKS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Criando o banco de dados

  1. Script
CREATE DATABASE [FinanceDB]
GO
  USE [FinanceDB]
GO
SET
  ANSI_NULLS ON
GO
SET
  QUOTED_IDENTIFIER ON
GO
  CREATE TABLE [dbo].[Finance](
    [ID] [uniqueidentifier] NOT NULL,
    [Title] [varchar](150) NOT NULL,
    [Value] [decimal](18, 2) NOT NULL,
    [Type] [varchar](30) NOT NULL,
    [CreatedAt] [datetime2](7) NOT NULL
  ) ON [PRIMARY]
GO   

Microsoft Azure

  1. Autenticação no azure (Precisamos instalar o (Azure CLI)
az login
  1. Obtendo credenciais do cluster AKS
az aks get-credentials --resource-group $RESOURCE_GROUP --name $NAME

AWS

  1. Obtendo na aws (Precisamos instalar o (AWS CLI)
aws sts get-caller-identity
  1. Obtendo credenciais do cluster EKS
aws eks --region <REGION> update-kubeconfig --name <NOME_CLUSTER>

Utilizando Kubernetes

  1. Criando Secret ACR
kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> \
--namespace=finance
  1. Criando Secret ECR
kubectl create secret docker-registry regcred --docker-server=<your-accountid>.dkr.ecr.<region>.amazonaws.com --docker-username=AWS --docker-password=$(aws ecr get-login-password) --namespace=finance
  1. Aplicando manifestos
kubectl apply -f .\.k8s\namespaces\ -R
kubectl apply -f .\.k8s\deployments\ -R -n finance
kubectl apply -f .\.k8s\services\ -R -n finance
  1. Alterar entre contextos (clusters)
kubectl config get-contexts
kubectl config use-context <context>

Configurando Azure DevOps (Release)

  1. Obtendo credenciais cluster kubernetes
kubectl config view --raw

Habilitando Ingress Controller e Certi-Manager

  1. Instalando nginx (Nginx)
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml
  1. Instalando cert-manager (Cert-Manager)
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.3/cert-manager.yaml

Instalando Prometheus e Granafa com Helm

  1. Listando repo no helm
helm repo list
  1. Para buscar repo helm:
https://artifacthub.io/
  1. Instalando prometheus
helm install prometheus prometheus-community/prometheus -n monitoring
  1. Instalando grafana
helm install grafana grafana/grafana -n monitoring

About

💰 .NET 5.0, Sql Server, Docker, Azure Pipeline, ACR and AKS


Languages

Language:C# 96.0%Language:Dockerfile 2.4%Language:Makefile 1.6%