pub struct CoreDBSpec {
Show 25 fields pub replicas: i32, pub resources: ResourceRequirements, pub storage: Quantity, pub sharedirStorage: Quantity, pub pkglibdirStorage: Quantity, pub postgresExporterEnabled: bool, pub image: String, pub postgresExporterImage: String, pub port: i32, pub uid: i32, pub extensions: Vec<Extension>, pub trunk_installs: Vec<TrunkInstall>, pub stop: bool, pub serviceAccountTemplate: ServiceAccountTemplate, pub backup: Backup, pub metrics: Option<PostgresMetrics>, pub extra_domains_rw: Option<Vec<String>>, pub ip_allow_list: Option<Vec<String>>, pub stack: Option<Stack>, pub runtime_config: Option<Vec<PgConfig>>, pub override_configs: Option<Vec<PgConfig>>, pub connectionPooler: ConnectionPooler, pub app_services: Option<Vec<AppService>>, pub restore: Option<Restore>, pub storage_class: Option<String>,
}
Expand description

Generate the Kubernetes wrapper struct CoreDB from our Spec and Status struct

This provides a hook for generating the CRD yaml (in crdgen.rs) CoreDBSpec represents the specification for a CoreDB instance. It defines various configuration options for deploying and managing the database. with the tembo-controller

§Basic CoreDB Configuration

apiVersion: coredb.io/v1alpha1
kind: CoreDB
metadata:
  name: test-db
spec: {}

Fields§

§replicas: i32

Number of CoreDB replicas to deploy.

Default: 1.

§resources: ResourceRequirements

The resource requirements (CPU/Memory) for the CoreDB instance. This is the same format as what is set for a Kubernetes Pod. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

Limits Default: 2 CPU and 2Gi memory.

Requests Default: 500m CPU and 512Mi memory.

§storage: Quantity§sharedirStorage: Quantity

DEPRECATED The storage size for the sharedir volume. This is no longer used and will be removed in a future release.

§pkglibdirStorage: Quantity

DEPRECATED The storage size for the pkglibdir volume. This is no longer used and will be removed in a future release.

§postgresExporterEnabled: bool

DEPRECATED Enable the use of the Postgres Exporter deployment for metrics collection This is no longer used and will be removed in a future release.

§image: String

The Postgres image to use for the CoreDB instance deployment. This should be a valid Postgres image that is compatible with the https://tembo.io platform. For more information please visit our tembo-images repository.

Default: quay.io/tembo/standard-cnpg:15.3.0-1-0c19c7e

§postgresExporterImage: String

DEPRECATED The postgres-exporter image you want to use for the postgres-exporter deployment. This is no longer used and will be removed in a future release.

§port: i32

The port to expose the Postgres service on.

Default: 5432.

§uid: i32

DEPRECATED The UID to run the Postgres container as. This is no longer used and will be removed in a future release.

We currently run the Postgres container with UID 26.

§extensions: Vec<Extension>

A list of extensions to enable on the CoreDB instance. This list should be a lits of extension names that are already available on the Postgres instance you are running. To install extensions at runtime please see the trunk_installs field.

Default: []

§trunk_installs: Vec<TrunkInstall>

A list of extensions to install from the pgtrunk registry. This list should be a list of extension names and versions that you wish to install at runtime using the pgtrunk API.

Default: []

§stop: bool

This option allows you to stop the database instance.

Default: false.

§serviceAccountTemplate: ServiceAccountTemplate

The serviceAccountTemplate contains the template needed to generate the service accounts to be used by the underlying Postgres instance

For more information on service accounts please see the Kubernetes documentation and the cloudnative-pg docs on ServiceAccountTemplates

Default: ServiceAccountTemplate { metadata: None }

§backup: Backup

The backup configuration for the CoreDB instance to facilitate database backups and WAL archive uploads to an S3 compatible object store.

Default: disabled

§metrics: Option<PostgresMetrics>

The metrics configuration to allow for custom Postgres metrics to be exposed in postgres-exporter and Prometheus.

Default: disabled

§extra_domains_rw: Option<Vec<String>>

The list of domains to add to the IngressRouteTCP generated in the tembo-controller to route traffic to the Postgres instance using SNI based routing of encrypted TLS traffic into the correct instance.

Default: disabled

§ip_allow_list: Option<Vec<String>>

List of IPv4 CIDR blocks to allow access to the Postgres instance.

Default: Allow all

§stack: Option<Stack>

The stack configuration for the CoreDB instance. This is mainly used for the https://tembo.io platform to allow for the deployment of pre-configured Postgres instances.

§runtime_config: Option<Vec<PgConfig>>

The runtime_config is a way to set the Postgres configuration at runtime. This is a list of PgConfig objects that define the Postgres configuration

For more information on what you can set, please refer to the cloudnative-pg documentation on setting Postgres Parameters

Default: disabled

§override_configs: Option<Vec<PgConfig>>

The override_configs configuration is typically used by the https://cloud.tembo.io platform to allow the user to override the Postgres configuration at runtime.

Default: disabled

§connectionPooler: ConnectionPooler

Connection pooler configuration used to manage database connections, sitting between your application and Postgres instance. Currently when configured this will configure a PgBouncer instance in the namespace of your deployment

Default: disabled

§app_services: Option<Vec<AppService>>

app_service is a way to define a service that is deployed alongside the Postgres instance. This is typically used to deploy a service that is used to connect to the Postgres instance in some manner.

Default: disabled

§restore: Option<Restore>

The restore configuration provides a way to restore a database from a backup stored in an S3 compatible object store.

Default: disabled

§storage_class: Option<String>

A StorageClass provides a way to describe the “classes” of storage offered in a cluster, including their provisioning, replication, and durability.

For more information on StorageClasses please see the Kubernetes documentation

Default: None (uses the default StorageClass in your cluster)

Implementations§

source§

impl CoreDBSpec

source

pub fn get_pg_configs( &self, requires_load: BTreeMap<String, String> ) -> Result<Option<Vec<PgConfig>>, MergeError>

source

pub fn get_pg_config_by_name( &self, config_name: &str, requires_load: BTreeMap<String, String> ) -> Result<Option<PgConfig>, MergeError>

Trait Implementations§

source§

impl Clone for CoreDBSpec

source§

fn clone(&self) -> CoreDBSpec

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreDBSpec

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for CoreDBSpec

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for CoreDBSpec

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl Serialize for CoreDBSpec

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,