Added probe schemas

This must be used if gerrit is running with listenUrl = https://...

Change-Id: I1241e664d357bf7eb3d95544f50e4ef58f661620
diff --git a/helm-charts/gerrit-replica/README.md b/helm-charts/gerrit-replica/README.md
index 993f4d9..8b68b43 100644
--- a/helm-charts/gerrit-replica/README.md
+++ b/helm-charts/gerrit-replica/README.md
@@ -406,6 +406,7 @@
 | `gerritReplica.maxSurge` | Max. percentage or number of pods allowed to be scheduled above the desired number | `25%` |
 | `gerritReplica.maxUnavailable` | Max. percentage or number of pods allowed to be unavailable at a time | `100%` |
 | `gerritReplica.livenessProbe` | Configuration of the liveness probe timings | `{initialDelaySeconds: 60, periodSeconds: 5}` |
+| `gerritReplica.probeScheme` | Scheme for probes, for example HTTPS | `nil` |
 | `gerritReplica.readinessProbe` | Configuration of the readiness probe timings | `{initialDelaySeconds: 10, periodSeconds: 10}` |
 | `gerritReplica.startupProbe` | Configuration of the startup probe timings | `{initialDelaySeconds: 10, periodSeconds: 5}` |
 | `gerritReplica.gracefulStopTimeout` | Time in seconds Kubernetes will wait until killing the pod during termination (has to be longer then Gerrit's httpd.gracefulStopTimeout to allow graceful shutdown of Gerrit) | `90` |
diff --git a/helm-charts/gerrit-replica/templates/gerrit-replica.stateful-set.yaml b/helm-charts/gerrit-replica/templates/gerrit-replica.stateful-set.yaml
index d4d74a9..8493c7a 100644
--- a/helm-charts/gerrit-replica/templates/gerrit-replica.stateful-set.yaml
+++ b/helm-charts/gerrit-replica/templates/gerrit-replica.stateful-set.yaml
@@ -189,16 +189,25 @@
           httpGet:
             path: /config/server/healthcheck~status
             port: http
+{{- if .Values.gerritReplica.probeScheme }}
+            scheme: {{ .Values.gerritReplica.probeScheme }}
+{{- end }}
 {{ toYaml .Values.gerritReplica.livenessProbe | indent 10 }}
         readinessProbe:
           httpGet:
             path: /config/server/healthcheck~status
             port: http
+{{- if .Values.gerritReplica.probeScheme }}
+            scheme: {{ .Values.gerritReplica.probeScheme }}
+{{- end }}
 {{ toYaml .Values.gerritReplica.readinessProbe | indent 10 }}
         startupProbe:
           httpGet:
             path: /config/server/healthcheck~status
             port: http
+{{- if .Values.gerritReplica.probeScheme }}
+            scheme: {{ .Values.gerritReplica.probeScheme }}
+{{- end }}
 {{ toYaml .Values.gerritReplica.startupProbe | indent 10 }}
         resources:
 {{ toYaml .Values.gerritReplica.resources | indent 10 }}
diff --git a/helm-charts/gerrit-replica/values.yaml b/helm-charts/gerrit-replica/values.yaml
index 3f318f8..e855c89 100644
--- a/helm-charts/gerrit-replica/values.yaml
+++ b/helm-charts/gerrit-replica/values.yaml
@@ -286,6 +286,9 @@
   additionalAnnotations: {}
   additionalPodLabels: {}
 
+  # If no value for probeScheme, the probe will use the default HTTP
+  probeScheme: HTTP
+
   livenessProbe:
     initialDelaySeconds: 60
     periodSeconds: 5
diff --git a/helm-charts/gerrit/README.md b/helm-charts/gerrit/README.md
index 110383a..8300e0a 100644
--- a/helm-charts/gerrit/README.md
+++ b/helm-charts/gerrit/README.md
@@ -310,6 +310,7 @@
 |                    |                                                               | `limits.memory: 6Gi` |
 | `gerrit.persistence.enabled` | Whether to persist the Gerrit site | `true` |
 | `gerrit.persistence.size` | Storage size for persisted Gerrit site | `10Gi` |
+| `gerrit.probeScheme` | Scheme for probes, for example HTTPS | `nil` |
 | `gerrit.livenessProbe` | Configuration of the liveness probe timings | `{initialDelaySeconds: 30, periodSeconds: 5}` |
 | `gerrit.readinessProbe` | Configuration of the readiness probe timings | `{initialDelaySeconds: 5, periodSeconds: 1}` |
 | `gerrit.startupProbe` | Configuration of the startup probe timings | `{initialDelaySeconds: 10, periodSeconds: 5}` |
diff --git a/helm-charts/gerrit/templates/gerrit.stateful-set.yaml b/helm-charts/gerrit/templates/gerrit.stateful-set.yaml
index a02b69e..2669325 100644
--- a/helm-charts/gerrit/templates/gerrit.stateful-set.yaml
+++ b/helm-charts/gerrit/templates/gerrit.stateful-set.yaml
@@ -199,16 +199,25 @@
           httpGet:
             path: /config/server/healthcheck~status
             port: gerrit-port
+{{- if .Values.gerrit.probeScheme }}
+            scheme: {{ .Values.gerrit.probeScheme }}
+{{- end }}
 {{ toYaml .Values.gerrit.livenessProbe | indent 10 }}
         readinessProbe:
           httpGet:
             path: /config/server/healthcheck~status
             port: gerrit-port
+{{- if .Values.gerrit.probeScheme }}
+            scheme: {{ .Values.gerrit.probeScheme }}
+{{- end }}
 {{ toYaml .Values.gerrit.readinessProbe | indent 10 }}
         startupProbe:
           httpGet:
             path: /config/server/healthcheck~status
             port: gerrit-port
+{{- if .Values.gerrit.probeScheme }}
+            scheme: {{ .Values.gerrit.probeScheme }}
+{{- end }}
 {{ toYaml .Values.gerrit.startupProbe | indent 10 }}
       volumes:
       {{ if not .Values.gerrit.persistence.enabled -}}
diff --git a/helm-charts/gerrit/values.yaml b/helm-charts/gerrit/values.yaml
index 1135aa9..febb9ad 100644
--- a/helm-charts/gerrit/values.yaml
+++ b/helm-charts/gerrit/values.yaml
@@ -177,6 +177,9 @@
     enabled: true
     size: 10Gi
 
+  # If no value for probeScheme, the probe will use the default HTTP
+  probeScheme: HTTP
+
   livenessProbe:
     initialDelaySeconds: 30
     periodSeconds: 5