Hybrid Cloud Deployments with .NET 8: Running Containers on Azure Arc‑Enabled Kubernetes

Mahmut Sarıkaya 3 dk okuma 17 Görüntülenme 0
Hybrid Cloud Deployments with .NET 8: Running Containers on Azure Arc‑Enabled Kubernetes

Why Hybrid Cloud Matters

Enterprises are accelerating edge deployments: a 2023 IDC report shows that 62% of organizations plan to run workloads at the edge within the next 12 months. .NET 8’s performance improvements and native container support make it a prime candidate for workloads that need to stay close to data sources while still benefiting from central cloud services.

Preparing .NET 8 for Containerization

Start with the new minimal hosting model introduced in .NET 8. A simple Web API can be built in under 30 lines of code, and the SDK now ships with a dotnet publish that produces a self‑contained Linux container image. Below is a Dockerfile that uses the official mcr.microsoft.com/dotnet/aspnet:8.0 base image and enables multi‑stage builds.

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY *.csproj . RUN dotnet restore COPY . . RUN dotnet publish -c Release -o /app --no-restore FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY --from=build /app . ENTRYPOINT ["dotnet", "MyApp.dll"]

Run docker build -t myapp:8.0 . and test locally before moving to the cluster.

Deploying to Azure Arc‑Enabled Kubernetes

Azure Arc extends Azure management to any Kubernetes cluster, whether it lives on a factory floor, a retail store, or a traditional data center. After installing the Azure CLI and the Arc extensions, you can register a cluster with a single command.

az extension add --name connectedk8s az connectedk8s connect --name edge-cluster --resource-group MyRG --location eastus

The command injects the Azure Arc agents, creates a resource representation in Azure, and makes the cluster visible in the Azure portal. From there you can push your .NET 8 container image to Azure Container Registry (ACR) and create a Kubernetes deployment manifest.

Managing Edge and On‑Premises Nodes

Hybrid scenarios often require different resource limits. Use node selectors and taints to keep latency‑critical pods on edge nodes while heavier analytics run in the central cloud. Example deployment YAML snippet:

apiVersion: apps/v1 kind: Deployment metadata: name: myapp spec: replicas: 3 selector: matchLabels: app: myapp template: metadata: labels: app: myapp spec: nodeSelector: topology.kubernetes.io/zone: edge containers: - name: myapp image: myacr.azurecr.io/myapp:8.0 resources: limits: cpu: "500m" memory: "256Mi"

Adjust the nodeSelector value to match the labels you applied when provisioning the Arc‑connected cluster.

Monitoring and Scaling

Azure Monitor for containers integrates automatically with Arc‑enabled clusters. Enable the monitoring extension with:

az k8s-extension create \\\n  --name azuremonitor-containers \\
  --cluster-name edge-cluster \\
  --resource-group MyRG \\
  --extension-type Microsoft.AzureMonitor.Containers

Metrics such as CPU, memory, and request latency appear in Azure dashboards, allowing you to set autoscaling rules that respect both edge capacity and cloud burst requirements.

Conclusion

By combining .NET 8’s lean container images with Azure Arc’s unified control plane, developers can deliver consistent functionality across cloud, edge, and on‑premises environments. The key steps are: containerize with the latest SDK, register the Kubernetes cluster to Azure Arc, and leverage node selectors plus Azure Monitor for intelligent placement and observability. The result is a resilient hybrid cloud architecture that scales with business demand while keeping critical processing close to the data source.

Sources

Microsoft Docs – Azure Arc-enabled Kubernetes

Microsoft Docs – .NET 8 release notes

IDC Future of Edge Computing 2023

Author: Mahmut Sarıkaya — sarikayadev.com

Etiketler: #.NET 8 #Azure Arc #Kubernetes #hybrid cloud #edge computing
Paylaş:
M

Yazar

Mahmut Sarıkaya

yazılım Geliştirici

Yorumlar

Henüz yorum yok. İlk yorumu siz yapın!

Yorum Bırakın

2 + 4 =