### Install Dependencies and Start Development Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/dev.md Run this command for first-time setup to install all necessary dependencies and then start the daily development workflow. ```sh mise install && mise run install-js-deps ``` -------------------------------- ### Frontend Extension Setup Function Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/topics/admin-extensions.md Example JavaScript code for a frontend extension's setup function. This function registers UI components and other features with the Otoroshi admin UI. ```javascript // javascript/src/extensions/widgets/index.js export function setupWidgetsExtension(registerExtension) { registerExtension({ id: 'otoroshi.extensions.Widgets', categories: [], features: [], sidebarItems: [ { title: 'Widgets', text: 'Widgets', path: 'extensions/widgets/widgets', icon: 'cubes', } ], searchItems: [], routes: [], entities: [], properties: {}, }); } ``` -------------------------------- ### Add API Keys at First Boot Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/tutorials/custom-initial-state/index.html Pre-populate Otoroshi with API keys during the initial setup. This example demonstrates how to define an API key with specific client details, authorization, and quota settings. ```bash export OTOROSHI_INITIAL_CUSTOMIZATION='{"apikeys":[{"_loc":{"tenant":"default","teams":["default"]},"clientId":"ksVlQ2KlZm0CnDfP","clientSecret":"usZYbE1iwSsbpKY45W8kdbZySj1M5CWvFXe0sPbZ0glw6JalMsgorDvSBdr2ZVBk","clientName":"awesome-apikey","description":"the awesome apikey","authorizedGroup":"default","authorizedEntities":["group_default"],"enabled":true,"readOnly":false,"allowClientIdOnly":false,"throttlingQuota":10000000,"dailyQuota":10000000,"monthlyQuota":10000000,"constrainedServicesOnly":false,"restrictions":{"enabled":false,"allowLast":true,"allowed":[],"forbidden":[],"notFound":[]},"rotation":{"enabled":false,"rotationEvery":744,"gracePeriod":168,"nextSecret":null},"validUntil":null,"tags":[],"metadata":{}}]}' ``` -------------------------------- ### Setup Widgets Extension in JavaScript Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/topics/admin-extensions/index.html The JavaScript module for frontend extensions should export a setup function that registers UI components. This example shows how to register a 'Widgets' extension. ```javascript export function setupWidgetsExtension(registerExtension) { registerExtension({ id: 'otoroshi.extensions.Widgets', categories: [], features: [], sidebarItems: [ { title: 'Widgets', text: 'Widgets', path: 'extensions/widgets/widgets', icon: 'cubes', } ], searchItems: [], routes: [], entities: [], properties: {}, }); } ``` -------------------------------- ### List all resources of a specific type Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/topics/otoroshictl/index.html Use the `resources get` command to list all instances of a particular resource type. Examples include routes, API keys, certificates, backends, and auth modules. ```bash otoroshictl resources get route ``` ```bash otoroshictl resources get apikey ``` ```bash otoroshictl resources get certificate ``` ```bash otoroshictl resources get backend ``` ```bash otoroshictl resources get auth-module ``` -------------------------------- ### Run Otoroshi with JVM Options and Import Data Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/install/run-otoroshi.md Start Otoroshi with specific JVM memory settings, HTTP port, and import data from a JSON file and a configuration file. This example demonstrates a comprehensive startup configuration. ```sh $ java \ -Xms2G \ -Xmx8G \ -Dhttp.port=8080 \ -Dotoroshi.importFrom=/home/user/otoroshi.json \ -Dconfig.file=/home/user/otoroshi.conf \ -jar ./otoroshi.jar [warn] otoroshi-in-memory-datastores - Now using InMemory DataStores [warn] otoroshi-env - The main datastore seems to be empty, registering some basic services [warn] otoroshi-env - Importing from: /home/user/otoroshi.json [info] play.api.Play - Application started (Prod) [info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:8080 ``` -------------------------------- ### User Information Examples Source: https://github.com/maif/otoroshi/blob/master/docs/manual/docs/topics/expression-language/index.html Examples demonstrating how to access user name, email, metadata, and profile fields. ```string ${user.name} ``` ```string ${user.email} ``` ```string ${user.metadata.username:'not-found'} ``` ```string ${user.metadata.username} ``` ```string ${user.profile.username:'not-found'} ``` ```string ${user.profile.name} ``` -------------------------------- ### Netty Server Startup Log Example Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/topics/netty-server/index.html This log output indicates that the experimental Netty server has started and is using the KQueue native transport. It also shows the configured HTTP and HTTPS endpoints. ```log root [info] otoroshi-experimental-netty-server -root [info] otoroshi-experimental-netty-server - Starting the experimental Netty Server !!!root [info] otoroshi-experimental-netty-server -root [info] otoroshi-experimental-netty-server - using KQueue native transportroot [info] otoroshi-experimental-netty-server -root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/1.1, HTTP/2)root [info] otoroshi-experimental-netty-server - http://0.0.0.0:10049 (HTTP/1.1, HTTP/2 H2C)root [info] otoroshi-experimental-netty-server - ``` -------------------------------- ### HAProxy Example for Bare Metal Kubernetes Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example HAProxy configuration for routing external traffic to Otoroshi instances exposed via NodePort on a bare-metal Kubernetes cluster. This setup assumes Otoroshi is accessible on port 8080. ```text frontend http bind *:80 mode http default_backend otoroshi backend otoroshi mode http balance roundrobin option httpchk GET /api/health server otoroshi1 :30080 check server otoroshi2 :30080 check ``` -------------------------------- ### Start Documentation Server Only Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/dev/index.html Starts only the Docusaurus development server for the documentation site. ```bash mise run dev-doc ``` -------------------------------- ### Complete Backend JSON Example Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/entities/backends/index.html An example of a complete backend configuration in JSON format. ```APIDOC ## Complete Backend JSON Example ### Description This is a comprehensive example of a backend configuration object. ### JSON Example ```json { "targets": [ { "id": "target_1", "hostname": "api-1.backend.internal", "port": 8080, "tls": false, "weight": 1, "protocol": "HTTP/1.1", "predicate": { "type": "AlwaysMatch" }, "backup": false }, { "id": "target_2", "hostname": "api-2.backend.internal", "port": 8080, "tls": false, "weight": 1, "protocol": "HTTP/1.1", "predicate": { "type": "AlwaysMatch" }, "backup": true } ], "root": "/api/v1", "rewrite": false, "load_balancing": { "type": "RoundRobin" }, "health_check": { "enabled": true, "url": "http://api-1.backend.internal:8080/health" }, "client": { "retries": 1, "max_errors": 20, "retry_initial_delay": 50, "backoff_factor": 2, "connection_timeout": 10000, "idle_timeout": 60000, "call_and_stream_timeout": 120000, "call_timeout": 30000, "global_timeout": 30000, "sample_interval": 2000, "cache_connection_settings": { "enabled": false, "queue_size": 2048 }, "custom_timeouts": [] } } ``` ``` -------------------------------- ### Install otoroshictl on Linux (x86_64) Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/topics/otoroshictl/index.html Download and install the otoroshictl binary for Linux on x86_64 architecture. ```bash curl -L -o otoroshictl https://github.com/cloud-apim/otoroshictl/releases/latest/download/otoroshictl-x86_64-unknown-linux-gnu chmod +x otoroshictl sudo mv otoroshictl /usr/local/bin/ ``` -------------------------------- ### Full Otoroshi Sidecar Deployment Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx This is a complete example demonstrating the deployment of Otoroshi with the sidecar injector configured. ```yaml apiVersion: v1 kind: Namespace metadata: name: otoroshi --- apiVersion: apps/v1 kind: Deployment metadata: name: otoroshi namespace: otoroshi spec: replicas: 1 selector: matchLabels: app: otoroshi template: metadata: labels: app: otoroshi spec: containers: - name: otoroshi image: otoroshi/otoroshi:latest args: - "--config" - "/opt/otoroshi/conf/config.yaml" ports: - containerPort: 8080 volumeMounts: - name: config-volume mountPath: /opt/otoroshi/conf volumes: - name: config-volume configMap: name: otoroshi-config --- apiVersion: v1 kind: ConfigMap metadata: name: otoroshi-config namespace: otoroshi data: config.yaml: | otoroshi: { listeners: [ { port: 8080 tls: false host: "0.0.0.0" } ] plugins: {} jobs: {} request_sinks: [ { "otoroshi.plugins.jobs.kubernetes.KubernetesAdmissionWebhookSidecarInjector": {} } ] } --- apiVersion: v1 kind: Service metadata: name: otoroshi namespace: otoroshi spec: selector: app: otoroshi ports: - protocol: TCP port: 8080 targetPort: 8080 --- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: name: otoroshi-sidecar-injector webhooks: - name: sidecar-injector.otoroshi.io clientConfig: service: name: otoroshi-admission-webhook namespace: otoroshi path: "/" scheme: "http" rules: - operations: ["CREATE"] apiGroups: [""] apiVersions: ["v1"] resources: ["pods"] sideEffects: None admissionReviewVersions: ["v1"] ``` -------------------------------- ### DNS Example for Bare Metal Kubernetes Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example DNS configuration for a bare-metal Kubernetes cluster. It shows how to point your Otoroshi domain names to the IP address of your external load balancer (e.g., HAProxy or Nginx). ```text otoroshi.foo.bar A ``` -------------------------------- ### Kubernetes Organization Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for an organization, defining its name and description. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "Organization" metadata: name: "my-organization" spec: name: "my-organization" description: "My organization" ``` -------------------------------- ### DNS Example for Cloud Managed Kubernetes Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example DNS configuration for a cloud-managed Kubernetes cluster. It shows how to point your Otoroshi domain names to the external CNAME of the LoadBalancer service. ```text otoroshi.foo.bar CNAME ``` -------------------------------- ### Kubernetes Auth Module Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for an auth module, specifying its type and configuration. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "AuthModule" metadata: name: "my-auth-module" namespace: "default" spec: name: "my-auth-module" type: "otoroshi-auth-module-basic-auth" config: {} ``` -------------------------------- ### Nginx Example for Bare Metal Kubernetes Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example Nginx configuration for acting as a load balancer in front of Otoroshi instances exposed via NodePort on a bare-metal Kubernetes cluster. This configuration forwards traffic to the Otoroshi NodePort service. ```text http { upstream otoroshi { server :30080; server :30080; } server { listen 80; location / { proxy_pass http://otoroshi; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } } ``` -------------------------------- ### DNS Configuration for Bare Metal Otoroshi Cluster (Example 1) Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example DNS configuration to bind Otoroshi domain names to the load balancer fronting a bare metal Kubernetes cluster deployment. ```text include=../snippets/kubernetes/kustomize/overlays/cluster-baremetal/dns.example ``` -------------------------------- ### Kubernetes Certificate Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for a certificate, specifying its domain, private key, and certificate chain. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "Certificate" metadata: name: "my-certificate" namespace: "default" spec: domain: "my-certificate.mydomain.com" privateKey: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----" cert: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----" ``` -------------------------------- ### DNS Configuration for Bare Metal Otoroshi Cluster DaemonSet (Example 1) Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example DNS configuration to bind Otoroshi domain names to the load balancer fronting a bare metal Kubernetes cluster with a DaemonSet deployment. ```text include=../snippets/kubernetes/kustomize/overlays/cluster-baremetal-daemonset/dns.example ``` -------------------------------- ### Kubernetes Service Descriptor Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for a service descriptor, detailing its name, domain, and configuration. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "ServiceDescriptor" metadata: name: "my-service" namespace: "default" spec: name: "my-service" description: "A sample service descriptor" domain: "my-service.mydomain.com" // ... other service descriptor configurations ``` -------------------------------- ### Kubernetes Team Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for a team, specifying its name and associated organization. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "Team" metadata: name: "my-team" namespace: "default" spec: name: "my-team" organization: "my-organization" ``` -------------------------------- ### Kubernetes Apikey Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for an apikey, including its ID, associated service group, and enabled status. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "Apikey" metadata: name: "my-apikey" namespace: "default" spec: id: "my-apikey" enabled: true authorized: true // ... other apikey specific configurations service: "my-service-group" // ... other apikey specific configurations ``` -------------------------------- ### Kubernetes Group Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for a group, defining its API version, kind, and metadata. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "Group" metadata: name: "my-group" namespace: "default" spec: name: "my-group" refs: [] tenant: "default" ``` -------------------------------- ### Access Deployed Application Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example command to test access to the deployed HTTP application via its Ingress route through Otoroshi. ```sh curl -X GET https://httpapp.foo.bar/get ``` -------------------------------- ### Example curl command to access a service via Otoroshi mesh DNS Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Demonstrates how to use curl to access a service exposed through the Otoroshi mesh DNS. Replace placeholders with your actual client credentials and service endpoint. ```sh CLIENT_ID="xxx" CLIENT_SECRET="xxx" curl -X GET https://my-awesome-service.my-awesome-service-namespace.otoroshi.mesh:8443/get -u "$CLIENT_ID:$CLIENT_SECRET" ``` -------------------------------- ### Kubernetes JWT Verifier Resource Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx An example of a Kubernetes Custom Resource Definition for a JWT verifier, including its issuer, audience, and JWKS URL. ```yaml apiVersion: "proxy.otoroshi.io/v1" kind: "JwtVerifier" metadata: name: "my-jwt-verifier" namespace: "default" spec: name: "my-jwt-verifier" issuer: "https://my.auth.server/" audience: ["my-service"] jwksUrl: "https://my.auth.server/.well-known/jwks.json" ``` -------------------------------- ### Nginx Configuration for Bare Metal Otoroshi DaemonSet Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example Nginx configuration for routing external TCP traffic to Otoroshi instances deployed as a DaemonSet on bare metal Kubernetes. ```text include=../snippets/kubernetes/kustomize/overlays/simple-baremetal-daemonset/nginx.example ``` -------------------------------- ### Node.js Example for Calling Internal Service with mTLS Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx This Node.js script demonstrates how to call an internal service descriptor within Otoroshi using mTLS. It reads API keys and certificates from mounted Kubernetes secrets. ```javascript const fs = require('fs'); const https = require('https'); // here we read the apikey to access http-app-2 from files mounted from secrets const clientId = fs.readFileSync('/var/run/secrets/kubernetes.io/apikeys/clientId').toString('utf8') const clientSecret = fs.readFileSync('/var/run/secrets/kubernetes.io/apikeys/clientSecret').toString('utf8') const backendKey = fs.readFileSync('/var/run/secrets/kubernetes.io/certs/backend/tls.key').toString('utf8') const backendCert = fs.readFileSync('/var/run/secrets/kubernetes.io/certs/backend/cert.crt').toString('utf8') const backendCa = fs.readFileSync('/var/run/secrets/kubernetes.io/certs/backend/ca-chain.crt').toString('utf8') const clientKey = fs.readFileSync('/var/run/secrets/kubernetes.io/certs/client/tls.key').toString('utf8') const clientCert = fs.readFileSync('/var/run/secrets/kubernetes.io/certs/client/cert.crt').toString('utf8') const clientCa = fs.readFileSync('/var/run/secrets/kubernetes.io/certs/client/ca-chain.crt').toString('utf8') function callApi2() { return new Promise((success, failure) => { const options = { // using the implicit internal name (*.global.otoroshi.mesh) of the other service descriptor passing through otoroshi hostname: 'http-app-service-descriptor-2.global.otoroshi.mesh', port: 433, path: '/', method: 'GET', headers: { 'Accept': 'application/json', 'Otoroshi-Client-Id': clientId, 'Otoroshi-Client-Secret': clientSecret, }, cert: clientCert, key: clientKey, ca: clientCa }; let data = ''; const req = https.request(options, (res) => { res.on('data', (d) => { data = data + d.toString('utf8'); }); res.on('end', () => { success({ body: JSON.parse(data), res }); }); res.on('error', (e) => { failure(e); }); }); req.end(); }) } const options = { key: backendKey, cert: backendCert, ca: backendCa, // we want mtls behavior requestCert: true, rejectUnauthorized: true }; https.createServer(options, (req, res) => { res.writeHead(200, {'Content-Type': 'application/json'}); callApi2().then(resp => { res.write(JSON.stringify{ ("message": `Hello to ${req.socket.getPeerCertificate().subject.CN}`, api2: resp.body })}); }); }).listen(433); ``` -------------------------------- ### DNS Configuration for Bare Metal Otoroshi DaemonSet Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example DNS configuration to bind Otoroshi domain names to the load balancer fronting a bare metal Kubernetes cluster with a DaemonSet deployment. ```text include=../snippets/kubernetes/kustomize/overlays/simple-baremetal-daemonset/dns.example ``` -------------------------------- ### Build Everything with Documentation Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/dev/index.html Builds the entire project, including the frontend, backend JAR, and documentation. ```bash mise run build-w-doc ``` -------------------------------- ### Netty Server Access Log Example Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/topics/netty-server.md An example of a single access log entry generated by the Netty server. It demonstrates the format with specific values for a GET request. ```log 192.168.1.10 - - [13/Mar/2026:10:30:45 +0100] "GET /api/users HTTP/1.1" 200 1024 12 TLSv1.3 ``` -------------------------------- ### HAProxy Configuration for Bare Metal Otoroshi DaemonSet Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example HAProxy configuration for routing external TCP traffic to Otoroshi instances deployed as a DaemonSet on bare metal Kubernetes. ```text include=../snippets/kubernetes/kustomize/overlays/simple-baremetal-daemonset/haproxy.example ``` -------------------------------- ### Start Otoroshi Development with Documentation Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/dev/index.html Starts the Otoroshi development environment along with the documentation dev server. ```bash mise run dev-w-doc ``` -------------------------------- ### Example coredns deployment for kube-dns integration Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx This YAML defines a CoreDNS deployment configured for Otoroshi domain resolution, intended to be used as a stub domain in older kube-dns systems. ```yaml include=../snippets/kubernetes/kustomize/base/coredns.yaml ``` -------------------------------- ### Nginx Configuration for Bare Metal Otoroshi Cluster DaemonSet Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example Nginx configuration for routing external TCP traffic to Otoroshi leader/worker instances deployed as DaemonSets on bare metal Kubernetes using `nodePort`. ```text include=../snippets/kubernetes/kustomize/overlays/cluster-baremetal-daemonset/nginx.example ``` -------------------------------- ### Nginx Configuration for Bare Metal Otoroshi Cluster Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example Nginx configuration for routing external TCP traffic to Otoroshi instances deployed as a cluster on bare metal Kubernetes using `nodePort`. ```text include=../snippets/kubernetes/kustomize/overlays/cluster-baremetal/nginx.example ``` -------------------------------- ### Otoroshi Redis Deployment Manifest Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx This YAML file defines a Redis deployment, which Otoroshi can use as a backend for storing its state. This is an example and can be replaced with your own Redis instance. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: redis labels: app: redis spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis spec: containers: - name: redis image: redis:latest ports: - containerPort: 6379 --- apiVersion: v1 kind: Service metadata: name: redis spec: selector: app: redis ports: - protocol: TCP port: 6379 targetPort: 6379 ``` -------------------------------- ### Deploy HTTP Service and Ingress Route Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example Kubernetes manifest for deploying an HTTP application, its corresponding Service, and an Ingress resource. The Ingress is configured to use 'otoroshi' as its class, directing traffic to the deployed service. ```yaml --- apiVersion: apps/v1 kind: Deployment metadata: name: http-app-deployment spec: selector: matchLabels: run: http-app-deployment replicas: 1 template: metadata: labels: run: http-app-deployment spec: containers: - image: kennethreitz/httpbin imagePullPolicy: IfNotPresent name: otoroshi ports: - containerPort: 80 name: "http" --- apiVersion: v1 kind: Service metadata: name: http-app-service spec: ports: - port: 8080 targetPort: http name: http selector: run: http-app-deployment --- apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: http-app-ingress annotations: kubernetes.io/ingress.class: otoroshi spec: tls: - hosts: - httpapp.foo.bar secretName: http-app-cert rules: - host: httpapp.foo.bar http: paths: - path: / backend: serviceName: http-app-service servicePort: 8080 ``` -------------------------------- ### Start Otoroshi with Custom Admin Password Source: https://github.com/maif/otoroshi/blob/master/docs/devmanual/docs/recipes/stop-sharing-secrets-use-asymmetric-signatures/index.html Start the Otoroshi application using Java, specifying a custom admin password via a system property. This is useful for initial setup and security. ```bash java -Dotoroshi.adminPassword=password -jar otoroshi.jar ``` -------------------------------- ### Quick Reference for Development Tasks Source: https://github.com/maif/otoroshi/blob/master/docs/manual/docs/dev/index.html A set of commands for initial setup, daily development, committing code, and building releases. ```bash # First time setup mise install && mise run install-js-deps ``` ```bash # Daily development mise run dev # start coding ``` ```bash # Before committing mise run fmt # format code mise run test # run tests ``` ```bash # Build a release mise run build # produce otoroshi.jar mise run jar # test the jar locally ``` -------------------------------- ### DNS Configuration for Cloud Otoroshi Cluster Source: https://github.com/maif/otoroshi/blob/master/manual/next/docs/deploy/kubernetes.mdx Example DNS configuration to bind Otoroshi domain names to the external CNAME of the `LoadBalancer` service used in a cloud Kubernetes cluster deployment. ```text include=../snippets/kubernetes/kustomize/overlays/cluster/dns.example ```