Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- Add support for connecting to HDFS ([#263]).
- Add support for Hive 3.1.3 ([#243]).
- PVCs for data storage, cpu and memory limits are now configurable ([#270]).
- Add temporary attribute to support using ClusterIP instead of NodePort service type ([#272]).

### Changed

Expand All @@ -31,6 +32,7 @@ All notable changes to this project will be documented in this file.
[#244]: https://github.com/stackabletech/trino-operator/pull/244
[#263]: https://github.com/stackabletech/trino-operator/pull/263
[#270]: https://github.com/stackabletech/trino-operator/pull/270
[#272]: https://github.com/stackabletech/trino-operator/pull/272

## [0.4.0] - 2022-06-30

Expand Down
7 changes: 7 additions & 0 deletions deploy/crd/trinocluster.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ spec:
required:
- configMapName
type: object
serviceType:
description: Specify the type of the created kubernetes service. This attribute will be removed in a future release when listener-operator is finished. Use with caution.
enum:
- NodePort
- ClusterIP
nullable: true
type: string
stopped:
description: "Emergency stop button, if `true` then all pods are stopped without affecting configuration (as setting `replicas` to `0` would)."
nullable: true
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/trino-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,13 @@ spec:
required:
- configMapName
type: object
serviceType:
description: Specify the type of the created kubernetes service. This attribute will be removed in a future release when listener-operator is finished. Use with caution.
enum:
- NodePort
- ClusterIP
nullable: true
type: string
stopped:
description: Emergency stop button, if `true` then all pods are stopped without affecting configuration (as setting `replicas` to `0` would).
nullable: true
Expand Down
7 changes: 7 additions & 0 deletions deploy/manifests/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,13 @@ spec:
required:
- configMapName
type: object
serviceType:
description: Specify the type of the created kubernetes service. This attribute will be removed in a future release when listener-operator is finished. Use with caution.
enum:
- NodePort
- ClusterIP
nullable: true
type: string
stopped:
description: Emergency stop button, if `true` then all pods are stopped without affecting configuration (as setting `replicas` to `0` would).
nullable: true
Expand Down
19 changes: 19 additions & 0 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,25 @@ pub struct TrinoClusterSpec {
/// Settings for the Worker Role/Process.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub workers: Option<Role<TrinoConfig>>,
/// Specify the type of the created kubernetes service.
/// This attribute will be removed in a future release when listener-operator is finished.
/// Use with caution.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service_type: Option<ServiceType>,
}

// TODO: Temporary solution until listener-operator is finished
#[derive(Clone, Debug, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub enum ServiceType {
NodePort,
ClusterIP,
}

impl Default for ServiceType {
fn default() -> Self {
Self::NodePort
}
}

#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
Expand Down
9 changes: 8 additions & 1 deletion rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,14 @@ pub fn build_coordinator_role_service(trino: &TrinoCluster) -> Result<Service> {
spec: Some(ServiceSpec {
ports: Some(service_ports(trino)),
selector: Some(role_selector_labels(trino, APP_NAME, &role_name)),
type_: Some("NodePort".to_string()),
type_: Some(
trino
.spec
.service_type
.clone()
.unwrap_or_default()
.to_string(),
),
..ServiceSpec::default()
}),
status: None,
Expand Down