Skip to content

Commit 32dfb3a

Browse files
committed
update crd fields to match decision
1 parent 7854f9a commit 32dfb3a

4 files changed

Lines changed: 175 additions & 40 deletions

File tree

deploy/helm/trino-operator/crds/crds.yaml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,173 @@ spec:
105105
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
106106
type: object
107107
type: object
108+
clientSpoolingProtocol:
109+
description: Client spooling protocol configuration.
110+
nullable: true
111+
oneOf:
112+
- required:
113+
- s3
114+
properties:
115+
configOverrides:
116+
additionalProperties:
117+
type: string
118+
default: {}
119+
description: The `configOverrides` allow overriding arbitrary client protocol properties.
120+
type: object
121+
enabled:
122+
description: Enable spooling protocol.
123+
type: boolean
124+
location:
125+
type: string
126+
s3:
127+
properties:
128+
connection:
129+
description: S3 connection configuration. Learn more about S3 configuration in the [S3 concept docs](https://docs.stackable.tech/home/nightly/concepts/s3).
130+
oneOf:
131+
- required:
132+
- inline
133+
- required:
134+
- reference
135+
properties:
136+
inline:
137+
description: S3 connection definition as a resource. Learn more on the [S3 concept documentation](https://docs.stackable.tech/home/nightly/concepts/s3).
138+
properties:
139+
accessStyle:
140+
default: VirtualHosted
141+
description: Which access style to use. Defaults to virtual hosted-style as most of the data products out there. Have a look at the [AWS documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html).
142+
enum:
143+
- Path
144+
- VirtualHosted
145+
type: string
146+
credentials:
147+
description: If the S3 uses authentication you have to specify you S3 credentials. In the most cases a [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) providing `accessKey` and `secretKey` is sufficient.
148+
nullable: true
149+
properties:
150+
scope:
151+
description: '[Scope](https://docs.stackable.tech/home/nightly/secret-operator/scope) of the [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass).'
152+
nullable: true
153+
properties:
154+
listenerVolumes:
155+
default: []
156+
description: The listener volume scope allows Node and Service scopes to be inferred from the applicable listeners. This must correspond to Volume names in the Pod that mount Listeners.
157+
items:
158+
type: string
159+
type: array
160+
node:
161+
default: false
162+
description: The node scope is resolved to the name of the Kubernetes Node object that the Pod is running on. This will typically be the DNS name of the node.
163+
type: boolean
164+
pod:
165+
default: false
166+
description: The pod scope is resolved to the name of the Kubernetes Pod. This allows the secret to differentiate between StatefulSet replicas.
167+
type: boolean
168+
services:
169+
default: []
170+
description: The service scope allows Pod objects to specify custom scopes. This should typically correspond to Service objects that the Pod participates in.
171+
items:
172+
type: string
173+
type: array
174+
type: object
175+
secretClass:
176+
description: '[SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) containing the LDAP bind credentials.'
177+
type: string
178+
required:
179+
- secretClass
180+
type: object
181+
host:
182+
description: 'Host of the S3 server without any protocol or port. For example: `west1.my-cloud.com`.'
183+
type: string
184+
port:
185+
description: Port the S3 server listens on. If not specified the product will determine the port to use.
186+
format: uint16
187+
minimum: 0.0
188+
nullable: true
189+
type: integer
190+
region:
191+
default:
192+
name: us-east-1
193+
description: |-
194+
Bucket region used for signing headers (sigv4).
195+
196+
This defaults to `us-east-1` which is compatible with other implementations such as Minio.
197+
198+
WARNING: Some products use the Hadoop S3 implementation which falls back to us-east-2.
199+
properties:
200+
name:
201+
default: us-east-1
202+
type: string
203+
type: object
204+
tls:
205+
description: Use a TLS connection. If not specified no TLS will be used.
206+
nullable: true
207+
properties:
208+
verification:
209+
description: The verification method used to verify the certificates of the server and/or the client.
210+
oneOf:
211+
- required:
212+
- none
213+
- required:
214+
- server
215+
properties:
216+
none:
217+
description: Use TLS but don't verify certificates.
218+
type: object
219+
server:
220+
description: Use TLS and a CA certificate to verify the server.
221+
properties:
222+
caCert:
223+
description: CA cert to verify the server.
224+
oneOf:
225+
- required:
226+
- webPki
227+
- required:
228+
- secretClass
229+
properties:
230+
secretClass:
231+
description: Name of the [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) which will provide the CA certificate. Note that a SecretClass does not need to have a key but can also work with just a CA certificate, so if you got provided with a CA cert but don't have access to the key you can still use this method.
232+
type: string
233+
webPki:
234+
description: Use TLS and the CA certificates trusted by the common web browsers to verify the server. This can be useful when you e.g. use public AWS S3 or other public available services.
235+
type: object
236+
type: object
237+
required:
238+
- caCert
239+
type: object
240+
type: object
241+
required:
242+
- verification
243+
type: object
244+
required:
245+
- host
246+
type: object
247+
reference:
248+
type: string
249+
type: object
250+
externalId:
251+
description: External ID for the IAM role trust policy.
252+
nullable: true
253+
type: string
254+
iamRole:
255+
description: IAM role to assume for S3 access.
256+
nullable: true
257+
type: string
258+
maxErrorRetries:
259+
description: Maximum number of times the S3 client should retry a request.
260+
format: uint32
261+
minimum: 0.0
262+
nullable: true
263+
type: integer
264+
uploadPartSize:
265+
description: Part data size for S3 multi-part upload.
266+
nullable: true
267+
type: string
268+
required:
269+
- connection
270+
type: object
271+
required:
272+
- enabled
273+
- location
274+
type: object
108275
faultTolerantExecution:
109276
description: Fault tolerant execution configuration. When enabled, Trino can automatically retry queries or tasks in case of failures.
110277
nullable: true

rust/operator-binary/src/controller.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,11 @@ pub async fn reconcile_trino(
464464
};
465465

466466
// Resolve client spooling protocol configuration with S3 connections if needed
467-
let resolved_spooling_config = match trino.spec.cluster_config.client_protocol.as_ref() {
467+
let resolved_spooling_config = match trino.spec.cluster_config.client_spooling_protocol.as_ref()
468+
{
468469
Some(client_protocol_config) => Some(
469470
client_protocol::ResolvedSpoolingProtocolConfig::from_config(
470-
&client_protocol_config.spooling,
471+
client_protocol_config,
471472
Some(client),
472473
&namespace,
473474
)

rust/operator-binary/src/crd/client_protocol.rs

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use stackable_operator::{
1313
apimachinery::pkg::api::resource::Quantity,
1414
},
1515
schemars::{self, JsonSchema},
16-
shared::time::Duration,
1716
};
1817
use strum::Display;
1918

@@ -24,47 +23,14 @@ const SPOOLING_S3_AWS_SECRET_KEY: &str = "SPOOLING_S3_AWS_SECRET_KEY";
2423

2524
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
2625
#[serde(rename_all = "camelCase")]
27-
pub struct ClientProtocolConfig {
28-
#[serde(flatten)]
29-
pub spooling: SpoolingProtocolConfig,
30-
}
31-
32-
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
33-
#[serde(rename_all = "camelCase")]
34-
pub struct SpoolingProtocolConfig {
35-
// Spooling protocol properties
26+
pub struct ClientSpoolingProtocolConfig {
3627
/// Enable spooling protocol.
3728
pub enabled: bool,
3829

39-
// Name of the Kubernetes Secret with one entry ("key")
40-
// to use as protocol.spooling.shared-secret-key property
41-
pub shared_secret: String,
42-
43-
// Segment retrieval mode used by clients.
44-
#[serde(skip_serializing_if = "Option::is_none")]
45-
pub retrieval_mode: Option<SpoolingRetrievalMode>,
46-
47-
// Spooled segment size. Is translated to both initial and max segment size.
48-
// Use overrides for set those explicitly to distinct values.
49-
#[serde(skip_serializing_if = "Option::is_none")]
50-
pub segment_size: Option<Quantity>,
51-
52-
// Spooling filesystem properties
53-
5430
// Spool segment location. Each Trino cluster must have its own
5531
// location independent of any other clusters.
5632
pub location: String,
5733

58-
// Spool segment TTL. Is translated to both fs.segment.ttl as well as
59-
// fs.segment.direct.ttl.
60-
// Use overrides for set those explicitly to distinct values.
61-
#[serde(skip_serializing_if = "Option::is_none")]
62-
pub segment_ttl: Option<Duration>,
63-
64-
// Spool segment encryption.
65-
#[serde(skip_serializing_if = "Option::is_none")]
66-
pub segment_encryption: Option<bool>,
67-
6834
// Spooling filesystem properties. Only S3 is supported.
6935
#[serde(flatten)]
7036
pub filesystem: SpoolingFileSystemConfig,
@@ -84,6 +50,7 @@ pub enum SpoolingRetrievalMode {
8450
}
8551

8652
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
53+
#[serde(rename_all = "camelCase")]
8754
pub enum SpoolingFileSystemConfig {
8855
S3(S3SpoolingConfig),
8956
}
@@ -140,7 +107,7 @@ impl ResolvedSpoolingProtocolConfig {
140107
/// Resolve S3 connection properties from Kubernetes resources
141108
/// and prepare spooling filesystem configuration.
142109
pub async fn from_config(
143-
config: &SpoolingProtocolConfig,
110+
config: &ClientSpoolingProtocolConfig,
144111
client: Option<&Client>,
145112
namespace: &str,
146113
) -> Result<Self, Error> {
@@ -249,7 +216,7 @@ impl ResolvedSpoolingProtocolConfig {
249216
}
250217

251218
pub(crate) fn is_enabled(&self) -> bool {
252-
return self.enabled;
219+
self.enabled
253220
}
254221
}
255222

rust/operator-binary/src/crd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ pub mod versioned {
304304

305305
/// Client spooling protocol configuration.
306306
#[serde(skip_serializing_if = "Option::is_none")]
307-
pub client_protocol: Option<client_protocol::ClientProtocolConfig>,
307+
pub client_spooling_protocol: Option<client_protocol::ClientSpoolingProtocolConfig>,
308308

309309
/// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery).
310310
/// It must contain the key `ADDRESS` with the address of the Vector aggregator.

0 commit comments

Comments
 (0)