Skip to content

Commit 200c507

Browse files
authored
Merge pull request #13 from HomeDevopsLab/7-livenessprobe-configuration-causing-restarts
7 livenessprobe configuration causing restarts
2 parents e8e033b + 2858817 commit 200c507

File tree

6 files changed

+32
-18
lines changed

6 files changed

+32
-18
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [2.6.0] - 2024-10-19
4+
5+
### Changed
6+
7+
- Startup and Liveness probes are moved to HelmRelease file
8+
- initWebsiteDir hook: create website dir when it does not exist
9+
310
## [2.5.0] - 2024-09-01
411

512
### Added

chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 2.5.0
18+
version: 2.6.0
1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application. Versions are not expected to
2121
# follow Semantic Versioning. They should reflect the version the application is using.

chart/templates/deployment.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,17 @@ spec:
6161
containerPort: {{.targetPort }}
6262
protocol: TCP
6363
{{- end }}
64-
{{- if .Values.startupProbes.enabled }}
64+
{{- if .Values.startupProbe }}
6565
startupProbe:
66-
httpGet:
67-
path: /
68-
port: {{ .Values.startupProbes.port | default 80 }}
69-
failureThreshold: 30
70-
periodSeconds: 10
66+
{{- with .Values.startupProbe }}
67+
{{- toYaml . | nindent 13 }}
68+
{{- end }}
7169
{{- end }}
7270
{{- if .Values.livenessProbe }}
7371
livenessProbe:
74-
tcpSocket:
75-
port: {{ .Values.livenessProbe.port }}
76-
initialDelaySeconds: 10
77-
periodSeconds: 2
72+
{{- with .Values.livenessProbe }}
73+
{{- toYaml . | nindent 13 }}
74+
{{- end }}
7875
{{- end }}
7976
{{- if .Values.livenessProbe }}
8077
tolerations:
@@ -117,4 +114,4 @@ spec:
117114
persistentVolumeClaim:
118115
claimName: {{ .Release.Name }}-pvc
119116
{{- end }}
120-
{{- end }}
117+
{{- end }}

chart/templates/initWebsiteDir.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ spec:
4848
args:
4949
- -c
5050
- >-
51-
mkdir -p $(WEBSITE_DIRS); chown -R $(OWNERSHIP) $(WEBSITE_DIRS);
51+
if [! -d $(WEBSITE_DIRS) ]; then
52+
mkdir -p $(WEBSITE_DIRS);
53+
chown -R $(OWNERSHIP) $(WEBSITE_DIRS);
54+
fi
5255
nodeSelector:
5356
{{- with .Values.nodeSelector }}
5457
{{- toYaml . | nindent 8 }}
@@ -59,4 +62,4 @@ spec:
5962
server: {{ .Values.volumes.type.nfs.server }}
6063
path: {{ .Values.volumes.type.nfs.path }}
6164
{{- end }}
62-
{{- end }}
65+
{{- end }}

chart/test_values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,14 @@ ingress:
5151
servicePort: 80
5252
- name: registry.lab.angrybits.pl
5353
servicePort: 5050
54+
startupProbe:
55+
httpGet:
56+
path: /
57+
port: 666
58+
failureThreshold: 30
59+
periodSeconds: 10
60+
livenessProbe:
61+
tcpSocket:
62+
port: 666
63+
initialDelaySeconds: 10
64+
periodSeconds: 2

chart/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ ingress:
2525
tls: {}
2626
volumes:
2727
enabled: false
28-
rootDir: ""
2928
mountPath: []
3029
ownership: ""
3130
type:
3231
nfs:
3332
server: lab-storage.lan
3433
path: /volume1/storagelab
35-
startupProbes:
36-
enabled: true
3734
deployNotifications:
3835
enabled: false
3936
image: ""
4037
nodeSelector: {}
41-
livenessProbe: {}

0 commit comments

Comments
 (0)