Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Azure Kubernetes Service Quickstart

Azure Kubernetes Service Quickstart

Presentatie gegeven tijdens devCampNoord '24 in Kinepolis Groningen.

devNetNoord

April 04, 2024
Tweet

More Decks by devNetNoord

Other Decks in Technology

Transcript

  1. What is Kubernetes? • Open-source platform for managing containerized workloads

    and services. • Widely used, so a lot of support and can be used on many platforms, including Azure
  2. What is Kubernetes? • Kubernetes means something like helmsman or

    captain in Greek. Some Kubernetes components continue the nautical theme.
  3. Alternatives Azure Container Instances + Easier / simpler + No

    overhead containers + Serverless + Linux and Windows - Limited scale - Limited customizability - Limited integrations Azure Container Apps + Easier / simpler + No overhead containers + Serverless + Price flexibility - Only Linux OS - Limited scale - Limited customizability - Limited integrations
  4. When should we use AKS? • Scale is big enough

    • Enough Traffic/Use • Expertise of the team • Needs to be highly available
  5. resource aks 'Microsoft.ContainerService/managedClusters@2022-05-02-preview' = { properties: { dnsPrefix: dnsPrefix agentPoolProfiles:

    [ { name: 'agentpool' osDiskSizeGB: osDiskSizeGB count: 3 vmSize: 'Standard_B4ms' osType: 'Linux' mode: 'System' enableNodePublicIP: false } { name: 'apps' count: 2 vmSize: 'Standard_A2_v2’ … type: 'VirtualMachineScaleSets' maxCount: 2 minCount: 0 enableAutoScaling: true mode: 'User' osType: 'Linux' } ] } sku: { name: 'Basic' tier: 'Free' } }
  6. Container FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /App # Copy everything

    COPY . ./ # Restore as distinct layers RUN dotnet restore # Build and publish a release RUN dotnet publish -c Release -o out # Build runtime image FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /App COPY --from=build-env /App/out . ENTRYPOINT ["dotnet", "DotNet.Docker.dll"]
  7. What are the benefits? • Ability to scale • Automatic

    recovery (restart) • Geen deployment downtime
  8. Is it that easy? No • Roles / Role bindings

    • Service accounts • Configmaps • Secrets • Persistent volume (claims) • Ingresses • Services • Resource limits • Cluster roles / Cluster role bindings • Daemonsets • Cronjobs / Jobs • Init containers • Annotations • Labels • Ingress controllers • GatewayAPI’s • DNS • Ephemeral volumes • Taints and tolerations • Certificate management • Proxies • Addons • Custom resource definitions • Garbage collection
  9. What have we learned? • Liveness en readiness probe •

    Rollout van applicatie is slim var builder = WebApplication.CreateBuilder(args); builder.Services.AddHealthChecks(); var app = builder.Build(); app.MapHealthChecks("/healthz"); app.Run();
  10. How does (managed) Azure Kubernetes Service work? • Works with

    • Identities / AD • Cost management • Migratie services • Networking • Can of course connect to • Storage • Key Vault • Application Gateway • Azure Container Registry • Kubernetes takes care of the containers • You are responsible for the nodes / vm's