redis-operator

by RADAR-Base

Helm chartv0.22.2App 0.22.2Verified publisher

Provides easy redis setup definitions for Kubernetes services, and deployment.

About this chart

redis

This Helm chart deploys the redis-operator into your Kubernetes cluster. The operator facilitates the deployment, scaling, and management of Redis clusters and other Redis resources provided by the OpsTree Solutions team.

Homepage: https://github.com/ot-container-kit/redis-operator

Maintainers

NameEmailUrl
iamabhishek-dubey
sandy724
shubham-cmyk

Pre-Requisities

  • Helm v3+
  • Kubernetes v1.16+
  • If you plan to use cert-manager integration (certmanager.enabled=true), cert-manager must be pre-installed in your cluster

Source Code

Installation Steps

1. Add Helm Repository

helm repo add ot-helm https://ot-container-kit.github.io/helm-charts

2. Install Cert-Manager (Optional)

If you plan to use cert-manager with the redis-operator, you need to install cert-manager before deploying the operator. You can follow the official cert-manager installation guide.

3. Install Redis Operator

Replace <YourCertSecretName> and <YourPrivateKey> with your specific values.

helm install <redis-operator> ot-helm/redis-operator --version=0.15.5 --appVersion=0.15.1 --set certificate.secretName=<YourCertSecretName> --set certmanager.enabled=true --set redisOperator.webhook=true --namespace <redis-operator> --create-namespace

Note: If certificate.secretName is not provided, the operator will generate a self-signed certificate and use it for webhook server.


Note : If you want to disable the webhook you have to pass the --set webhook=false and --set certmanager.enabled=false while installing the redis-operator.


Note: If you want to use an existing ClusterIssuer to sign the webhook certificate, you can pass --set issuer.create=false, --set issuer.kind=ClusterIssuer and --set issuer.name=cluster-issuer-name-here while installing the operator.

4. Patch the CA Bundle (if using cert-manager)

Cert-manager injects the CA bundle into the webhook configuration.

kubectl patch crd redis.redis.redis.opstreelabs.in -p '{"metadata":{"annotations":{"cert-manager.io/inject-ca-from":"<redis-operator>/<serving-cert>"}}}'

kubectl patch crd redisclusters.redis.redis.opstreelabs.in -p '{"metadata":{"annotations":{"cert-manager.io/inject-ca-from":"<redis-operator>/<serving-cert>"}}}'

kubectl patch crd redisreplications.redis.redis.opstreelabs.in -p '{"metadata":{"annotations":{"cert-manager.io/inject-ca-from":"<redis-operator>/<serving-cert>"}}}'

kubectl patch crd redissentinels.redis.redis.opstreelabs.in -p '{"metadata":{"annotations":{"cert-manager.io/inject-ca-from":"<redis-operator>/<serving-cert>"}}}'

Note: Replace <redis-operator> and <serving-cert> with your specific values i.e. release name and certificate name.

You can verify the patch by running the following commands

kubectl get crd redis.redis.redis.opstreelabs.in -o=jsonpath='{.metadata.annotations}'
kubectl get crd redisclusters.redis.redis.opstreelabs.in -o=jsonpath='{.metadata.annotations}'
kubectl get crd redisreplications.redis.redis.opstreelabs.in -o=jsonpath='{.metadata.annotations}'
kubectl get crd redissentinels.redis.redis.opstreelabs.in -o=jsonpath='{.metadata.annotations}'

How to generate private key( Optional )

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt
kubectl create secret tls <webhook-server-cert> --key tls.key --cert tls.crt -n <redis-operator>

Note: This secret will be used for webhook server certificate so generate it before installing the redis-operator.

Values

KeyTypeDefaultDescription
affinityobject{}
certificate.namestring"serving-cert"
certificate.secretNamestring"webhook-server-cert"
certmanager.apiVersionstring"cert-manager.io/v1"
certmanager.enabledboolfalse
featureGates.GenerateConfigInInitContainerboolfalse
issuer.createbooltrue
issuer.emailstring"[email protected]"
issuer.kindstring"Issuer"
issuer.namestring"redis-operator-issuer"
issuer.privateKeySecretNamestring"letsencrypt-prod"
issuer.serverstring"https://acme-v02.api.letsencrypt.org/directory"
issuer.solver.enabledbooltrue
issuer.solver.ingressClassstring"nginx"
issuer.typestring"selfSigned"
manager.config.kubeClientQPSfloat0If value > 0, it will override the default value in the operator
manager.config.kubeClientTimeoutstring"60s"
nodeSelectorobject{}
podSecurityContextobject{}
priorityClassNamestring""
rbac.enabledbooltrue
redisOperator.automountServiceAccountTokenbooltrue
redisOperator.envlist[]
redisOperator.extraArgslist[]
redisOperator.imageNamestring"quay.io/opstree/redis-operator"
redisOperator.imagePullPolicystring"Always"
redisOperator.imagePullSecretslist[]
redisOperator.imageTagstring""
redisOperator.metrics.bindAddressstring":8080"
redisOperator.metrics.enabledbooltrue
redisOperator.namestring"redis-operator"
redisOperator.podAnnotationsobject{}
redisOperator.podLabelsobject{}
redisOperator.pprof.bindAddressstring":6060"
redisOperator.pprof.enabledboolfalse
redisOperator.watchNamespacestring""
redisOperator.webhookboolfalse
replicasint1
resources.limits.cpustring"500m"
resources.limits.memorystring"500Mi"
resources.requests.cpustring"500m"
resources.requests.memorystring"500Mi"
securityContextobject{}
service.namestring"webhook-service"
service.namespacestring"redis-operator"
serviceAccount.automountServiceAccountTokenbooltrue
serviceAccountNamestring"redis-operator"
tolerateAllTaintsboolfalse
tolerationslist[]

Deploy redis-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has redis-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartredis-operator is pinned at v0.22.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply