Home NewsX DAPR, KEDA on ARO (Azure RedHat OpenShift): passo a passo

DAPR, KEDA on ARO (Azure RedHat OpenShift): passo a passo

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


This task requires configuration of DAPR, KEDA on ARO (Azure RedHat OpenShift).

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 RedHat OpenShift (ARO)
  • Azure Container Registry (ACR)

Ferramentas para Desenvolvimento

Use the CLI to sign in to Azure.

Make sure it’s suitable for a variety of environments.

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

Select Azure assinatura:

az account set --subscription $SubscriptionID

Cree Resource Group:

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

Ring the virtual network

az network vnet create --address-prefixes 10.0.0.0/22 --name "$ClusterName-vnet" --resource-group $ResourceGroupName

Ring the subnet para control plane.

az network vnet subnet create --resource-group $ResourceGroupName --vnet-name "$ClusterName-vnet" --name "$ClusterName-control-plane-subnet" --address-prefixes 10.0.0.0/23

Create a subnet for your workers

az network vnet subnet create --resource-group $ResourceGroupName --vnet-name "$ClusterName-vnet" --name "$ClusterName-worker-subnet" --address-prefixes 10.0.2.0/23

Describes network policy configuration for private link services

az network vnet subnet update --name "$ClusterName-control-plane-subnet" --resource-group $ResourceGroupName --vnet-name "$ClusterName-vnet" --disable-private-link-service-network-policies true

Cree or Cluster ARO:

az aro create --resource-group $ResourceGroupName --name $ClusterName --vnet "$ClusterName-vnet" --master-subnet "$ClusterName-control-plane-subnet" --worker-subnet "$ClusterName-worker-subnet"

Crie or container registry:

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

Connecting ARO to a Container Registry:

az acr credential show -n $ContainerRegistryName

oc create secret docker-registry --docker-server=$ContainerRegistryName.azurecr.io --docker-username=<user name> --docker-password=<your password>--docker-email=unused acr-secret

oc secrets link default <pull_secret_name> --for=pull

Check the URL in the OpenShift console.

az aro show --name $ClusterName --resource-group $ResourceGroupName -o tsv --query consoleProfile

Pegue trusts OpenShift:

az aro list-credentials --name $ClusterName --resource-group $ResourceGroupName -o tsv

Verify cluster connectivity.

Added for reference:

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

Verify correct OS pod:

kubectl get pods -n dapr-system

Expected answer:

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

Added for reference:

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

Neste project, here are 3 different options (example):

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 .

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

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

Verify correct OS pod:

kubectl get pods -n tree

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

# configurar a porta para acesso local
kubectl port-forward pod/producer1 8081 8081 -n tree

# enviar post para a aplicação producer
- POST -> http://localhost:8081/plant
- Json Body: {"numberOfTrees":100}

# Validar status dos pods
kubectl get pod -l app=consumer1 -n tree

Finally, after the testicles are terminated, a command is executed for the task components that are excluded from the sky blue when the app is running.

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

Delete all Azure resources:

az aro delete --resource-group $ResourceGroupName --name $ClusterName
az acr delete --resource-group $ResourceGroupName --name $ContainerRegistryName
az group delete --name $ResourceGroupName





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