1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-11 16:32:59 +00:00

Use goss for healthchecks (#223)

* basic healthcheck based on goss
* add goss to travis
* healtcheck command runs now for all services
* add to makefile
This commit is contained in:
Felix Bartels
2019-08-27 14:56:49 +02:00
committed by GitHub
parent d6744b20e2
commit 4878fc9917
28 changed files with 156 additions and 17 deletions
+3 -2
View File
@@ -59,7 +59,8 @@ ENV LANG=en_US.UTF-8
ENV SERVICE_TO_START=server
COPY defaultconfigs/ start-service.sh /kopano/
COPY defaultconfigs/ start-service.sh healthcheck.sh /kopano/
COPY goss/ /kopano/goss
WORKDIR /kopano/path
@@ -67,5 +68,5 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD [ "/kopano/start-service.sh" ]
HEALTHCHECK --interval=5m --timeout=60s \
HEALTHCHECK --interval=1m --timeout=10s \
CMD /kopano/healthcheck.sh
+6
View File
@@ -0,0 +1,6 @@
port:
tcp6:2003:
listening: true
process:
kopano-dagent:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-gateway:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-gateway:
running: true
+7
View File
@@ -0,0 +1,7 @@
file:
/var/run/kopano/grapi:
exists: true
mode: "0755"
owner: kapi
group: kopano
filetype: directory
+7
View File
@@ -0,0 +1,7 @@
file:
/var/run/kopano/grapi:
exists: true
mode: "0755"
owner: kapi
group: kopano
filetype: directory
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-ical:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-ical:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kapid:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kapid:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-monitor:
running: true
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-monitor:
running: true
+9
View File
@@ -0,0 +1,9 @@
file:
/var/run/kopano/search.sock:
exists: true
mode: "0700"
size: 0
owner: kopano
group: kopano
filetype: socket
contains: []
+9
View File
@@ -0,0 +1,9 @@
file:
/var/run/kopano/search.sock:
exists: true
mode: "0700"
size: 0
owner: kopano
group: kopano
filetype: socket
contains: []
+33
View File
@@ -0,0 +1,33 @@
file:
/kopano/data/attachments/0:
exists: true
mode: "0750"
owner: kopano
group: kopano
filetype: directory
/run/kopano/prio.sock:
exists: true
mode: "0660"
owner: kopano
group: kopano
filetype: socket
/run/kopano/server.pid:
exists: true
mode: "0644"
owner: kopano
group: kopano
filetype: file
/run/kopano/server.sock:
exists: true
mode: "0666"
owner: kopano
group: kopano
filetype: socket
http:
http://localhost:236:
status: 405
timeout: 5000
https://localhost:237:
status: 405
allow-insecure: true
timeout: 5000
+11
View File
@@ -0,0 +1,11 @@
port:
tcp6:236:
listening: true
file:
/run/kopano/server.pid:
exists: true
mode: "0644"
owner: kopano
group: kopano
filetype: file
+3
View File
@@ -0,0 +1,3 @@
process:
kopano-spooler:
running: true
-3
View File
@@ -1,3 +0,0 @@
port:
tcp6:236:
listening: true
-3
View File
@@ -1,3 +0,0 @@
port:
tcp6:236:
listening: true
Regular → Executable
+10 -1
View File
@@ -1,5 +1,14 @@
#!/bin/bash
set -ex
set -e
case "$SERVICE_TO_START" in
server|dagent|gateway|ical|grapi|kapi|monitor|search|spooler)
goss -g /kopano/goss/"$SERVICE_TO_START"/goss.yaml validate --format json_oneline
;;
*)
echo "This service still needs a proper check"
;;
esac
exit 0
+2 -1
View File
@@ -10,6 +10,7 @@ if [ ! -e /kopano/"$SERVICE_TO_START".py ]; then
exit 1
fi
# TODO this needs fixing as now apt update is always salled (since the value is at least "")
[ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && apt update
[ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"'); do
# shellcheck disable=SC2016 disable=SC2086
@@ -86,7 +87,7 @@ grapi)
unset "${!KCCONF_@}"
exec kopano-grapi serve
;;
kapid)
kapi)
if [ "$KCCONF_KAPID_INSECURE" = "yes" ]; then
dockerize \
-skip-tls-verify \