From 17eccd4b6f602f831ab3240f87e8152ca0480806 Mon Sep 17 00:00:00 2001 From: Diego Lagos <92735530+diegolagospagopa@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:19:37 +0200 Subject: [PATCH] feat: Added Tolerations to docs (#118) --- README.md | 31 +++++++++++++++++-- charts/microservice-chart/README.md | 2 +- .../helm/Chart.lock | 6 ++-- .../helm/Chart.yaml | 2 +- .../helm/values-devopslab-dev.yaml | 11 +++---- .../helm/Chart.lock | 6 ++-- .../helm/Chart.yaml | 2 +- .../helm/values-devopslab-dev.yaml | 5 --- 8 files changed, 42 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 70d9585..73ae50b 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ version: 1.0.0 appVersion: 1.0.0 dependencies: - name: microservice-chart - version: 1.19.0 + version: 5.9.1 repository: "https://pagopa.github.io/aks-microservice-chart-blueprint" EOF ``` @@ -125,7 +125,7 @@ K8s: - Reloader of other tools that allow to restar the pod in case of some of the config map or secret are changed -## 🚀 Functionality & Values keys/Yaml chart configuration properties (values.yaml) +## 📑 Functionality & Values keys/Yaml chart configuration properties (values.yaml) see [README/Microservice Chart configuration](charts/microservice-chart/README.md) to understand how to use the values. @@ -257,7 +257,7 @@ This volume use a pvc to persist the data minAvailable: 0 ``` -### `affinity (HA)` +### `Affinity/HA (nodeAffinity & podAntiAffinity)` This snippet allows to install pod into different nodes, created in different AZ's @@ -287,6 +287,31 @@ This snippet allows to install pod into different nodes, created in different AZ topologyKey: topology.kubernetes.io/zone ``` +This code snippet in AKS forces the pods not to be all in the same node but to distribute themselves as much as possible in nodes created in different AZs, this is not blocking but only a desire, in fact if it is not possible the pods will still be deployed inside a node + +```yaml + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + aadpodidbinding: blueprint-pod-identity + namespaces: ["blueprint"] + topologyKey: topology.kubernetes.io/zone +``` + +### Tolerations + +```yaml + tolerations: + - effect: "NoSchedule" + key: "paymentWalletOnly" + operator: "Equal" + value: "true" +``` + ### Probe: Liveness, Readiness, Starup #### `livenessProbe` diff --git a/charts/microservice-chart/README.md b/charts/microservice-chart/README.md index 0164270..785f0f4 100644 --- a/charts/microservice-chart/README.md +++ b/charts/microservice-chart/README.md @@ -1,6 +1,6 @@ # microservice-chart -![Version: 5.9.0](https://img.shields.io/badge/Version-5.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square) +![Version: 5.9.1](https://img.shields.io/badge/Version-5.9.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square) A Helm chart for PagoPA microservice diff --git a/tests/v5-java-helm-complete-test-bar/helm/Chart.lock b/tests/v5-java-helm-complete-test-bar/helm/Chart.lock index 73803ad..1b88d09 100644 --- a/tests/v5-java-helm-complete-test-bar/helm/Chart.lock +++ b/tests/v5-java-helm-complete-test-bar/helm/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: microservice-chart repository: file://../../../charts/microservice-chart - version: 5.9.0 -digest: sha256:8890aa322d3ea0ce725bcbff2f9b243037b2fec73a6eea690ff7d5673ecf8275 -generated: "2024-05-22T15:46:19.905526+02:00" + version: 5.9.1 +digest: sha256:16387a60e66fc6d5437dbd006ca32f917f50cbf9f8e16d8afd3a9790e7caddc4 +generated: "2024-06-12T19:30:53.77837+02:00" diff --git a/tests/v5-java-helm-complete-test-bar/helm/Chart.yaml b/tests/v5-java-helm-complete-test-bar/helm/Chart.yaml index 6f88a89..aef36cb 100644 --- a/tests/v5-java-helm-complete-test-bar/helm/Chart.yaml +++ b/tests/v5-java-helm-complete-test-bar/helm/Chart.yaml @@ -6,5 +6,5 @@ version: 1.0.0 appVersion: 1.0.0 dependencies: - name: microservice-chart - version: 5.9.0 + version: 5.9.1 repository: file://../../../charts/microservice-chart diff --git a/tests/v5-java-helm-complete-test-bar/helm/values-devopslab-dev.yaml b/tests/v5-java-helm-complete-test-bar/helm/values-devopslab-dev.yaml index 2002d05..dcdd2f0 100644 --- a/tests/v5-java-helm-complete-test-bar/helm/values-devopslab-dev.yaml +++ b/tests/v5-java-helm-complete-test-bar/helm/values-devopslab-dev.yaml @@ -154,7 +154,11 @@ microservice-chart: # nodeSelector: {} - # tolerations: [] + tolerations: + - effect: "NoSchedule" + key: "paymentWalletOnly" + operator: "Equal" + value: "true" affinity: nodeAffinity: @@ -165,11 +169,6 @@ microservice-chart: operator: In values: - user - - matchExpressions: - - key: elastic - operator: In - values: - - eck podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 diff --git a/tests/v5-java-helm-complete-test-foo/helm/Chart.lock b/tests/v5-java-helm-complete-test-foo/helm/Chart.lock index 842dff1..0f4cb74 100644 --- a/tests/v5-java-helm-complete-test-foo/helm/Chart.lock +++ b/tests/v5-java-helm-complete-test-foo/helm/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: microservice-chart repository: file://../../../charts/microservice-chart - version: 5.9.0 -digest: sha256:8890aa322d3ea0ce725bcbff2f9b243037b2fec73a6eea690ff7d5673ecf8275 -generated: "2024-05-22T15:47:51.972745+02:00" + version: 5.9.1 +digest: sha256:16387a60e66fc6d5437dbd006ca32f917f50cbf9f8e16d8afd3a9790e7caddc4 +generated: "2024-06-12T22:55:34.585351+02:00" diff --git a/tests/v5-java-helm-complete-test-foo/helm/Chart.yaml b/tests/v5-java-helm-complete-test-foo/helm/Chart.yaml index e17a0dc..4f6737d 100644 --- a/tests/v5-java-helm-complete-test-foo/helm/Chart.yaml +++ b/tests/v5-java-helm-complete-test-foo/helm/Chart.yaml @@ -6,5 +6,5 @@ version: 1.0.0 appVersion: 1.0.0 dependencies: - name: microservice-chart - version: 5.9.0 + version: 5.9.1 repository: file://../../../charts/microservice-chart diff --git a/tests/v5-java-helm-complete-test-foo/helm/values-devopslab-dev.yaml b/tests/v5-java-helm-complete-test-foo/helm/values-devopslab-dev.yaml index 9b684aa..f10beb2 100644 --- a/tests/v5-java-helm-complete-test-foo/helm/values-devopslab-dev.yaml +++ b/tests/v5-java-helm-complete-test-foo/helm/values-devopslab-dev.yaml @@ -141,11 +141,6 @@ microservice-chart: operator: In values: - user - - matchExpressions: - - key: elastic - operator: In - values: - - eck podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100