From e3b87e65e363bdcbeed8e2dc6b30e4df335311d8 Mon Sep 17 00:00:00 2001 From: Pasquale Spica <36746022+pasqualespica@users.noreply.github.com> Date: Sat, 2 Dec 2023 14:35:37 +0100 Subject: [PATCH] chore: Upd chart podAffinity (#28) * upd chart and pod-affinity * fix --- helm/values-dev.yaml | 18 ++++++++++-------- helm/values-prod.yaml | 22 +++++++++++++++++++--- helm/values-uat.yaml | 19 +++++++++++++------ 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index d2a84d43..8a08af0d 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -22,11 +22,14 @@ microservice-chart: periodSeconds: 10 deployment: create: true - service: + serviceMonitor: create: true + ports: + - 8080 + service: type: ClusterIP ports: - - 8080 #http + - 8080 ingress: create: true host: "weudev.bizevents.internal.dev.platform.pagopa.it" @@ -44,15 +47,15 @@ microservice-chart: allowPrivilegeEscalation: false resources: requests: - memory: "1Gi" - cpu: "0.4" + memory: "384Mi" + cpu: "300m" limits: - memory: "1Gi" - cpu: "0.5" + memory: "512Mi" + cpu: "400m" autoscaling: enable: true minReplica: 1 - maxReplica: 2 + maxReplica: 1 pollingInterval: 10 # seconds cooldownPeriod: 50 # seconds triggers: @@ -78,7 +81,6 @@ microservice-chart: APP_NAME: "metadata.labels['app.kubernetes.io/instance']" APP_VERSION: "metadata.labels['app.kubernetes.io/version']" envSecret: - # required APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string' COSMOS_DB_PRIMARY_KEY: 'cosmos-d-biz-key' OTEL_EXPORTER_OTLP_HEADERS: 'elastic-apm-secret-token' diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 2dbdc25a..f7b6e172 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -45,8 +45,8 @@ microservice-chart: memory: "512Mi" cpu: "300m" limits: - memory: "512Mi" - cpu: "300m" + memory: "640Mi" + cpu: "500m" autoscaling: enable: true minReplica: 2 @@ -65,6 +65,13 @@ microservice-chart: COSMOS_DB_NAME: 'db' COSMOS_DB_CONTAINER_NAME: 'biz-events' COSMOS_QUERY_METRICS: 'false' + OTEL_SERVICE_NAME: "pagopabizeventsservice" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=azure-dev" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" + OTEL_TRACES_EXPORTER: otlp + OTEL_METRICS_EXPORTER: otlp + OTEL_LOGS_EXPORTER: none + OTEL_TRACES_SAMPLER: "always_on" envSecret: # required APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string' @@ -83,7 +90,16 @@ microservice-chart: - key: node_type operator: In values: - - "user" + - user + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/instance: pagopabizeventsservice + namespaces: [ "bizevents" ] + topologyKey: topology.kubernetes.io/zone canaryDelivery: deployment: image: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 47b552e0..a5bca5cc 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -22,14 +22,19 @@ microservice-chart: periodSeconds: 10 deployment: create: true - service: + serviceMonitor: create: true + ports: + - 8080 + service: type: ClusterIP - port: 8080 + ports: + - 8080 ingress: create: true host: "weuuat.bizevents.internal.uat.platform.pagopa.it" path: /pagopa-biz-events-service/(.*) + servicePort: 8080 serviceAccount: create: false annotations: {} @@ -42,15 +47,15 @@ microservice-chart: allowPrivilegeEscalation: false resources: requests: - memory: "512Mi" + memory: "384Mi" cpu: "300m" limits: memory: "512Mi" - cpu: "300m" + cpu: "400m" autoscaling: enable: true minReplica: 1 - maxReplica: 5 + maxReplica: 1 pollingInterval: 10 # seconds cooldownPeriod: 50 # seconds triggers: @@ -72,8 +77,10 @@ microservice-chart: OTEL_METRICS_EXPORTER: otlp OTEL_LOGS_EXPORTER: none OTEL_TRACES_SAMPLER: "always_on" + envFieldRef: + APP_NAME: "metadata.labels['app.kubernetes.io/instance']" + APP_VERSION: "metadata.labels['app.kubernetes.io/version']" envSecret: - # required APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string' COSMOS_DB_PRIMARY_KEY: 'cosmos-u-biz-key' OTEL_EXPORTER_OTLP_HEADERS: 'elastic-apm-secret-token'