Direct reads from the object store
Let a Bastion read large files from the object store itself, sparing the main installation's bandwidth, and know what that hands it.
On this page
With Direct reads from the object store on, the main installation answers the Bastion's request for a large file with a short-lived link into the object store instead of the bytes. It still decides whether the caller may read, applies the malware, signature and download-limit checks, and counts the download. The Bastion checks every byte against the file's digest; when a direct read fails, it fetches the file through the main installation, so a client sees at most a delay.
When it helps
Large files, above all image layers. In a measurement a file of 300 MiB read cold through a Bastion cost the main installation none of
its bytes with direct reads, and all of them without. A file below the Minimum size of the
download links, and one the Bastion holds already, always comes through the main installation.
The offer is also bounded by bastion.cache.max_object_bytes and the free room of bastion.cache.spool_max_bytes
(configuration).
What it needs
For every connection of the object store that holds files the Bastion reads:
| Need | Why |
|---|---|
| A public address on a host name of its own, set under Details of the storage settings | The Bastion refuses a link to the main installation's host names or its own, whatever the port |
https, with a certificate the Bastion trusts (system roots or the chart's trustedCA) |
The same bundle vouches for the main installation and the store |
| The Bastion's network reaches that address | A policy of your own on its outgoing traffic must admit it |
Test link under the connection's address gives a link to a small file, valid for 60 seconds, with a curl command. Run it in a pod
of the Bastion's namespace: it reads Quader download link test: this link works.
Switch it on
- Who
endpoints:write;endpoints:readsees On or Off- Where
- main installation, Admin area › Bastions, on the card under the rows of the web interface
A new registration has it off. The Bastion learns a change within seconds, at the latest at its next handshake. While it is on, a line under the row names each connection whose files still come through the main installation, with the reason and a link to the storage settings. A switch-off survives a restore to an earlier point.
Encrypted connections
For a file only on a connection with encrypted: true, the main installation hands the Bastion that one file's key with the link. The
Bastion decrypts and checks as it reads and keeps the key for that read only. Before a key leaves, the main installation records it in
the audit log; if it cannot, the file comes through the main installation. While a connection is encrypted the row says so before you
switch it on.
What you take on
Switching on hands a Bastion in your DMZ a link per file, and for an encrypted connection that file's key:
- A link is a bearer until it expires (Link valid for, 60 seconds by default), also after the caller's token is revoked.
- A link shows the store's public address, bucket and object name; the Bastion holds no credential of the store.
- The store's request log shows the Bastion's address and the objects it reads.
- A direct read that fails before its first byte is fetched through the main installation and charged to the caller's limits a second time. After such a failure a replica pauses its direct reads for a minute.
- A key opens that file's encrypted copy wherever it lies, in the bucket, its older versions and backups, for as long as it lies there. Neither a new key ring nor deleting the file changes it.
When a Bastion is taken over, switch its direct reads off and revoke its token. Its links stop when they expire, its keys never: where its holder may read the bucket or a backup, replace the connection by a new one and remove the old (Object-store connections).
Which keys a Bastion received
Every handed key is the audit event bastion.data_key.handed, recorded whether or not downloads are audited. In Admin area › System ›
Audit log filter Action by it, and Resource kind bastion with the registration's ID for one Bastion. Each event names the
caller, the file, the replica and the storage key, never the key itself. The dry run of quader admin storage keys destroy counts the
files whose key a Bastion received (Backup and restore).
See that it works
| Where | Series | What it says |
|---|---|---|
| Bastion | quader_bastion_handover_enabled |
1 once the handshake says direct reads are on |
| Bastion | quader_bastion_handovers_total{outcome} |
read, fallback (before the first byte), continued (finished through the main installation), refused (wrong bytes) |
| Bastion | quader_bastion_handover_cooldown |
1 while the replica pauses |
| Bastion | quader_outbound_requests_total{kind="bastion_handover", code} |
The store's answers, error for an unreachable network |
| Main installation | quader_storage_download_handovers_total{bastion, kind} |
Files handed, link or link_and_key |
| Main installation | quader_storage_download_handovers_declined_total{reason} |
Offers answered with the bytes: size, connection, key, trace, switch_off |
Each fallback is a line a handover is replaced by the forward without the offer in the Bastion's log, with its reason.
QuaderBastionHandoverFailing fires when direct reads failed for 15 minutes and none succeeded.