Skip to content

Commit d7677ca

Browse files
authoredFeb 7, 2018
Merge pull request #18411 from spadgett/console-liveness
Automatic merge from submit-queue. Restart console container when config changes Opening this to get feedback. We have a problem where there is no good way to rollout the console after editing the console config in its config map. Right now we have to tell users to delete the console pods, which is error prone and not friendly. The console only reads config at startup and doesn't watch for changes. This adds a liveness probe that detects if the config has changed on the filesystem using an md5 hash. If the config changes, the liveness probe fails, and the container restarts. It'a similar to what @aweiteka has done for prometheus config changes. It's a bit of a hack, but it works. @sdodson This would simplify the install because we'd no longer need to force a console rollout on config changes from the metrics and logging playbooks. Any objections to this approach? /assign @jwforres /cc @smarterclayton @derekwaynecarr @deads2k /hold Holding for feedback :) @jupierce fyi
2 parents dfd7aa9 + bb6db21 commit d7677ca

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed
 

‎install/origin-web-console/console-template.yaml

+11-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,17 @@ objects:
6767
port: 8443
6868
scheme: HTTPS
6969
livenessProbe:
70-
httpGet:
71-
path: /
72-
port: 8443
73-
scheme: HTTPS
70+
exec:
71+
command:
72+
- /bin/sh
73+
- -i
74+
- -c
75+
- |-
76+
if [[ ! -f /tmp/webconsole-config.hash ]]; then \
77+
md5sum /var/webconsole-config/webconsole-config.yaml > /tmp/webconsole-config.hash; \
78+
elif [[ $(md5sum /var/webconsole-config/webconsole-config.yaml) != $(cat /tmp/webconsole-config.hash) ]]; then \
79+
exit 1; \
80+
fi && curl -k -f https://0.0.0.0:8443/console/
7481
resources:
7582
requests:
7683
cpu: 100m

‎pkg/oc/bootstrap/bindata.go

+11-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/extended/testdata/bindata.go

+11-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.