Home NewsX Configurando DAPR, KEDA no AKS

Configurando DAPR, KEDA no AKS

by info.odysseyx@gmail.com
0 comment 6 views


no way CNCF (Cloud Native Computing Foundation) Define Cloud native applications The como software comprises various services and interdependent chamados. Microservices. Essas aplicações são projetadas para aproveitar ao máximo as inovações em computação em nuvem, como Scalability, It’s safe, pliability E Otomasao.

Some projects Cloud native I found out more CNCF Includes: Kubernetes, Prometheus, Envoy, Jaeger, Helm, DAPR, KEDA e, etc.

Neste artigo, falaremos sobre DAPR, KEDA and como esta Combinação pode trazer eficiência e flexibilidade na construção de aplicações em Kubernetes.

DAPR: Distributed Application Runtime

outline

DAPR The serverless version allows for runtime portability, easy event management for configuring microserver elasticity, basic message consumption through brokers, etc., and simple mesh management. Various languages ​​and frameworks.

KEDA: Kubernetes event-based automatic scaling

Keda Simple auto-scaling application, extend the application according to your requirements (pillars, items, etc.) To automatically orient the application in an efficient form (escape for zero) você escale cargas de trabalho de que significa que seu applicación pode escalar dinamicamente para zero instâncias when no one is there, assisted in optimization of the user.

kedah-arch.png

Desta forma, aproveitei para montar este repositório no GitHub The “App-Plant-Tree” combination of concepts about Cloud-Native Architecture consists of the following technologies:

  • Go – Producer/Consumer App
  • Distributed Application Runtime – DAPR
  • Kubernetes Event-Based Auto-Scaling – KEDA
  • Azure Kubernetes Service (AKS)
  • Azure Container Registry (ACR)
  • Azure Service Bus (ASB)

Ferramentas para desenvolvimento

Infrastructure Configuration

Logando no Azure usando a linha de commando (CLI):

az login

The alternative os values ​​​​of the variáveis ​​​​abaixo conform to their surroundings.

- $SubscriptionID = ''
- $Location = ''
- $ResourceGroupName = ''
- $AKSClusterName = ''
- $ContainerRegistryName = ''
- $ServiceBusNamespace = ''

Subscribe:

az account set --subscription $SubscriptionID

Create your own resource group:

az group create --name $ResourceGroupName --location $Location

1. Creandos Cluster AKS and connect to ACR

Configuration of AKS (Azure Kubernetes Service) cluster:

az aks create --resource-group $ResourceGroupName --name $AKSClusterName --node-count 3 --location $Location --node-vm-size Standard_D4ds_v5 --tier free --enable-pod-identity --network-plugin azure --generate-ssh-keys

Optionally, if you would like to help support Microsoft (no link), here is how to install DAPR and KEDA via extensions/add-ons.

Crie or Azure Container Registry (ACR):

az acr create --name $ContainerRegistryName --resource-group $ResourceGroupName --sku basic

Connect AKS to ACR:

az aks update --name $AKSClusterName --resource-group $ResourceGroupName --attach-acr $ContainerRegistryName

Pegue as credenciais para se conectar ao cluster AKS:

az aks get-credentials --resource-group $ResourceGroupName --name $AKSClusterName --overwrite-existing

Verify cluster connectivity.

kubectl cluster-info

2. Configuring DAPR on AKS via helmcharts

Add to References:

helm repo add dapr https://dapr.github.io/helm-charts/   
helm repo update
helm upgrade --install dapr dapr/dapr --namespace dapr-system --create-namespace
helm upgrade --install dapr-dashboard dapr/dapr-dashboard --namespace dapr-system --create-namespace

The confirmed OS pods are:

kubectl get pods -n dapr-system

2.1 Configuration o DAPR Dashboard

to access the DAPR dashboard, or run the next command

dapr dashboard -k

Expected Results:

DAPR dashboard found in namespace: dapr-system
DAPR dashboard available at http://localhost:8080

3. Configure KEDA no AKS via helmcharts

Add to References:

helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm upgrade --install keda kedacore/keda -n keda-system --create-namespace
helm upgrade --install keda-add-ons-http kedacore/keda-add-ons-http -n keda-system --create-namespace
 

The confirmed OS pods are:

kubectl get pods -n keda-system

4. Organize transport operations of DAPR and KEDA.

Neste projeto, temos três diferentes opções para configurar a camada de Transporte(escolha uma):

Deploying applications without AKS

1. Criando as imagens docker

az acr login --name $ContainerRegistryName
docker build -t "$ContainerRegistryName.azurecr.io/consumer-app:1.0.0" -f cmd/consumer/dockerfile .
docker build -t "$ContainerRegistryName.azurecr.io/producer-app:1.0.0" -f cmd/producer/dockerfile .

2. Subindo as imagens no Container Registry ACR


docker push "$ContainerRegistryName.azurecr.io/consumer-app:1.0.0" 
docker push "$ContainerRegistryName.azurecr.io/producer-app:1.0.0" 

3. Application Helmchart das Aplicações

helm upgrade --install app .helmcharts/app -n tree --create-namespace

The confirmed os pods are confirmed in Rodando::

kubectl get pods -n tree

4. Tested with application


kubectl logs -f -l app=consumer1 --all-containers=true -n tree


kubectl port-forward pod/producer1 8081 8081 -n tree


- POST -> http://localhost:8081/plant
- Json Body: {"numberOfTrees":100}


kubectl get pod -l app=consumer1 -n tree

4. Remove resources

Remove the Helm chart:

helm uninstall app -n tree
helm uninstall keda-add-ons-http -n keda-system
helm uninstall keda -n keda-system
helm uninstall dapr -n dapr-system

Exclude to-dos and repetitive tasks in Azure.

az aks delete --name $AKSClusterName --resource-group $ResourceGroupName
az acr delete --name $ContainerRegistryName --resource-group $ResourceGroupName
az group delete --name $ResourceGroupName

References





Source link

You may also like

Leave a Comment

Our Company

Welcome to OdysseyX, your one-stop destination for the latest news and opportunities across various domains.

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

Laest News

@2024 – All Right Reserved. Designed and Developed by OdysseyX