Skip to content

WyriHaximusNet/docker-kubernetes-redis-db-assignment-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kuberneter Redis Database Assignment Operator

Github Actions Docker hub Docker hub Docker hub

Usage

Suggested usage is to use Helm to install this operator:

helm repo add WyriHaximusNet https://helm.wyrihaximus.net/
helm repo update
helm upgrade redis-db-assignment-operator WyriHaximusNet/redis-db-assignment-operator --install --wait --atomic --namespace=redis

After the Helm install following definition will create a redis-database resource on your cluster. The operator picks it up and finds a redis database that isn't in use according to the operators internal state.

apiVersion: wyrihaximus.net/v1
kind: RedisDatabase
metadata:
  name: example
spec:
  secret:
    name: example-redis-database
  service:
    read: redis://redis-follower.redis.svc.cluster.local:6379/
    write: redis://redis-leader.redis.svc.cluster.local:6379/

The resulting secret looks like this:

apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: example-redis-database
  namespace: default
data:
  DATABASE: BASE64_ENCODED
  READ: BASE64_ENCODED
  WRITE: BASE64_ENCODED