From c9231445a98c5f875a3ab4d34681835b616af68d Mon Sep 17 00:00:00 2001 From: jstewart612 Date: Tue, 6 Dec 2022 20:44:11 -0500 Subject: [PATCH 1/6] make probes on streaming and web deployments user configurable with existing values as defaults --- Chart.yaml | 2 +- templates/deployment-streaming.yaml | 16 ++++++++++------ templates/deployment-web.yaml | 19 +++++++++---------- values.yaml | 23 +++++++++++++++++++++++ 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 1ebc973..dab9b44 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.0.0 +version: 4.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/templates/deployment-streaming.yaml b/templates/deployment-streaming.yaml index dd80404..2bc9764 100644 --- a/templates/deployment-streaming.yaml +++ b/templates/deployment-streaming.yaml @@ -62,14 +62,18 @@ spec: - name: streaming containerPort: {{ .Values.mastodon.streaming.port }} protocol: TCP + {{- if .Values.mastodon.streaming.livenessProbe }} livenessProbe: - httpGet: - path: /api/v1/streaming/health - port: streaming + {{- toYaml .Values.mastodon.streaming.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.mastodon.streaming.readinessProbe }} readinessProbe: - httpGet: - path: /api/v1/streaming/health - port: streaming + {{- toYaml .Values.mastodon.streaming.readinessProbe | nindent 12 }} + {{- end }} + {{- if .Values.mastodon.streaming.startupProbe }} + startupProbe: + {{- toYaml .Values.mastodon.streaming.startupProbe | nindent 12 }} + {{- end }} {{- with (default .Values.resources .Values.mastodon.streaming.resources) }} resources: {{- toYaml . | nindent 12 }} diff --git a/templates/deployment-web.yaml b/templates/deployment-web.yaml index c1ec232..ce2d49b 100644 --- a/templates/deployment-web.yaml +++ b/templates/deployment-web.yaml @@ -97,19 +97,18 @@ spec: - name: http containerPort: {{ .Values.mastodon.web.port }} protocol: TCP + {{- if .Values.mastodon.web.livenessProbe }} livenessProbe: - tcpSocket: - port: http + {{- toYaml .Values.mastodon.web.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.mastodon.web.readinessProbe }} readinessProbe: - httpGet: - path: /health - port: http + {{- toYaml .Values.mastodon.web.readinessProbe | nindent 12 }} + {{- end }} + {{- if .Values.mastodon.web.startupProbe }} startupProbe: - httpGet: - path: /health - port: http - failureThreshold: 30 - periodSeconds: 5 + {{- toYaml .Values.mastodon.web.startupProbe | nindent 12 }} + {{- end }} {{- with (default .Values.resources .Values.mastodon.web.resources) }} resources: {{- toYaml . | nindent 12 }} diff --git a/values.yaml b/values.yaml index 0b926b8..21e3b42 100644 --- a/values.yaml +++ b/values.yaml @@ -169,6 +169,15 @@ mastodon: # requests: # cpu: 250m # memory: 128Mi + # -- (Streaming Deployment) liveness and readiness probes + livenessProbe: + httpGet: + path: /api/v1/streaming/health + port: streaming + readinessProbe: + httpGet: + path: /api/v1/streaming/health + port: streaming web: port: 3000 # -- Number of Web Pods running @@ -187,6 +196,20 @@ mastodon: # requests: # cpu: 250m # memory: 768Mi + # -- (Web Deployment) liveness and readiness probes + livenessProbe: + tcpSocket: + port: http + readinessProbe: + httpGet: + path: /health + port: http + startupProbe: + httpGet: + path: /health + port: http + failureThreshold: 30 + periodSeconds: 5 metrics: statsd: From fc817e84b603270a6aa803c62396eae16a628f23 Mon Sep 17 00:00:00 2001 From: John Stewart <32647598+jstewart612@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:10:43 -0500 Subject: [PATCH 2/6] remove path duplication from deployment-streaming for new values --- templates/deployment-streaming.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/deployment-streaming.yaml b/templates/deployment-streaming.yaml index 2bc9764..6d6a877 100644 --- a/templates/deployment-streaming.yaml +++ b/templates/deployment-streaming.yaml @@ -62,17 +62,17 @@ spec: - name: streaming containerPort: {{ .Values.mastodon.streaming.port }} protocol: TCP - {{- if .Values.mastodon.streaming.livenessProbe }} + {{- with .Values.mastodon.streaming.livenessProbe }} livenessProbe: - {{- toYaml .Values.mastodon.streaming.livenessProbe | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} - {{- if .Values.mastodon.streaming.readinessProbe }} + {{- with .Values.mastodon.streaming.readinessProbe }} readinessProbe: - {{- toYaml .Values.mastodon.streaming.readinessProbe | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} - {{- if .Values.mastodon.streaming.startupProbe }} + {{- with .Values.mastodon.streaming.startupProbe }} startupProbe: - {{- toYaml .Values.mastodon.streaming.startupProbe | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} {{- with (default .Values.resources .Values.mastodon.streaming.resources) }} resources: From 1e3c4efd3b433dea9bdf23c879645a10c5e302db Mon Sep 17 00:00:00 2001 From: John Stewart <32647598+jstewart612@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:11:42 -0500 Subject: [PATCH 3/6] remove path duplication from deployment-web for new values --- templates/deployment-web.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/deployment-web.yaml b/templates/deployment-web.yaml index ce2d49b..687aef0 100644 --- a/templates/deployment-web.yaml +++ b/templates/deployment-web.yaml @@ -97,17 +97,17 @@ spec: - name: http containerPort: {{ .Values.mastodon.web.port }} protocol: TCP - {{- if .Values.mastodon.web.livenessProbe }} + {{- with .Values.mastodon.web.livenessProbe }} livenessProbe: - {{- toYaml .Values.mastodon.web.livenessProbe | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} - {{- if .Values.mastodon.web.readinessProbe }} + {{- with .Values.mastodon.web.readinessProbe }} readinessProbe: - {{- toYaml .Values.mastodon.web.readinessProbe | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} - {{- if .Values.mastodon.web.startupProbe }} + {{- with .Values.mastodon.web.startupProbe }} startupProbe: - {{- toYaml .Values.mastodon.web.startupProbe | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} {{- with (default .Values.resources .Values.mastodon.web.resources) }} resources: From a6d5338a85160a479da5ad6079f6142bb6990d73 Mon Sep 17 00:00:00 2001 From: John Stewart <32647598+jstewart612@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:15:56 -0500 Subject: [PATCH 4/6] set startupProbe by default of streaming to same pattern as web so we can define common failureThreshold and periodSeconds --- values.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 21e3b42..7e77658 100644 --- a/values.yaml +++ b/values.yaml @@ -171,13 +171,18 @@ mastodon: # memory: 128Mi # -- (Streaming Deployment) liveness and readiness probes livenessProbe: + tcpSocket: + port: streaming + readinessProbe: httpGet: path: /api/v1/streaming/health port: streaming - readinessProbe: + startupProbe: httpGet: path: /api/v1/streaming/health port: streaming + failureThreshold: 30 + periodSeconds: 5 web: port: 3000 # -- Number of Web Pods running From 2e7ed2266ba357722dc1fca7e2337de2794c0cd9 Mon Sep 17 00:00:00 2001 From: John Stewart <32647598+jstewart612@users.noreply.github.com> Date: Thu, 8 Dec 2022 08:48:24 -0500 Subject: [PATCH 5/6] reduce failureThreshold and periodSeconds of startupProbes so containers start quicker and check more frequently --- values.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/values.yaml b/values.yaml index 7e77658..81fdabe 100644 --- a/values.yaml +++ b/values.yaml @@ -173,16 +173,20 @@ mastodon: livenessProbe: tcpSocket: port: streaming + failureThreshold: 30 + periodSeconds: 5 readinessProbe: httpGet: path: /api/v1/streaming/health port: streaming + failureThreshold: 30 + periodSeconds: 5 startupProbe: httpGet: path: /api/v1/streaming/health port: streaming - failureThreshold: 30 - periodSeconds: 5 + failureThreshold: 20 + periodSeconds: 3 web: port: 3000 # -- Number of Web Pods running @@ -205,16 +209,20 @@ mastodon: livenessProbe: tcpSocket: port: http + failureThreshold: 30 + periodSeconds: 5 readinessProbe: httpGet: path: /health port: http + failureThreshold: 30 + periodSeconds: 5 startupProbe: httpGet: path: /health port: http - failureThreshold: 30 - periodSeconds: 5 + failureThreshold: 20 + periodSeconds: 3 metrics: statsd: From a018a90f73e7d0950302027682c0d6edd7ab10a3 Mon Sep 17 00:00:00 2001 From: John Stewart <32647598+jstewart612@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:27:20 -0500 Subject: [PATCH 6/6] update to sisheogorath requested default values --- values.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/values.yaml b/values.yaml index 81fdabe..0afaf2e 100644 --- a/values.yaml +++ b/values.yaml @@ -173,14 +173,14 @@ mastodon: livenessProbe: tcpSocket: port: streaming - failureThreshold: 30 - periodSeconds: 5 + failureThreshold: 3 + periodSeconds: 10 readinessProbe: httpGet: path: /api/v1/streaming/health port: streaming - failureThreshold: 30 - periodSeconds: 5 + failureThreshold: 3 + periodSeconds: 10 startupProbe: httpGet: path: /api/v1/streaming/health @@ -209,14 +209,14 @@ mastodon: livenessProbe: tcpSocket: port: http - failureThreshold: 30 - periodSeconds: 5 + failureThreshold: 3 + periodSeconds: 10 readinessProbe: httpGet: path: /health port: http - failureThreshold: 30 - periodSeconds: 5 + failureThreshold: 3 + periodSeconds: 10 startupProbe: httpGet: path: /health