项目作者: JailtonJunior94

项目描述 :
💰 .NET 5.0, Sql Server, Docker, Azure Pipeline, ACR and AKS
高级语言: C#
项目地址: git://github.com/JailtonJunior94/csharp-finances.git
创建时间: 2021-09-07T13:25:20Z
项目社区:https://github.com/JailtonJunior94/csharp-finances

开源协议:

下载


Criando o banco de dados

  1. Script
    1. CREATE DATABASE [FinanceDB]
    2. GO
    3. USE [FinanceDB]
    4. GO
    5. SET
    6. ANSI_NULLS ON
    7. GO
    8. SET
    9. QUOTED_IDENTIFIER ON
    10. GO
    11. CREATE TABLE [dbo].[Finance](
    12. [ID] [uniqueidentifier] NOT NULL,
    13. [Title] [varchar](150) NOT NULL,
    14. [Value] [decimal](18, 2) NOT NULL,
    15. [Type] [varchar](30) NOT NULL,
    16. [CreatedAt] [datetime2](7) NOT NULL
    17. ) ON [PRIMARY]
    18. GO

Microsoft Azure

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

AWS

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

Utilizando Kubernetes

  1. Criando Secret ACR
    1. kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> \
    2. --namespace=finance
  2. Criando Secret ECR

    1. 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
  3. Aplicando manifestos

    1. kubectl apply -f .\.k8s\namespaces\ -R
    2. kubectl apply -f .\.k8s\deployments\ -R -n finance
    3. kubectl apply -f .\.k8s\services\ -R -n finance
  4. Alterar entre contextos (clusters)

    1. kubectl config get-contexts
    2. kubectl config use-context <context>

Configurando Azure DevOps (Release)

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

Habilitando Ingress Controller e Certi-Manager

  1. Instalando nginx (Nginx)

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

    1. 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
    1. helm repo list
  2. Para buscar repo helm:
    1. https://artifacthub.io/
  3. Instalando prometheus
    1. helm install prometheus prometheus-community/prometheus -n monitoring
  4. Instalando grafana
    1. helm install grafana grafana/grafana -n monitoring