redis-operator

by Helm

Helm chartv0.18.0App 0.18.0

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

About this chart

Redis Operator Helm Chart

Introduction

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.

Pre-requisites

  • Helm v3+
  • Kubernetes v1.16+
  • If you intend to use the cert-manager, ensure that the cert-manager CRDs are installed before deploying the redis-operator.

Installation Steps

1. Add Helm Repository

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

2. Install Cert-Manager CRDs (if using cert-manager)

If you plan to use cert-manager with the redis-operator, you need to install the cert-manager CRDs before deploying the operator.

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.4/cert-manager.crds.yaml

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.

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.

Default Values

ParameterDescriptionDefault
redisOperator.nameOperator nameredis-operator
redisOperator.imageNameImage repositoryquay.io/opstree/redis-operator
redisOperator.imageTagImage tag{{appVersion}}
redisOperator.imagePullPolicyImage pull policyAlways
redisOperator.podAnnotationsAdditional pod annotations{}
redisOperator.podLabelsAdditional Pod labels{}
redisOperator.extraArgsAdditional arguments for the operator{}
redisOperator.watchNamespaceNamespace for the operator to watch""
redisOperator.envEnvironment variables for the operator{}
redisOperator.webhookEnable webhookfalse
redisOperator.automountServiceAccountTokenAutomount service account tokentrue
resources.limits.cpuCPU limit500m
resources.limits.memoryMemory limit500Mi
resources.requests.cpuCPU request500m
resources.requests.memoryMemory request500Mi
replicasNumber of replicas1
rbac.enabledFeature flag for rbac resourcestrue
serviceAccountNameService account nameredis-operator
serviceAccount.automountServiceAccountTokenAutomount service account tokentrue
certificate.nameCertificate nameserving-cert
certificate.secretNameCertificate secret namewebhook-server-cert
issuer.typeIssuer typeselfSigned
issuer.nameIssuer nameredis-operator-issuer
issuer.emailIssuer email[email protected]
issuer.serverIssuer server URLhttps://acme-v02.api.letsencrypt.org/directory
issuer.privateKeySecretNamePrivate key secret nameletsencrypt-prod
certManager.enabledEnable cert-managerfalse

Scheduling Parameters

ParameterDescriptionDefault
priorityClassNamePriority class name for the pods""
nodeSelectorLabels for pod assignment{}
tolerateAllTaintsWhether to tolerate all node taintsfalse
tolerationsTaints to tolerate[]
affinityAffinity rules for pod assignment{}

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.18.0 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