1 of 22

Arquitetura .NetAplicações .NET no Kubernetes: Pequenos detalhes fazem a diferença

Fabrício Veronez

Fundados da Formação DevOps Pro

Globalcode – Open4education

2 of 22

Liveness e Readiness Probe

Globalcode – Open4education

3 of 22

Liveness Probe

Globalcode – Open4education

4 of 22

Liveness Probe

Globalcode – Open4education

5 of 22

Readiness Probe

Globalcode – Open4education

6 of 22

Readiness Probe

Globalcode – Open4education

7 of 22

Liveness e Readiness Probe

  • Comando
  • TCP
  • HTTP
  • GRPC

Globalcode – Open4education

8 of 22

Health checks no ASP.NET Core

Globalcode – Open4education

9 of 22

Resource �Request e Limits

Globalcode – Open4education

10 of 22

CPU

Memória Disponível

Node

CPU para o sistema

Memória reservada para o sistema

CPU para o Kubernetes

Memória reservada para o Kubernetes

Pod A

Pod A

Pod B

Pod B

CPU

Memória Disponível

Node

CPU para o sistema

Memória reservada para o sistema

CPU para o Kubernetes

Memória reservada para o Kubernetes

Pod A

Pod A

Pod B

Pod B

Memory Request

CPU Request

Memory Limit

CPU Limit

Globalcode – Open4education

11 of 22

Quality of Service

Globalcode – Open4education

12 of 22

Guaranteed

Requisito�CPU e Memory request e Limit dos containers do Pod precisam ter o mesmo valor

Burstable

Requisito�Pelo menos um dos containers do Pod possui memory ou CPU request ou limit declarado

BestEffort

Requisito�CPU e Memory requests e Limits dos containers do Pod não possuem nenhuma declaração

Globalcode – Open4education

13 of 22

Testes de Performance

Globalcode – Open4education

14 of 22

ConfigMap, Secrets e KMS

Globalcode – Open4education

15 of 22

ConfigMap e Secrets

Globalcode – Open4education

16 of 22

{

    "Logging": {

        "LogLevel": {

            "Default": "Information",

            "Microsoft.AspNetCore": "Warning"

        }

    },

    "AllowedHosts": "*"

}

apiVersion: v1

kind: ConfigMap

metadata:

  name: exemplo

data:

  Logging__LogLevel__Default: Information

  Logging__LogLevel__Microsoft.AspNetCore: Information

  AllowedHosts: "*"

Globalcode – Open4education

17 of 22

KMS (Key Management Service)

Globalcode – Open4education

18 of 22

Uso de Deployment, StateFullSet, DaemonSet, Jobs, CronJobs

Globalcode – Open4education

19 of 22

Deployment

StateFullSet

DaemonSet

Jobs

CronJobs

Globalcode – Open4education

20 of 22

NetworkPolicy

Globalcode – Open4education

21 of 22

@fabricioveronez

Globalcode – Open4education

22 of 22