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
Autenticação no azure (Precisamos instalar o (Azure CLI )
Obtendo credenciais do cluster AKS
az aks get-credentials --resource-group $RESOURCE_GROUP --name $NAME
Obtendo na aws (Precisamos instalar o (AWS CLI )
aws sts get-caller-identity
Obtendo credenciais do cluster EKS
aws eks --region <REGION> update-kubeconfig --name <NOME_CLUSTER>
Criando Secret ACR
kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> \
--namespace=finance
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
Aplicando manifestos
kubectl apply -f .\.k8s\namespaces\ -R
kubectl apply -f .\.k8s\deployments\ -R -n finance
kubectl apply -f .\.k8s\services\ -R -n finance
Alterar entre contextos (clusters)
kubectl config get-contexts
kubectl config use-context <context>
Configurando Azure DevOps (Release)
Obtendo credenciais cluster kubernetes
kubectl config view --raw
Habilitando Ingress Controller e Certi-Manager
Instalando nginx (Nginx )
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml
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
Listando repo no helm
Para buscar repo helm:
Instalando prometheus
helm install prometheus prometheus-community/prometheus -n monitoring
Instalando grafana
helm install grafana grafana/grafana -n monitoring