Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document stack #401

Merged
merged 13 commits into from
Dec 13, 2023
2 changes: 1 addition & 1 deletion tembo-operator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tembo-operator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "controller"
description = "Tembo Operator for Postgres"
version = "0.23.0"
version = "0.24.0"
edition = "2021"
default-run = "controller"
license = "Apache-2.0"
Expand Down
3 changes: 3 additions & 0 deletions tembo-operator/src/stacks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ lazy_static! {
serde_yaml::from_str(include_str!("templates/vectordb.yaml")).expect("vectordb.yaml not found");
pub static ref GEOSPATIAL: Stack =
serde_yaml::from_str(include_str!("templates/gis.yaml")).expect("gis.yaml not found");
pub static ref MONGO_ADAPTER: Stack =
serde_yaml::from_str(include_str!("templates/document.yaml")).expect("document.yaml not found");
}

pub fn get_stack(entity: StackType) -> types::Stack {
Expand All @@ -34,5 +36,6 @@ pub fn get_stack(entity: StackType) -> types::Stack {
StackType::OLTP => OLTP.clone(),
StackType::VectorDB => VECTOR_DB.clone(),
StackType::Geospatial => GEOSPATIAL.clone(),
StackType::MongoAdapter => MONGO_ADAPTER.clone(),
}
}
84 changes: 84 additions & 0 deletions tembo-operator/src/stacks/templates/document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: MongoAdapter
description: Document-facing workloads on Postgres.
image: "quay.io/tembo/standard-cnpg:15.3.0-1-1096aeb"
stack_version: 0.1.0
appServices:
- name: fdb-api
image: ghcr.io/ferretdb/ferretdb
routing:
- port: 27018
ingressPath: /ferretdb/v1
entryPoints:
- ferretdb
ingressType: tcp
env:
- name: FERRETDB_POSTGRESQL_URL
valueFromPlatform: ReadWriteConnection
- name: FERRETDB_LOG_LEVEL
value: debug
- name: FERRETDB_STATE_DIR
value: '-'
- name: FERRETDB_LISTEN_TLS_CERT_FILE
value: /certs/tls.crt
- name: FERRETDB_LISTEN_TLS_KEY_FILE
value: /certs/tls.key
- name: FERRETDB_LISTEN_TLS
value: :27018
storage:
volumes:
- name: ferretdb-data
ephemeral:
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- name: ferretdb-certs
EvanHStanton marked this conversation as resolved.
Show resolved Hide resolved
secret:
secretName: sample-mongo-adapter-server1
volumeMounts:
- name: ferretdb-data
mountPath: /state
- name: ferretdb-certs
mountPath: /certs
readOnly: true
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 400m
memory: 256Mi
compute_templates:
- cpu: 1
memory: 4Gi
- cpu: 2
memory: 8Gi
- cpu: 4
memory: 16Gi
- cpu: 8
memory: 32Gi
- cpu: 16
memory: 32Gi
postgres_config_engine: standard
postgres_config:
- name: autovacuum_vacuum_cost_limit
value: -1
- name: autovacuum_vacuum_scale_factor
value: 0.05
- name: autovacuum_vacuum_insert_scale_factor
value: 0.05
- name: autovacuum_analyze_scale_factor
value: 0.05
- name: checkpoint_timeout
value: 10min
- name: track_activity_query_size
value: 2048
- name: wal_compression
value: 'on'
- name: track_io_timing
value: 'on'
- name: log_min_duration_statement # https://www.postgresql.org/docs/15/runtime-config-logging.html
value: 1000
3 changes: 3 additions & 0 deletions tembo-operator/src/stacks/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum StackType {
OLTP,
VectorDB,
Geospatial,
MongoAdapter,
}

impl std::str::FromStr for StackType {
Expand All @@ -36,6 +37,7 @@ impl std::str::FromStr for StackType {
"OLTP" => Ok(StackType::OLTP),
"VectorDB" => Ok(StackType::VectorDB),
"Geospatial" => Ok(StackType::Geospatial),
"MongoAdapter" => Ok(StackType::MongoAdapter),
_ => Err("invalid value"),
}
}
Expand All @@ -52,6 +54,7 @@ impl StackType {
StackType::OLTP => "OLTP",
StackType::VectorDB => "VectorDB",
StackType::Geospatial => "Geospatial",
StackType::MongoAdapter => "MongoAdapter",
}
}
}
Expand Down
Loading