feat: support distroless images in version probe#195
Conversation
…mpatibility in version probe
a11f66f to
6b52ac6
Compare
|
Hi @GrigoryPervakov , I opened this draft PR to make version probe Jobs compatible with shell-free/distroless ClickHouse images. The initial plan was straightforward: replace the current shell-dependent command: sh -c "<binary> --version > /dev/termination-log 2>&1"with a shell-free ClickHouse-native command: /usr/bin/clickhouse local --query \
"INSERT INTO FUNCTION file('/dev/termination-log', 'RawBLOB', 'version String') SELECT version()"That works for the official distroless server and keeper images I tested, and this is what the draft PR intitially implemented (current version has the 2 path implementation). While ClickHouse/ClickHouse#105677 means the current published distroless images are not fully shell-free yet, this command should continue to work once that image issue is fixed. However, the assumption that standard images have a superset of distroless tooling turned out to be backwards here. This command breaks on standard Based on ClickHouse/ClickHouse#98664, ClickHouse/ClickHouse@739b60df502, and ClickHouse/ClickHouse@a05ed90e43c, this appears intentional. Distroless Keeper includes I also looked for a more universal ClickHouse-native way to write the version directly to Alternatives
For the second option, I see a few possible variants:
My preference is the pod-log option if |
Why
The operator generates probe jobs using below which will fail with distroless images.
sh -c "<binary> --version > /dev/termination-log 2>&1"What
Replace the command with:
Use
/usr/bin/clickhousefor bothClickHouseClusterandKeeperClusterprobes.The server and keeper images use ClickHouse’s multicall binary model, and
clickhouse localis available through the main binary.Use
INSERT INTO FUNCTION file(...)instead ofINTO OUTFILE.Manual Kubernetes validation showed
INTO OUTFILE '/dev/termination-log'fails due to ClickHouse temp-file/rename behavior against the Kubernetes termination log path, whilefile('/dev/termination-log', ...)writes successfully.Related Issues
We are planning to switch to distroless images once ClickHouse/ClickHouse#105677 is fixed.