Skip to content
This repository was archived by the owner on Feb 24, 2022. It is now read-only.

Commit 2b48271

Browse files
committed
Fixes with readiness-liveness probe
1 parent 0d06d48 commit 2b48271

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ root = true
44
indent_style = space
55

66
[*.java]
7-
indent_size = 4
7+
indent_size = 4
8+
9+
[*.sh]
10+
end_of_line = lf

.kub/mystuff/templates/deployment.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,21 @@ spec:
8282
app.kubernetes.io/name: {{ include "mystuff.name.back" . }}
8383
app.kubernetes.io/instance: {{ .Release.Name }}
8484
spec:
85+
initContainers:
86+
- name: wait-for-db
87+
image: busybox:1.28
88+
command: ['sh', '-c', 'until nslookup {{ include "mystuff.name.neo4j" . }}; do echo waiting for data base; sleep 2; done;']
8589
containers:
8690
- name: {{ .Chart.Name }}
8791
image: "{{ .Values.images.back.repository }}:{{ .Values.images.back.tag }}"
8892
imagePullPolicy: {{ .Values.images.back.pullPolicy }}
8993
env:
9094
- name: spring.data.neo4j.uri
9195
value: http://neo4j:{{ .Values.neo4j.neo4jPassword }}@{{ include "mystuff.name.neo4j" . }}:80
96+
- name: "server.tomcat.accesslog.enabled"
97+
value: "true"
98+
- name: "server.tomcat.accesslog.directory"
99+
value: "/logs"
92100
ports:
93101
- name: back
94102
containerPort: 9000
@@ -97,18 +105,18 @@ spec:
97105
httpGet:
98106
path: /health
99107
port: 9000
100-
initialDelaySeconds: 40
101-
timeoutSeconds: 2
102-
periodSeconds: 3
103-
failureThreshold: 2
108+
initialDelaySeconds: 60
109+
timeoutSeconds: 5
110+
periodSeconds: 5
111+
failureThreshold: 10
104112
livenessProbe:
105113
httpGet:
106114
path: /health
107115
port: 9000
108-
initialDelaySeconds: 100
109-
timeoutSeconds: 2
110-
periodSeconds: 8
111-
failureThreshold: 1
116+
initialDelaySeconds: 60
117+
timeoutSeconds: 5
118+
periodSeconds: 5
119+
failureThreshold: 10
112120
{{- with .Values.nodeSelector }}
113121
nodeSelector:
114122
{{- toYaml . | nindent 8 }}

.kub/mystuff/update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
helm upgrade mystuff .
2+
helm upgrade mystuff .

.kub/mystuff/values.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ replicaCount: 2
77
images:
88
web:
99
repository: webtree/mystuff
10-
tag: latest
11-
pullPolicy: IfNotPresent
10+
tag: web-latest
11+
pullPolicy: Always
1212
back:
1313
repository: webtree/mystuff
14-
tag: latest
15-
pullPolicy: IfNotPresent
14+
tag: back-latest
15+
pullPolicy: Always
1616

1717
nameOverride: ""
1818
fullnameOverride: ""
@@ -54,7 +54,7 @@ ingress:
5454
# memory: 128Mi
5555

5656
nodeSelector:
57-
"node-role.kubernetes.io/type": backend
57+
"node-role.kubernetes.io/backend":
5858

5959
tolerations: []
6060

@@ -68,4 +68,4 @@ neo4j:
6868
enabled: true
6969
size: 1Gi
7070
authEnabled: true
71-
replicaCount: 1
71+
replicaCount: 1

0 commit comments

Comments
 (0)