sidecache

module
v0.0.0-...-5adad60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2023 License: MIT

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

Table Of Contents

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.

Directories

Path Synopsis
cmd
pkg
cache
Package cache is a generated GoMock package.
Package cache is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL