pub struct AppService {
    pub name: String,
    pub image: String,
    pub args: Option<Vec<String>>,
    pub command: Option<Vec<String>>,
    pub env: Option<Vec<EnvVar>>,
    pub resources: ResourceRequirements,
    pub probes: Option<Probes>,
    pub middlewares: Option<Vec<Middleware>>,
    pub routing: Option<Vec<Routing>>,
    pub storage: Option<StorageConfig>,
}
Expand description

AppService significantly extends the functionality of your Tembo Postgres instance by running tools and software built by the Postgres open source community.

Example: This will configure and install a Postgrest container along side the Postgres instance, install pg_graphql extension, and configure the ingress routing to expose the Postgrest service.

apiVersion: coredb.io/v1alpha1
kind: CoreDB
metadata:
  name: test-db
spec:
  trunk_installs:
    - name: pg_graphql
      version: 1.2.0
  extensions:
    - name: pg_graphql
      locations:
      - database: postgres
        enabled: true
  
  appServices:
    - name: postgrest
      image: postgrest/postgrest:v10.0.0
      routing:
      # only expose /rest/v1 and /graphql/v1
        - port: 3000
          ingressPath: /rest/v1
          middlewares:
            - my-headers
        - port: 3000
          ingressPath: /graphql/v1
          middlewares:
            - map-gql
            - my-headers
      middlewares:
        - customRequestHeaders:
          name: my-headers
          config:
            # removes auth header from request
            Authorization: ""
            Content-Profile: graphql
            Accept-Profile: graphql
        - stripPrefix:
          name: my-strip-prefix
          config:
            - /rest/v1
        # reroute gql and rest requests
        - replacePathRegex:
          name: map-gql
          config:
            regex: \/graphql\/v1\/?
            replacement: /rpc/resolve
      env:
        - name: PGRST_DB_URI
          valueFromPlatform: ReadWriteConnection
        - name: PGRST_DB_SCHEMA
          value: "public, graphql"
        - name: PGRST_DB_ANON_ROLE
          value: postgres
        - name: PGRST_LOG_LEVEL
          value: info

Fields§

§name: String

Defines the name of the appService.

§image: String

Defines the container image to use for the appService.

§args: Option<Vec<String>>

Defines the arguments to pass into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the Kubernetes docs.

§command: Option<Vec<String>>

Defines the command into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the Kubernetes docs.

§env: Option<Vec<EnvVar>>

Defines the environment variables to pass into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the Kubernetes docs.

§resources: ResourceRequirements

Defines the resources to allocate to the container. You define this in the same manner as you would for all Kubernetes containers. See the Kubernetes docs.

§probes: Option<Probes>

Defines the probes to use for the container. You define this in the same manner as you would for all Kubernetes containers. See the Kubernetes docs.

§middlewares: Option<Vec<Middleware>>

Defines the ingress middeware configuration for the appService. This is specifically configured for the ingress controller Traefik.

§routing: Option<Vec<Routing>>

Defines the routing configuration for the appService.

§storage: Option<StorageConfig>

Defines the storage configuration for the appService.

Trait Implementations§

source§

impl Clone for AppService

source§

fn clone(&self) -> AppService

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 AppService

source§

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

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

impl Default for AppService

source§

fn default() -> AppService

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AppService

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 AppService

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 PartialEq for AppService

source§

fn eq(&self, other: &AppService) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for AppService

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
source§

impl<'__s> ToSchema<'__s> for AppService

source§

fn schema() -> (&'__s str, RefOr<Schema>)

Return a tuple of name and schema or reference to a schema that can be referenced by the name or inlined directly to responses, request bodies or parameters.
source§

fn aliases() -> Vec<(&'__s str, Schema)>

Optional set of alias schemas for the ToSchema::schema. Read more
source§

impl StructuralPartialEq for AppService

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>,