An open API service indexing awesome lists of open source software.

https://github.com/trendyol/sidecache

Sidecar cache for kubernetes applications.
https://github.com/trendyol/sidecache

cache couchbase golang istio kubernetes redis sidecar

Last synced: 3 months ago
JSON representation

Sidecar cache for kubernetes applications.

Awesome Lists containing this project

README

          

# sidecache
Sidecar cache for kubernetes applications. It acts as a proxy sidecar between application and client, routes incoming requests to cache storage or application according to Istio VirtualService routing rules.

Medium article: https://medium.com/trendyol-tech/trendyol-platform-team-caching-service-to-service-communications-on-kubernetes-istio-82327589b935

[![License: MIT](https://img.shields.io/badge/License-MIT-ligthgreen.svg)](https://opensource.org/licenses/MIT)

## Table Of Contents

- [Istio Configuration](#istio-configuration-for-routing-http-requests-to-sidecar-container)
- [Environment Variables](#environment-variables)

## Istio Configuration for Routing Http Requests to Sidecar Container

Below VirtualService is responsible for routing all get requests to port 9191 on your pod, other http requests goes to port 8080.

```
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: foo
spec:
gateways:
- foo-gateway
hosts:
- foo
http:
- match:
- method:
exact: GET
route:
- destination:
host: foo
port:
number: 9191
- route:
- destination:
host: foo
port:
number: 8080
```

## Environment Variables

Environment variables for sidecar container.

- **MAIN_CONTAINER_PORT**: The port of main application to proxy.
- **COUCHBASE_HOST**: Couchbase host addr.
- **COUCHBASE_USERNAME**: Couchbase username.
- **COUCHBASE_PASSWORD**: Couchbase password.
- **BUCKET_NAME**: Couchbase cache bucket name.
- **CACHE_KEY_PREFIX**: Cache key prefix to prevent url conflicts between different applications.
- **SIDE_CACHE_PORT**: Sidecar container port to listen.