App
Simple application — Deployment + Service + Endpoint.
AppExamples
Example 1
import { App } from '@r8s/recipes'
export default <App name="myapp" image="myapp/web:v1.2.3" host="myapp.example.com" />Example 2
import { Platform, App } from '@r8s/recipes'
export default (
<Platform routing="gateway" namespace="production">
<App name="myapp" image="myapp/web:v1.2.3" host="myapp.example.com" />
</Platform>
)Example 3
import { App } from '@r8s/recipes'
export default (
<App
name="myapp"
image="myapp/web:v1.2.3"
host="myapp.example.com"
env={{ LOG_LEVEL: 'info' }}
secrets={{ DATABASE_URL: 'app-secrets' }}
/>
)Example 4
import { Database, App } from '@r8s/recipes'
export default (
<>
<Database name="myapp-db" storage="20Gi" />
<App
name="myapp"
image="myapp/web:v1.2.3"
host="myapp.example.com"
tls={{ secretName: 'myapp-tls', clusterIssuer: 'letsencrypt' }}
/>
</>
)Props
namestringRequired—Resource name
namespacestringOptional—Kubernetes namespace (defaults to 'default' or the Platform namespace)
imagestringRequired—Container image (e.g., 'myapp/api:v1.2.3')
portnumberOptional—Container port the app listens on (defaults to 3000)
replicasnumberOptional—Number of pod replicas (defaults to 2)
hoststringOptional—Domain name (e.g., 'api.example.com') the endpoint should accept traffic for. When omitted, no Endpoint/Ingress/Gateway is created (useful for manual routing).
tlsTLSConfigOptional—TLS certificate configuration for HTTPS
envRecordOptional—Plain environment variables (non-sensitive)
secretsRecordOptional—Secrets from Kubernetes Secrets — safe by default
vaultRecordOptional—Secrets from Vault — creates VaultStaticSecret objects
resources{ requests?: { cpu?: string, memory?: string }, limits?: { cpu?: string, memory?: string } }Optional—CPU and memory requests/limits for the app container
cachebooleanOptional—Add a Redis cache for this app (session store, cache, queue)
dnsbooleanOptional—Create a DNS record via ExternalDNS (default: false)
sharedGateway{ name: string, namespace?: string }Optional—Reference to a shared Gateway instead of creating a per-app Gateway. Avoids allocating a new LoadBalancer IP per app.
childrenunknownOptional—Child components rendered as sibling resources (e.g., a BackgroundWorker)