Platform
Platform — cluster-level configuration wrapper.
PlatformExamples
Example 1
import { Platform, App } from '@r8s/recipes'
export default (
<Platform routing="gateway" namespace="production">
<App name="api" image="myapp/api:v1" host="api.example.com" />
<App name="web" image="myapp/web:v1" host="app.example.com" />
</Platform>
)Example 2
import { Platform, App } from '@r8s/recipes'
export default (
<Platform namespace="production">
<App name="api" image="myapp/api:v1" host="api.example.com" />
</Platform>
)Example 3
import { Platform, App, Database, cnpgOperator } from '@r8s/recipes'
import { operators } from '@r8s/crds'
export default (
<Platform
routing="gateway"
namespace="production"
operators={[cnpgOperator(), operators['cert-manager']()]}
>
<Database name="app-db" storage="10Gi" />
<App name="api" image="myapp/api:v1" host="api.example.com" />
</Platform>
)Full hierarchy with DNS and secrets
import { Platform, App } from '@r8s/recipes'
export default (
<Platform
namespace="production"
secrets={{ backend: 'openbao', mount: 'secret', path: 'infra' }}
dns={{
provider: 'external-dns',
settings: {
server: 'ns1.example.com',
zone: 'example.com',
tsig: { path: 'dns/tsig', key: 'secret' },
},
}}
>
<App name="api" image="myapp/api:v1" host="api.example.com" />
</Platform>
)Props
routingRoutingModeOptional—Routing implementation for the cluster. - 'ingress': nginx Ingress (default) - 'gateway': Envoy Gateway (Gateway API)
gatewayClassNamestringOptional—Gateway class name (only used when routing='gateway', default: 'eg')
sharedGateway{ name: string, namespace?: string }Optional—Reference to a shared Gateway for all child endpoints. When set, App/Endpoint create only HTTPRoutes (no per-app Gateway), avoiding a new LoadBalancer IP per app.
namespacestringOptional—Default namespace for all child resources
labelsRecordOptional—Default labels applied to all child resources
operatorsOperator[]Optional—Shared operators for all child resources
secretsSecretProviderValueOptional—Secrets backend for all child resources. When set, Database and other recipes generate credentials through this backend instead of requiring plaintext passwords. - 'openbao': OpenBao Vault Secrets Operator (default when omitted) - 'vault': HashiCorp Vault Secrets Operator - 'sealed-secrets': Bitnami Sealed Secrets - 'kubernetes': plain Kubernetes Secrets (CNPG-managed, no plaintext) Use a string for simple cases, or a component for advanced config: secrets={<OpenBao mount="secret" path="infra" />}
dnsDnsProviderValueOptional—DNS configuration for all child endpoints. When set, Endpoint/App automatically create DNS records via ExternalDNS. Use a string for simple cases, or a component for advanced config: dns={<ExternalDns server="ns1.example.com" tsig={{...}} />}
childrenunknownOptional—Child components that inherit the cluster-level configuration this Platform sets