diff --git a/tembo-operator/Cargo.lock b/tembo-operator/Cargo.lock index eb9bef72e..b87c1c996 100644 --- a/tembo-operator/Cargo.lock +++ b/tembo-operator/Cargo.lock @@ -494,7 +494,7 @@ dependencies = [ [[package]] name = "controller" -version = "0.25.2" +version = "0.26.0" dependencies = [ "actix-web", "anyhow", diff --git a/tembo-operator/Cargo.toml b/tembo-operator/Cargo.toml index 1ce18865e..313d9946f 100644 --- a/tembo-operator/Cargo.toml +++ b/tembo-operator/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "controller" description = "Tembo Operator for Postgres" -version = "0.25.2" +version = "0.26.0" edition = "2021" default-run = "controller" license = "Apache-2.0" diff --git a/tembo-operator/src/stacks/mod.rs b/tembo-operator/src/stacks/mod.rs index 3948660d7..59733952e 100644 --- a/tembo-operator/src/stacks/mod.rs +++ b/tembo-operator/src/stacks/mod.rs @@ -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/mongo_adapter.yaml")) + .expect("mongo_adapter.yaml not found"); } pub fn get_stack(entity: StackType) -> types::Stack { @@ -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(), } } diff --git a/tembo-operator/src/stacks/templates/mongo_adapter.yaml b/tembo-operator/src/stacks/templates/mongo_adapter.yaml new file mode 100644 index 000000000..df05d37e4 --- /dev/null +++ b/tembo-operator/src/stacks/templates/mongo_adapter.yaml @@ -0,0 +1,78 @@ +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: /tembo/certs/tls.crt + - name: FERRETDB_LISTEN_TLS_KEY_FILE + value: /tembo/certs/tls.key + - name: FERRETDB_LISTEN_TLS + value: :27018 + storage: + volumes: + - name: ferretdb-data + ephemeral: + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMounts: + - name: ferretdb-data + mountPath: /state + 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 diff --git a/tembo-operator/src/stacks/types.rs b/tembo-operator/src/stacks/types.rs index b034b076b..935d1c097 100644 --- a/tembo-operator/src/stacks/types.rs +++ b/tembo-operator/src/stacks/types.rs @@ -21,6 +21,7 @@ pub enum StackType { OLTP, VectorDB, Geospatial, + MongoAdapter, } impl std::str::FromStr for StackType { @@ -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"), } } @@ -52,6 +54,7 @@ impl StackType { StackType::OLTP => "OLTP", StackType::VectorDB => "VectorDB", StackType::Geospatial => "Geospatial", + StackType::MongoAdapter => "MongoAdapter", } } }