Repository: provectus/kafka-ui
Issue: Add posibility to define scheme as HTTPS in readiness and liveness probes
Labels: type/enhancement
status/accepted
scope/k8s

**Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
If we enable SSL in kafka-ui backend, and deploy into k8s using the helm chart, the deployment creates the livenessProbe and readinessProbe configuration with the default value of HTTP.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#http-probes

In the current Deployment.yaml there is not way to specify the scheme field for probes 

**Set up**
<!--
How do you run the app? Please provide as much info as possible:
1. App version (docker image version or check commit hash in the top left corner in UI)
2. Helm chart version, if you use one
3. Any IAAC configs

We might close the issue without further explanation if you don't provide such information.
-->


**Steps to Reproduce**
Steps to reproduce the behavior:

1. Enable SSL in Kafka-ui. (SERVER_SSL_ENABLED=true, SERVER_SSL_KEY_STORE='myserver.keystore', SERVER_SSL_KEY_STORE_PASSWORD='mypassword'
2. Deploy the application in kubernetes using the helm chart.
3. Kubernetes restart the pods, since there is not valid certificate for that operation.

**Expected behavior**
Make able to configure the deployment telling to kubernetes to skipping the certificate verification.


Issue comments:
PR created https://github.com/provectus/kafka-ui/pull/2924 for that issue.

Pull request review comments:

Patch that resolved the issue:
diff --git a/charts/kafka-ui/Chart.yaml b/charts/kafka-ui/Chart.yaml
index 1ecf0eeecea..2ae296b4ee6 100644
--- a/charts/kafka-ui/Chart.yaml
+++ b/charts/kafka-ui/Chart.yaml
@@ -2,6 +2,6 @@ apiVersion: v2
 name: kafka-ui
 description: A Helm chart for kafka-UI
 type: application
-version: 0.4.5
+version: 0.4.6
 appVersion: v0.4.0
 icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png
diff --git a/charts/kafka-ui/templates/deployment.yaml b/charts/kafka-ui/templates/deployment.yaml
index a253fc6df51..219e9b44061 100644
--- a/charts/kafka-ui/templates/deployment.yaml
+++ b/charts/kafka-ui/templates/deployment.yaml
@@ -87,6 +87,9 @@ spec:
               {{- $contextPath := .Values.envs.config.SERVER_SERVLET_CONTEXT_PATH | default "" | printf "%s/actuator/health" | urlParse }}
               path: {{ get $contextPath "path" }}
               port: http
+              {{- if .Values.probes.useHttpsScheme }}
+              scheme: HTTPS
+              {{- end }}
             initialDelaySeconds: 60
             periodSeconds: 30
             timeoutSeconds: 10
@@ -95,6 +98,9 @@ spec:
               {{- $contextPath := .Values.envs.config.SERVER_SERVLET_CONTEXT_PATH | default "" | printf "%s/actuator/health" | urlParse }}
               path: {{ get $contextPath "path" }}
               port: http
+              {{- if .Values.probes.useHttpsScheme }}
+              scheme: HTTPS
+              {{- end }}
             initialDelaySeconds: 60
             periodSeconds: 30
             timeoutSeconds: 10
diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml
index 35e3ad3dd59..dce32059e14 100644
--- a/charts/kafka-ui/values.yaml
+++ b/charts/kafka-ui/values.yaml
@@ -73,6 +73,11 @@ podLabels: {}
 ##
 annotations: {}
 
+## Set field schema as HTTPS for readines and liveness probe
+##
+probes:
+  useHttpsScheme: false
+
 podSecurityContext:
   {}
   # fsGroup: 2000


Test patch: