Skip to content

Commit a0a43e1

Browse files
authored
make some changes for best practices (#843)
* add terminationMessagePolicy, set to FallbackToLogsOnError * probes
1 parent b5a3fe1 commit a0a43e1

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

manifests/kiali-ossm/manifests/kiali.clusterserviceversion.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,25 @@ spec:
260260
- "--zap-log-level=info"
261261
- "--leader-election-id=kiali-operator"
262262
- "--watches-file=./$(WATCHES_FILE)"
263+
- "--health-probe-bind-address=:6789"
264+
terminationMessagePolicy: FallbackToLogsOnError
265+
readinessProbe:
266+
httpGet:
267+
path: /readyz
268+
port: 6789
269+
periodSeconds: 30
270+
livenessProbe:
271+
httpGet:
272+
path: /healthz
273+
port: 6789
274+
periodSeconds: 30
275+
startupProbe:
276+
httpGet:
277+
path: /healthz
278+
port: 6789
279+
initialDelaySeconds: 30
280+
periodSeconds: 10
281+
failureThreshold: 6
263282
securityContext:
264283
allowPrivilegeEscalation: false
265284
privileged: false

manifests/kiali-upstream/2.2.0/manifests/kiali.v2.2.0.clusterserviceversion.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,25 @@ spec:
201201
- "--zap-log-level=info"
202202
- "--leader-election-id=kiali-operator"
203203
- "--watches-file=./$(WATCHES_FILE)"
204+
- "--health-probe-bind-address=:6789"
205+
terminationMessagePolicy: FallbackToLogsOnError
206+
readinessProbe:
207+
httpGet:
208+
path: /readyz
209+
port: 6789
210+
periodSeconds: 30
211+
livenessProbe:
212+
httpGet:
213+
path: /healthz
214+
port: 6789
215+
periodSeconds: 30
216+
startupProbe:
217+
httpGet:
218+
path: /healthz
219+
port: 6789
220+
initialDelaySeconds: 30
221+
periodSeconds: 10
222+
failureThreshold: 6
204223
securityContext:
205224
allowPrivilegeEscalation: false
206225
privileged: false

roles/default/kiali-deploy/templates/kubernetes/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
- "/opt/kiali/kiali"
6767
- "-config"
6868
- "/kiali-configuration/config.yaml"
69+
terminationMessagePolicy: FallbackToLogsOnError
6970
securityContext:
7071
{% if kiali_vars.deployment.security_context|length > 0 %}
7172
{{ kiali_vars.deployment.security_context | to_nice_yaml(indent=0) | trim | indent(10) }}
@@ -100,6 +101,14 @@ spec:
100101
scheme: {{ 'HTTP' if kiali_vars.identity.cert_file == "" else 'HTTPS' }}
101102
initialDelaySeconds: 5
102103
periodSeconds: 30
104+
startupProbe:
105+
httpGet:
106+
path: {{ kiali_vars.server.web_root | regex_replace('\\/$', '') }}/healthz
107+
port: api-port
108+
scheme: {{ 'HTTP' if kiali_vars.identity.cert_file == "" else 'HTTPS' }}
109+
initialDelaySeconds: 30
110+
periodSeconds: 10
111+
failureThreshold: 6
103112
env:
104113
- name: ACTIVE_NAMESPACE
105114
valueFrom:

roles/default/kiali-deploy/templates/openshift/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
- "/opt/kiali/kiali"
6767
- "-config"
6868
- "/kiali-configuration/config.yaml"
69+
terminationMessagePolicy: FallbackToLogsOnError
6970
securityContext:
7071
{% if kiali_vars.deployment.security_context|length > 0 %}
7172
{{ kiali_vars.deployment.security_context | to_nice_yaml(indent=0) | trim | indent(10) }}
@@ -100,6 +101,14 @@ spec:
100101
scheme: {{ 'HTTP' if kiali_vars.identity.cert_file == "" else 'HTTPS' }}
101102
initialDelaySeconds: 5
102103
periodSeconds: 30
104+
startupProbe:
105+
httpGet:
106+
path: {{ kiali_vars.server.web_root | regex_replace('\\/$', '') }}/healthz
107+
port: api-port
108+
scheme: {{ 'HTTP' if kiali_vars.identity.cert_file == "" else 'HTTPS' }}
109+
initialDelaySeconds: 30
110+
periodSeconds: 10
111+
failureThreshold: 6
103112
env:
104113
- name: ACTIVE_NAMESPACE
105114
valueFrom:

0 commit comments

Comments
 (0)