From 286cc596a585e343e696e9c732f6e00f554b88e0 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Tue, 17 Nov 2020 10:43:24 +0100 Subject: [PATCH 1/4] Provide capability to tweak liveness/readines probes Signed-off-by: Tom Kerkhove --- changelog/content/experimental/unreleased.md | 1 + charts/promitor-agent-resource-discovery/README.md | 4 ++++ .../templates/deployment.yaml | 4 ++++ charts/promitor-agent-resource-discovery/values.yaml | 8 ++++++++ charts/promitor-agent-scraper/README.md | 4 ++++ .../promitor-agent-scraper/templates/deployment.yaml | 4 ++++ charts/promitor-agent-scraper/values.yaml | 10 +++++++++- 7 files changed, 34 insertions(+), 1 deletion(-) diff --git a/changelog/content/experimental/unreleased.md b/changelog/content/experimental/unreleased.md index 1d49ec920..d202096e8 100644 --- a/changelog/content/experimental/unreleased.md +++ b/changelog/content/experimental/unreleased.md @@ -26,6 +26,7 @@ version: - {{% tag added %}} New validation rule to ensure declarative or dynamic discovery for metrics to scrape are configured - {{% tag added %}} New System API endpoint giving runtime information ([docs](https://promitor.io/operations/#system) | [#1208](https://github.com/tomkerkhove/promitor/issues/1208)) +- {{% tag added %}} Provide capability to tweak liveness/readines probes in Helm charts ([#1350](https://github.com/tomkerkhove/promitor/issues/1350)) - {{% tag changed %}} Show Promitor version during startup - {{% tag changed %}} Provide capability to scrape all queues in Azure Service Bus, instead of having to declare the queue name. ([#529](https://github.com/tomkerkhove/promitor/issues/529)). diff --git a/charts/promitor-agent-resource-discovery/README.md b/charts/promitor-agent-resource-discovery/README.md index e280dd095..2fe800717 100644 --- a/charts/promitor-agent-resource-discovery/README.md +++ b/charts/promitor-agent-resource-discovery/README.md @@ -76,6 +76,10 @@ their default values. | `rbac.serviceAccount.create` | Create service account resource | `true` | | `rbac.serviceAccount.name` | Service account name to use if create is false. If create is true, a name is generated using the fullname template | `promitor-resource-discovery` | | `rbac.serviceAccount.annotations` | Service account annotations| `{}` | +| `health.readiness.delay` | Amount of seconds to wait before probing the container to verify if it's ready | `5` | | +| `health.readiness.interval` | Amount of seconds to wait before probing the container again to verify if it's ready after the last attempt | `5` | | +| `health.liveness.delay` | Amount of seconds to wait before probing the container to verify if it's still alive | `5` | | +| `health.liveness.interval` | Amount of seconds to wait before probing the container again to verify if it's still alive after the last attempt | `30` | | | `resources` | Pod resource requests & limits | `{}` | | `secrets.createSecret` | Indication if you want to bring your own secret level of logging | `true` | | | `secrets.appKeySecret` | Name of the secret for Azure AD identity secret | `azure-app-key` | diff --git a/charts/promitor-agent-resource-discovery/templates/deployment.yaml b/charts/promitor-agent-resource-discovery/templates/deployment.yaml index c1730a41c..c5568124b 100644 --- a/charts/promitor-agent-resource-discovery/templates/deployment.yaml +++ b/charts/promitor-agent-resource-discovery/templates/deployment.yaml @@ -59,10 +59,14 @@ spec: httpGet: path: /api/v1/health port: http + initialDelaySeconds: {{ .Values.health.liveness.delay }} + periodSeconds: {{ .Values.health.liveness.interval }} readinessProbe: httpGet: path: /api/v1/health port: http + initialDelaySeconds: {{ .Values.health.readiness.delay }} + periodSeconds: {{ .Values.health.readiness.interval }} volumes: - name: config-volume-{{ template "promitor-agent-resource-discovery.name" . }} configMap: diff --git a/charts/promitor-agent-resource-discovery/values.yaml b/charts/promitor-agent-resource-discovery/values.yaml index dd0032dc6..48dab2b82 100644 --- a/charts/promitor-agent-resource-discovery/values.yaml +++ b/charts/promitor-agent-resource-discovery/values.yaml @@ -65,6 +65,14 @@ service: dnsPrefix: enabled: false +health: + readiness: + delay: 5 + interval: 5 + liveness: + delay: 5 + interval: 30 + resources: {} # limits: # cpu: 100m diff --git a/charts/promitor-agent-scraper/README.md b/charts/promitor-agent-scraper/README.md index 184e423b6..a28c722ca 100644 --- a/charts/promitor-agent-scraper/README.md +++ b/charts/promitor-agent-scraper/README.md @@ -94,6 +94,10 @@ their default values. | `rbac.serviceAccount.create` | Create service account resource | `true` | | `rbac.serviceAccount.name` | Service account name to use if create is false. If create is true, a name is generated using the fullname template | `promitor-scraper` | | `rbac.serviceAccount.annotations` | Service account annotations| `{}` | +| `health.readiness.delay` | Amount of seconds to wait before probing the container to verify if it's ready | `5` | | +| `health.readiness.interval` | Amount of seconds to wait before probing the container again to verify if it's ready after the last attempt | `5` | | +| `health.liveness.delay` | Amount of seconds to wait before probing the container to verify if it's still alive | `5` | | +| `health.liveness.interval` | Amount of seconds to wait before probing the container again to verify if it's still alive after the last attempt | `30` | | | `resources` | Pod resource requests & limits | `{}` | | `secrets.createSecret` | Indication if you want to bring your own secret level of logging | `true` | | `secrets.appIdSecret` | Name of the secret for Azure AD identity id | `azure-app-id` | diff --git a/charts/promitor-agent-scraper/templates/deployment.yaml b/charts/promitor-agent-scraper/templates/deployment.yaml index c448862d8..eaa027fe7 100644 --- a/charts/promitor-agent-scraper/templates/deployment.yaml +++ b/charts/promitor-agent-scraper/templates/deployment.yaml @@ -69,10 +69,14 @@ spec: httpGet: path: /api/v1/health port: http + initialDelaySeconds: {{ .Values.health.liveness.delay }} + periodSeconds: {{ .Values.health.liveness.interval }} readinessProbe: httpGet: path: /api/v1/health port: http + initialDelaySeconds: {{ .Values.health.readiness.delay }} + periodSeconds: {{ .Values.health.readiness.interval }} volumes: - name: config-volume-{{ template "promitor-agent-scraper.name" . }} configMap: diff --git a/charts/promitor-agent-scraper/values.yaml b/charts/promitor-agent-scraper/values.yaml index 9b27cbc38..2219376c5 100644 --- a/charts/promitor-agent-scraper/values.yaml +++ b/charts/promitor-agent-scraper/values.yaml @@ -80,7 +80,7 @@ secrets: atlassianStatuspageApiKey: atlassian-statuspage-apikey service: - port: 8888 + port: 8887 targetPort: 88 labelType: infrastructure selectorType: runtime @@ -88,6 +88,14 @@ service: dnsPrefix: enabled: false +health: + readiness: + delay: 5 + interval: 5 + liveness: + delay: 5 + interval: 30 + resources: {} # limits: # cpu: 100m From 4e3e816509be473f7b2cf1ead562c665e09d2082 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Tue, 17 Nov 2020 15:51:40 +0100 Subject: [PATCH 2/4] Provide capability to opt-out of probing Signed-off-by: Tom Kerkhove --- charts/promitor-agent-resource-discovery/README.md | 2 ++ .../templates/deployment.yaml | 4 ++++ charts/promitor-agent-resource-discovery/values.yaml | 2 ++ charts/promitor-agent-scraper/README.md | 2 ++ charts/promitor-agent-scraper/templates/deployment.yaml | 4 ++++ charts/promitor-agent-scraper/values.yaml | 2 ++ 6 files changed, 16 insertions(+) diff --git a/charts/promitor-agent-resource-discovery/README.md b/charts/promitor-agent-resource-discovery/README.md index 2fe800717..647450e95 100644 --- a/charts/promitor-agent-resource-discovery/README.md +++ b/charts/promitor-agent-resource-discovery/README.md @@ -76,8 +76,10 @@ their default values. | `rbac.serviceAccount.create` | Create service account resource | `true` | | `rbac.serviceAccount.name` | Service account name to use if create is false. If create is true, a name is generated using the fullname template | `promitor-resource-discovery` | | `rbac.serviceAccount.annotations` | Service account annotations| `{}` | +| `health.readiness.enabled` | Indication if readiness probes should be used | `true` | | | `health.readiness.delay` | Amount of seconds to wait before probing the container to verify if it's ready | `5` | | | `health.readiness.interval` | Amount of seconds to wait before probing the container again to verify if it's ready after the last attempt | `5` | | +| `health.liveness.enabled` | Indication if liveness probes should be used | `true` | | | `health.liveness.delay` | Amount of seconds to wait before probing the container to verify if it's still alive | `5` | | | `health.liveness.interval` | Amount of seconds to wait before probing the container again to verify if it's still alive after the last attempt | `30` | | | `resources` | Pod resource requests & limits | `{}` | diff --git a/charts/promitor-agent-resource-discovery/templates/deployment.yaml b/charts/promitor-agent-resource-discovery/templates/deployment.yaml index c5568124b..32fc51c35 100644 --- a/charts/promitor-agent-resource-discovery/templates/deployment.yaml +++ b/charts/promitor-agent-resource-discovery/templates/deployment.yaml @@ -55,18 +55,22 @@ spec: volumeMounts: - name: config-volume-{{ template "promitor-agent-resource-discovery.name" . }} mountPath: /config/ + {{- if .Values.health.liveness.enabled }} livenessProbe: httpGet: path: /api/v1/health port: http initialDelaySeconds: {{ .Values.health.liveness.delay }} periodSeconds: {{ .Values.health.liveness.interval }} + {{- end }} + {{- if .Values.health.readiness.enabled }} readinessProbe: httpGet: path: /api/v1/health port: http initialDelaySeconds: {{ .Values.health.readiness.delay }} periodSeconds: {{ .Values.health.readiness.interval }} + {{- end }} volumes: - name: config-volume-{{ template "promitor-agent-resource-discovery.name" . }} configMap: diff --git a/charts/promitor-agent-resource-discovery/values.yaml b/charts/promitor-agent-resource-discovery/values.yaml index 48dab2b82..149b67c6c 100644 --- a/charts/promitor-agent-resource-discovery/values.yaml +++ b/charts/promitor-agent-resource-discovery/values.yaml @@ -67,9 +67,11 @@ service: health: readiness: + enabled: true delay: 5 interval: 5 liveness: + enabled: true delay: 5 interval: 30 diff --git a/charts/promitor-agent-scraper/README.md b/charts/promitor-agent-scraper/README.md index a28c722ca..26b788cc5 100644 --- a/charts/promitor-agent-scraper/README.md +++ b/charts/promitor-agent-scraper/README.md @@ -94,8 +94,10 @@ their default values. | `rbac.serviceAccount.create` | Create service account resource | `true` | | `rbac.serviceAccount.name` | Service account name to use if create is false. If create is true, a name is generated using the fullname template | `promitor-scraper` | | `rbac.serviceAccount.annotations` | Service account annotations| `{}` | +| `health.readiness.enabled` | Indication if readiness probes should be used | `true` | | | `health.readiness.delay` | Amount of seconds to wait before probing the container to verify if it's ready | `5` | | | `health.readiness.interval` | Amount of seconds to wait before probing the container again to verify if it's ready after the last attempt | `5` | | +| `health.liveness.enabled` | Indication if liveness probes should be used | `true` | | | `health.liveness.delay` | Amount of seconds to wait before probing the container to verify if it's still alive | `5` | | | `health.liveness.interval` | Amount of seconds to wait before probing the container again to verify if it's still alive after the last attempt | `30` | | | `resources` | Pod resource requests & limits | `{}` | diff --git a/charts/promitor-agent-scraper/templates/deployment.yaml b/charts/promitor-agent-scraper/templates/deployment.yaml index eaa027fe7..1e3b68116 100644 --- a/charts/promitor-agent-scraper/templates/deployment.yaml +++ b/charts/promitor-agent-scraper/templates/deployment.yaml @@ -65,18 +65,22 @@ spec: volumeMounts: - name: config-volume-{{ template "promitor-agent-scraper.name" . }} mountPath: /config/ + {{- if .Values.health.liveness.enabled }} livenessProbe: httpGet: path: /api/v1/health port: http initialDelaySeconds: {{ .Values.health.liveness.delay }} periodSeconds: {{ .Values.health.liveness.interval }} + {{- end }} + {{- if .Values.health.readiness.enabled }} readinessProbe: httpGet: path: /api/v1/health port: http initialDelaySeconds: {{ .Values.health.readiness.delay }} periodSeconds: {{ .Values.health.readiness.interval }} + {{- end }} volumes: - name: config-volume-{{ template "promitor-agent-scraper.name" . }} configMap: diff --git a/charts/promitor-agent-scraper/values.yaml b/charts/promitor-agent-scraper/values.yaml index 2219376c5..363b723da 100644 --- a/charts/promitor-agent-scraper/values.yaml +++ b/charts/promitor-agent-scraper/values.yaml @@ -90,9 +90,11 @@ service: health: readiness: + enabled: true delay: 5 interval: 5 liveness: + enabled: true delay: 5 interval: 30 From 69c7b3750cefdf7b90264d0de9abeff775459c17 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Tue, 17 Nov 2020 20:09:53 +0100 Subject: [PATCH 3/4] Revert port change Signed-off-by: Tom Kerkhove --- charts/promitor-agent-scraper/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/promitor-agent-scraper/values.yaml b/charts/promitor-agent-scraper/values.yaml index 363b723da..ffafaffc7 100644 --- a/charts/promitor-agent-scraper/values.yaml +++ b/charts/promitor-agent-scraper/values.yaml @@ -80,7 +80,7 @@ secrets: atlassianStatuspageApiKey: atlassian-statuspage-apikey service: - port: 8887 + port: 8888 targetPort: 88 labelType: infrastructure selectorType: runtime From ea4073984dd273da022f40ee1fa180bf839dd6db Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Tue, 17 Nov 2020 20:42:44 +0100 Subject: [PATCH 4/4] Whitespaces dont' add value Signed-off-by: Tom Kerkhove --- charts/promitor-agent-resource-discovery/values.yaml | 4 ++-- charts/promitor-agent-scraper/values.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/promitor-agent-resource-discovery/values.yaml b/charts/promitor-agent-resource-discovery/values.yaml index 149b67c6c..b551cb023 100644 --- a/charts/promitor-agent-resource-discovery/values.yaml +++ b/charts/promitor-agent-resource-discovery/values.yaml @@ -66,11 +66,11 @@ service: enabled: false health: - readiness: + readiness: enabled: true delay: 5 interval: 5 - liveness: + liveness: enabled: true delay: 5 interval: 30 diff --git a/charts/promitor-agent-scraper/values.yaml b/charts/promitor-agent-scraper/values.yaml index ffafaffc7..a891876db 100644 --- a/charts/promitor-agent-scraper/values.yaml +++ b/charts/promitor-agent-scraper/values.yaml @@ -89,15 +89,15 @@ service: enabled: false health: - readiness: + readiness: enabled: true delay: 5 interval: 5 - liveness: + liveness: enabled: true delay: 5 interval: 30 - + resources: {} # limits: # cpu: 100m