diff --git a/charts/onechart/Chart.yaml b/charts/onechart/Chart.yaml index 1301138..bf8362b 100644 --- a/charts/onechart/Chart.yaml +++ b/charts/onechart/Chart.yaml @@ -15,4 +15,4 @@ 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: 0.12.2 +version: 0.13.0 diff --git a/charts/onechart/helm-ui.json b/charts/onechart/helm-ui.json index f2e02d3..6745300 100644 --- a/charts/onechart/helm-ui.json +++ b/charts/onechart/helm-ui.json @@ -8,6 +8,21 @@ "uiSchema": { "#/properties/replicas": { "ui:widget": "range" + }, + "#/properties/probe/properties/settings/properties/initialDelaySeconds": { + "ui:widget": "range" + }, + "#/properties/probe/properties/settings/properties/periodSeconds": { + "ui:widget": "range" + }, + "#/properties/probe/properties/settings/properties/successThreshold": { + "ui:widget": "range" + }, + "#/properties/probe/properties/settings/properties/timeoutSeconds": { + "ui:widget": "range" + }, + "#/properties/probe/properties/settings/properties/failureThreshold": { + "ui:widget": "range" } }, "metaData": { diff --git a/charts/onechart/templates/deployment.yaml b/charts/onechart/templates/deployment.yaml index 366ec41..9dcfee0 100644 --- a/charts/onechart/templates/deployment.yaml +++ b/charts/onechart/templates/deployment.yaml @@ -57,14 +57,13 @@ spec: protocol: TCP {{- if .Values.probe.enabled }} readinessProbe: - failureThreshold: 3 httpGet: path: {{ .Values.probe.path }} port: {{ .Values.containerPort }} scheme: HTTP - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 + {{- with .Values.probe.settings }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }} volumeMounts: &volumeMounts {{- range .Values.volumes }} diff --git a/charts/onechart/tests/deployment_probe_test.yaml b/charts/onechart/tests/deployment_probe_test.yaml index 3de4801..c6cf705 100644 --- a/charts/onechart/tests/deployment_probe_test.yaml +++ b/charts/onechart/tests/deployment_probe_test.yaml @@ -11,15 +11,35 @@ tests: - equal: path: spec.template.spec.containers[0].readinessProbe value: - failureThreshold: 3 httpGet: path: "/" port: 80 scheme: HTTP + initialDelaySeconds: 0 periodSeconds: 10 successThreshold: 1 - timeoutSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 - it: Should not set a readinessProbe asserts: - isNull: path: spec.template.spec.containers[0].readinessProbe + - it: Should tune readiness probe + set: + probe: + enabled: true + settings: + periodSeconds: 30 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + httpGet: + path: "/" + port: 80 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 3 + failureThreshold: 3 diff --git a/charts/onechart/values.schema.json b/charts/onechart/values.schema.json index a8fa788..0794698 100644 --- a/charts/onechart/values.schema.json +++ b/charts/onechart/values.schema.json @@ -352,6 +352,67 @@ "examples": [ "/" ] + }, + "settings": { + "$id": "#/properties/probe/properties/settings", + "type": "object", + "title": "Probe thresholds", + "description": "Tune the probe behavior", + "examples": [ + { + "failureThreshold": 3, + "periodSeconds": 10, + "successThreshold": 1, + "timeoutSeconds": 10 + } + ], + "properties": { + "initialDelaySeconds": { + "$id": "#/properties/probe/properties/settings/properties/initialDelaySeconds", + "type": "integer", + "title": "Initial Delay Seconds", + "description": "Number of seconds after the container has started before the probes is initiated", + "default": 0, + "minimum": 0, + "maximum": 60 + }, + "periodSeconds": { + "$id": "#/properties/probe/properties/settings/properties/periodSeconds", + "type": "integer", + "title": "Period", + "description": "How often (in seconds) to perform the probe", + "default": 10, + "minimum": 1, + "maximum": 60 + }, + "successThreshold": { + "$id": "#/properties/probe/properties/settings/properties/successThreshold", + "type": "integer", + "title": "Success Threshold", + "description": "Minimum consecutive successes for the probe to be considered successful after having failed", + "default": 1, + "minimum": 1, + "maximum": 15 + }, + "timeoutSeconds": { + "$id": "#/properties/probe/properties/settings/properties/timeoutSeconds", + "type": "integer", + "title": "Timeout", + "description": "Number of seconds after which the probe times out", + "default": 3, + "minimum": 1, + "maximum": 30 + }, + "failureThreshold": { + "$id": "#/properties/probe/properties/settings/properties/failureThreshold", + "type": "integer", + "title": "Failure Threshold", + "description": "When a probe fails, Kubernetes will tries this many times before giving up. Giving up the pod will be marked Unready and won't get any traffic", + "default": 3, + "minimum": 1, + "maximum": 15 + } + } } } }, diff --git a/charts/onechart/values.yaml b/charts/onechart/values.yaml index bf0a0d1..ddab57c 100644 --- a/charts/onechart/values.yaml +++ b/charts/onechart/values.yaml @@ -34,6 +34,12 @@ affinity: {} probe: enabled: false path: "/" + settings: + initialDelaySeconds: 0 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + failureThreshold: 3 secret: enabled: false