https://github.com/vedadiyan/iceberg
A Kubernetes Sidecar Solution
https://github.com/vedadiyan/iceberg
kubrnetes sidecar sidecar-proxy
Last synced: about 2 months ago
JSON representation
A Kubernetes Sidecar Solution
- Host: GitHub
- URL: https://github.com/vedadiyan/iceberg
- Owner: Vedadiyan
- Created: 2024-02-09T02:52:29.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-23T08:11:49.000Z (11 months ago)
- Last Synced: 2024-05-23T09:29:05.666Z (11 months ago)
- Topics: kubrnetes, sidecar, sidecar-proxy
- Language: Go
- Homepage:
- Size: 3.77 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

[](https://goreportcard.com/report/github.com/vedadiyan/iceberg)
![]()
Iceberg (K8s Sidecar Solution)# iceberg
iceberg is a Kubernetes sidecar proxy that can intercept and filter traffic between the main application container and clients. It provides a flexible way to handle cross-cutting concerns like security, monitoring, and more.## Features
- Deploy as sidecar container alongside main app container
- Listen on HTTP/HTTPS or Websocket as frontend
- Proxy requests to main app as backend
- Define filter chains to transform requests and responsesSupport filters using different protocols:
- HTTP/HTTPS
- gRPC (SUPPORT DROPPED)
- NATS
- Websocket (In Development)Filters for:
- Intercepting requests
- Post-processing responses
- Parallel processing without side effects (e.g. logging)
- Exchange headers and body between filter and main traffic
- Ignore exchange mechanism for parallel filters## Configuration
iceberg is configured via a YAML file specified in the `ICEBERG_CONFIG` environment variable.### Example configuration:
apiVersion: apps/v1
metadata:
name: test
spec:
listen: ''
resources:
main-api:
frontend: ''
backend: ''
method: ''
use:
cache:
addr: 'jetstream://[[default_nats]]/bucket_name'
ttl: 30s
key: 'test_${:route_value}_${?query_param}_${body}_${method}'
cors: default
filters:
- name: request-log
addr: 'jetstream://[default_nats]/abc'
level: request
timeout: 30s
onError: default
async: false
await: []
exchange:
headers:
- X-Test-Header
body: true
next:
- name: test
addr: 'nats://[default_nats]/test'
onError: default
timeout: 30s
async: true
await: []
- name: test2
addr: 'nats://[default_nats]/test2'
timeout: 30s
onError: default
async: false
await:
- testTo specify a host via environment variable, use [[envvar]] syntax.
## Deployment
Deploy iceberg sidecar container in pod alongside main app container. Main container ports should not be exposed directly.
Example pod spec:
spec:
containers:
- name: main-app
# main app image
- name: iceberg
image: iceberg
env:
- name: ICEBERG_CONFIG
value: |
# iceberg config here
ports:
- containerPort: 8081
This exposes the iceberg proxy on port 8081 to handle all incoming traffic to the pod. Main app container is accessed internally as the backend.## Usage
With iceberg deployed as sidecar, all traffic to the pod will be proxied through iceberg and filtered based on configured chains.
Add filter chains to:
- Validate requests
- Enrich requests with data from other services
- Scrub response data
- Log/monitor requests without side effectsAnd more!