Octelium provides a unified, scalable, self-hosted, open source infrastructure to build your AI gateways. Octelium provides the following:
-
A scalable platform built on top of Kubernetes to provide access to your APIs whether they are internal resources behind NAT in multiple private clouds, on-prem, your own laptop, etc... as well as to publicly protected SaaS resources.
-
Deploy, scale and secure access to your containerized APIs (read more about managed containers here).
-
Centralized identity-based, application-layer (L7) aware ABAC access control on a per-request basis (read more about access control here).
-
Unified identity management for both
HUMAN
as well asWORKLOAD
Users (read more here). -
Advanced request/output sanitization and manipulation of headers and body content via Lua scripts and Envoy ExtProc compatible interfaces (read more here) to build you ad-hoc rate limiting, caching, and DLP logic.
-
Unified access and identity for
WORKLOAD
Users via OAuth2 client credentials (read more here) and standard bearer authentication (read more here). -
OpenTelemetry-native, identity-based, L7 aware visibility and auditing (read more here).
-
Secretless access to upstreams that require bearer authentication, basic authentication, OAuth2 client credentials or AWS sigv4 (read more here).
-
Dynamic, identity-based, L7-aware routing to your upstreams (read more about dynamic configuration here).
-
Extremely dynamic plugin system, that includes Lua scripts and Envoy ExtProc compliant servers, to manipulate your request/response headers and body content, including serialized JSON (read more here).
-
GitOps-friendly declarative, programmable management (read more here).

This is a very simple example for a Service to represent a certain API upstream server. The upstream server could be (read more about Service upstreams here):
- A directly accessible resource by the Octelium Cluster (e.g. a Kubernetes service running on the same Kubernetes cluster).
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7port: 808config:9upstream:10url: http://my-api.default.svc:8080
- A remotely accessible resource by the Octelium Cluster via a connected Session (read more here). This could be, in practice, any server that is listening behind NAT (e.g. private cloud, IoT, your own laptop). Here is an example:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7port: 808config:9upstream:10url: http://my-api.default.svc:808011user: eu-central-2
- A publicly protected resource via bearer or basic authentication (read more here). Here is an example for a public SaaS resource that is protected by a bearer access token:
1kind: Service2metadata:3name: my-gemini4spec:5mode: HTTP6isPublic: true7config:8upstream:9url: https://generativelanguage.googleapis.com10auth:11bearer:12fromSecret: gemini-api-key
- A containerized/Docker application that can be deployed as a managed container (read more here). Here is an example:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7config:8upstream:9container:10port: 300011image: ghcr.io/<ORG>/<IMAGE>:<TAG>12replicas: 313credentials:14usernamePassword:15username: linus16password:17fromSecret: reg-password18resourceLimit:19cpu:20millicores: 200021memory:22megabytes: 4000
You can dynamic configuration (read more here) to dynamically route among multiple upstreams the Service based on identity and/or request context (e.g. HTTP request paths, body content, etc...). Here is a minimal example:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7dynamicConfig:8configs:9- name: v110upstream:11url: https://apiv1.example.com12http:13path:14removePrefix: /v115- name: v216upstream:17url: https://apiv2.example.com18http:19path:20removePrefix: /v221rules:22- condition:23match: 'ctx.request.http.path.startsWith("/v1")'24configName: v125- condition:26match: 'ctx.request.http.path.startsWith("/v2")'27configName: v2
You can now apply the creation of the Service as follows (read more here):
octeliumctl apply /PATH/TO/SERVICE.YAML
Octelium doesn't just enable you to dynamically route to an upstream based on a request path, but since it's built as a zero trust architecture, it can dynamically route to an upstream based on the identity and the access context too. Here is an another example:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7dynamicConfig:8configs:9- name: v110upstream:11url: https://apiv1.example.com12http:13path:14removePrefix: /v115- name: v216upstream:17url: https://apiv2.example.com18http:19path:20removePrefix: /v221rules:22- condition:23match: '"prod" in ctx.user.spec.groups'24configName: v125- condition:26match: '"dev" in ctx.user.spec.groups'27configName: v2
You can also use upstreams that are protected by their own credentials such as bearer tokens (read more about secret-less access in HTTP here). Here is an example:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7dynamicConfig:8configs:9- name: v110upstream:11url: https://apiv1.example.com12http:13auth:14bearer:15fromSecret: access-token-116- name: v217upstream:18url: https://apiv2.example.com19http:20auth:21bearer:22fromSecret: access-token-223rules:24- condition:25match: 'ctx.request.http.path.startsWith("/v1")'26configName: v127- condition:28match: 'ctx.request.http.path.startsWith("/v2")'29configName: v2
And you can also deploy and scale your own containerized microservices including those that are served via private registries that are protected with credentials. Here is an example:
First you create the Secret for the registry's password as follows:
octeliumctl create secret ghcr-token
And then you create the Service as follows:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6isPublic: true7dynamicConfig:8configs:9- name: v110upstream:11container:12image: ghcr.io/org/my-api:v113port: 8014replicas: 215credentials:16usernamePassword:17username: org18password:19fromSecret: ghcr-token20http:21path:22removePrefix: /v123- name: v224upstream:25container:26image: ghcr.io/org/my-api:v227port: 8028replicas: 229credentials:30usernamePassword:31username: org32password:33fromSecret: ghcr-token34http:35path:36removePrefix: /v237rules:38- condition:39match: 'ctx.request.http.path.startsWith("/v1")'40configName: v141- condition:42match: 'ctx.request.http.path.startsWith("/v2")'43configName: v2
You can also opt to choose to provide anonymous public access instead of using Octelium to provide authentication and access control. You might want to use anonymous access, for example, for public APIs or whenever you want to handle your own authentication and authorization at the upstream's side. You can read more about the anonymous access mode here.
You can also add and remove request/response headers as in the guide here
When it comes to access control, Octelium provides a rich layer-7 aware, identity-based, context-aware ABAC access control on a per-request basis where you can control access based on the HTTP request's path, method, and even serialized JSON body content using policy-as-code with CEL and Open Policy Agent (OPA) (You can read more in detail about Policies and access control here). Here is a generic example:
1kind: Service2metadata:3name: my-api4spec:5mode: HTTP6config:7upstream:8url: https://api.example.com9authorization:10inlinePolicies:11- spec:12rules:13- effect: ALLOW14condition:15all:16of:17- match: ctx.user.spec.groups.hasAll("dev", "ops")18- match: ctx.request.http.method in ["POST", "PUT"]19- match: ctx.request.http.path.startsWith("/users")20- match: ctx.request.http.headers["x-custom-header"] == "this-value"21# bodyMap contains the serialized JSON body content22- match: ctx.request.http.bodyMap.age > 18 && ctx.request.http.bodyMap.email.endsWith("@example.com")
You can also use Octelium's plugins, currently Lua scripts and Envoy's ExtProc, to sanitize and manipulate your request and responses (read more about HTTP plugins here) in arbitrarily complex ways. For example, you can use this to manipulate the JSON body content of requests/responses and call external APIs to implement advanced identity-based caching and rate limiting. Here is an example:
1kind: Service2metadata:3name: safe-api4spec:5mode: HTTP6isPublic: true7config:8upstream:9url: https://api.example.com10plugins:11- name: main12lua:13inline: |14function onRequest(ctx)15local body = json.decode(octelium.req.getRequestBody())1617if body.age > 100 or body.age < 18 then18octelium.req.exit(400)19end2021if strings.lenUnicode(body.user.name) > 100 then22octelium.req.exit(400)23end2425body.email = ctx.user.spec.email26body.isBrowser = ctx.session.status.isBrowser2728if strings.toLower(body.action) == "create" then29local c = http.client()30c:setBaseURL("http://rate-limiting.default.svc")31local req = c:request()32local bodyReq = {}33bodyReq.userUID = ctx.user.metadata.uid34req:setBody(json.encode(bodyReq))35local resp, err = req:post("/v1/check")36if err then37octelium.req.exit(500)38return39end4041if resp:code() == 200 then42local apiResp = json.decode(resp:body())43if not apiResp.isRateLimited then44octelium.req.exit(429)45return46end47end48end4950octelium.req.setRequestBody(json.encode(body))51end525354function onResponse(ctx)55octelium.req.deleteResponseHeader("X-Internal")56octelium.req.setResponseHeader("X-User-Uid", ctx.user.metadata.uid)57end
Octelium also provides OpenTelemetry-ready, application-layer L7 aware visibility and access logging in real time (see an example for HTTP here). You can read more about visibility here.
This was a very short guide to show you how to use Octelium to deploy, scale, route and provide dynamic zero trust secure access to your workloads. Here are a few more related features that you might be interested in:
- Routing not just by request paths, but also by header keys and values, request body content including JSON (read more here).
- Request/response header manipulation (read more here).
- Cross-Origin Resource Sharing (CORS) (read more here).
- gRPC mode (read more here).
- Secret-less access to upstreams and injecting bearer, basic, or custom authentication header credentials (read more here).
- Exposing the API publicly for anonymous access (read more here).
- Application layer-aware ABAC access control via policy-as-code using CEL and Open Policy Agent (read more here).
- OpenTelemetry-ready, application-layer L7 aware auditing and visibility (read more here).