Skip to content

Instantly share code, notes, and snippets.

@binura-g
Created September 24, 2025 00:41
Show Gist options
  • Save binura-g/1887c7761e1347a3f909c1c6138fb652 to your computer and use it in GitHub Desktop.
Save binura-g/1887c7761e1347a3f909c1c6138fb652 to your computer and use it in GitHub Desktop.
local web = import 'webApp.libsonnet';
web.webApp({
name: 'react',
image: 'ghcr.io/acme/react-app:main',
replicas: 2,
gatewayName: 'default-gateway',
ingressClass: 'nginx',
serviceType: 'ClusterIP',
endpoints: [
{ name: 'react-app', host: 'app.foo.com', path: '/', port: 8080, type: 'ingress' },
{ name: 'react-app-api1', host: 'api.foo.com', path: '/api1/', port: 8080, type: 'managedAPI' },
],
})
# This can be provided as YAML as well. While jsonnet supports yaml imports, it will need this file
# to pass the parsed yaml object into the web.webApp constructor below.
# Example:
# local web = import 'webApp.libsonnet';
# local cfg = import 'config.yaml';
# web.webApp(cfg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment