Struct controller::app_service::types::AppService
source · 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
impl Clone for AppService
source§fn clone(&self) -> AppService
fn clone(&self) -> AppService
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AppService
impl Debug for AppService
source§impl Default for AppService
impl Default for AppService
source§fn default() -> AppService
fn default() -> AppService
source§impl<'de> Deserialize<'de> for AppService
impl<'de> Deserialize<'de> for AppService
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl JsonSchema for AppService
impl JsonSchema for AppService
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq for AppService
impl PartialEq for AppService
source§fn eq(&self, other: &AppService) -> bool
fn eq(&self, other: &AppService) -> bool
self
and other
values to be equal, and is used
by ==
.