diff --git a/404.html b/404.html index e401c104cb..bb2a2a2978 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@ -

404

Looks like we've got some broken links.
+ diff --git a/guide/changelog.html b/guide/changelog.html deleted file mode 100644 index 159877f5c5..0000000000 --- a/guide/changelog.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - v0.12.0 | Redis Operator - - - - - - - - - - - -

# v0.12.0

# October 12, 2022

🐞 Bug Fixes

  • PDB (Pod disruption budget) creation issue
  • Fixed cluster recovery logic
  • Fixed IP check and conversion logic
  • Persistence issue fix

πŸŽ‰ Features

  • Added pvc, pv clusterrole fix
  • Support for defining serviceAccount
  • Closing of redis client connection
  • Added finalizer for statefulset
  • Added Prometheus service annotation
  • Added support for Redis 7 with DNS hostname

# v0.11.0

July 5, 2022

🐞 Bug Fixes

  • Fix Redis cluster and Redis CRD
  • Fixed TLS authentication between redis cluster
  • Fixed RBAC policy for PDB
  • Redis exporter exception handled
  • External service fix

# v0.10.0

January 26, 2022

πŸŽ‰ Features

  • Added custom probes capability
  • Added sidecar support for redis
  • Added option for namespaced operator
  • Added finalizers for Kubernetes resources
  • Adding PodDisruptionBudget support
  • Added TLS cluster support
  • Pass through Annotations and Labels to all Child resources
  • Adding Rudimentry IPv6 Support

🐞 Bug Fixes

  • Fix up RedisClusterStatus Spec being incorrect object
  • Fixed invalid RBAC kustomization
  • Fixed RBAC role for operator
  • Fixed service creation for leader and follower

# v0.9.0

November 13, 2021

πŸŽ‰ Features

  • Added RBAC policies for redis operator with least privileges

🐞 Bug Fixes

  • Fix and updated documentation dependencies
  • Test pointers before dereferencing
  • Fix panic error of golang for redis exporter
  • Fix resource block nil exception for redis exporter

# v0.8.0

September 3, 2021

πŸŽ‰ Features

  • Added external configuration capability for follower and leader
  • Streamlined examples folder with different examples for standalone and cluster
  • Added the capability for affinity for leader and follower

🐞 Bug Fixes

  • Fix bug for non-defined storage
  • Fixed secret nil exception bug
  • Fixed bug for making redis exporter optional

# v0.7.0

August 12, 2021

πŸŽ‰ Features

  • Remove all the vulnerable dependencies from docs(NodeJS)
  • Added a new grafana dashboard for better monitoring visualization
  • Added environment variable support for redis exporter
  • Added Image Pull Secret support for private registeries

🐞 Bug Fixes

  • Fix bug for non-defined storage
  • Fixed secret nil exception bug
  • Fixed bug for making redis exporter optional

# v0.6.0

June 12, 2021

πŸŽ‰ Features

  • Breaked the CRDs into Redis standalone cluster setup
  • Optimized code configuration for creating Redis cluster
  • Removed string secret type and secret type password is only supported
  • Structured and optimized golang based codebase
  • Removed divisive terminlogies

🐞 Bug Fixes

  • Fixed logic for service and statefulset comparison in K8s
  • Removed the monitor label to resolve service endpoint issue

# v0.5.0

May 1, 2021

πŸŽ‰ Features

  • Added support for recovering redis nodes from failover
  • Added toleration support for redis statefuls
  • Added capability to use existing secret created inside K8s

🐞 Bug Fixes

  • Fixed logic for service and statefulset comparison in K8s

# v0.4.0

February 6, 2021

πŸŽ‰ Features

  • Add Nodeport support for Kubernetes service

🐞 Bug Fixes

  • Updated helm chart with latest CRD configuration
  • Optimized helm chart
  • RBAC issus fixed

# v0.3.0

Decemeber 30, 2020

πŸŽ‰ Features

  • Upgraded operator-sdk version to v1.0.3
  • Added capability to watch multiple namespaces
  • Added CI workflow pipeline for golang

🐞 Bug Fixes

  • Password updation bug https://github.com/OT-CONTAINER-KIT/redis-operator/issues/21
  • POD recovery, Can't Sync pods IP to nodes.conf https://github.com/OT-CONTAINER-KIT/redis-operator/issues/20
  • Directory creation (permission issue) https://github.com/OT-CONTAINER-KIT/redis-operator/issues/19

# v0.2.0

July 1, 2020

πŸŽ‰ Features

  • Added documentation site for better management
  • Added YAML validation for redis resource
  • Added resources in redis exporter
  • Structured complete YAML manifests
  • Added service type for redis service
  • Updated helm chart with better practices

🐞 Bug Fixes

  • Fixed redis cluster failover bug

# v0.1.0

February 21, 2020

πŸŽ‰ Features

  • Cluster/Standalone redis setup
  • Password and password-less setup
  • Node selector and affinity
  • SecurityContext
  • Priority Class
  • Monitoring support
  • PVC and resources support
- - - diff --git a/guide/development.html b/guide/development.html deleted file mode 100644 index fee075fa49..0000000000 --- a/guide/development.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - Development Guide | Redis Operator - - - - - - - - - - - -

# Development Guide

# Pre-requisites

Access to Kubernetes cluster

First of all, you will need access to a Kubernetes cluster. The easiest way to start is minikube.

Tools to build an Operator

Apart from kubernetes cluster, there are some tools which are needed to build and test the redis operator.

# Build

Build Locally

To achieve this, execute this command:-

$ make manager
-...
-/go/src/redis-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
-go fmt ./...
-go vet ./...
-go build -o bin/manager main.go
-

Build Image

Redis operator gets packaged as a container image for running on the Kubernetes cluster. These instructions will guide you to build an image.

$ make docker-build
-

# Testing

If you want to play it on Kubernetes. You can use a minikube.

$ minikube start --vm-driver virtualbox
-...
-πŸ˜„  minikube v1.0.1 on linux (amd64)
-🀹  Downloading Kubernetes v1.14.1 images in the background ...
-πŸ”₯  Creating kvm2 VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
-πŸ“Ά  "minikube" IP address is 192.168.39.240
-🐳  Configuring Docker as the container runtime ...
-🐳  Version of container runtime is 18.06.3-ce
-βŒ›  Waiting for image downloads to complete ...
-✨  Preparing Kubernetes environment ...
-🚜  Pulling images required by Kubernetes v1.14.1 ...
-πŸš€  Launching Kubernetes v1.14.1 using kubeadm ... 
-βŒ›  Waiting for pods: apiserver proxy etcd scheduler controller dns
-πŸ”‘  Configuring cluster permissions ...
-πŸ€”  Verifying component health .....
-πŸ’—  kubectl is now configured to use "minikube"
-πŸ„  Done! Thank you for using minikube!
-

Running Test Cases

$ make test
-
- - - diff --git a/guide/exposing-redis.html b/guide/exposing-redis.html deleted file mode 100644 index 014b13aeed..0000000000 --- a/guide/exposing-redis.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - Exposing Redis | Redis Operator - - - - - - - - - - - -

# Exposing Redis

By default, the nature of Redis standalone/cluster setup is private and limited to the Kubernetes cluster only. But we do have a provision to expose it using the Kubernetes "Service" object. -If we can expose the service by doing some configuration inside the helm values for redis standalone and cluster setup. This will create another service in parallel to the internal redis service to expose redis.

The service can be exposed with these service types:-

  • NodePort: Exposes the Service on each Node's IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created. You'll be able to contact the NodePort Service, from outside the cluster, by requesting <NodeIP>:<NodePort>.
  • LoadBalancer: Exposes the Service externally using a cloud provider's load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.

# Exposing Service

Customize or create the values file with the following content. The externalService configuration is a common method of exposing service for redis standalone and cluster setup.

externalService:
-  enabled: true
-  annotations:
-    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
-  serviceType: LoadBalancer
-  port: 6379
-

Once the values file is customized or created we can apply or upgrade the redis setup. We need to pass the created file as an argument to the helm command.

# redis standalone
-$ helm upgrade redis ot-helm/redis -f custom-values.yaml \
-    --install --namespace ot-operators
-
-# redis cluster
-$ helm upgrade redis-cluster ot-helm/redis-cluster -f custom-values.yaml \
-  --set redisCluster.clusterSize=3 --install --namespace ot-operators
-

If helm command is completed successfully, we can verify the external service by kubectl command. As we can see in the output, there is an IP in the "EXTERNAL-IP" coloumn.

$ kubectl get svc -n ot-operators
-...
-NAME                            TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                         AGE
-redis-external-service          LoadBalancer   10.103.9.171   164.52.207.101   6379:32247/TCP,9121:30708/TCP   4d20h
-
- - - diff --git a/guide/failover.html b/guide/failover.html deleted file mode 100644 index 348a68a994..0000000000 --- a/guide/failover.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - Failover Testing | Redis Operator - - - - - - - - - - - -

# Failover Testing

Before failover testing, we have to write some dummy data inside the Redis cluster, we can write the dummy data using the redis-cli.

$ kubectl exec -it redis-leader-0 -n ot-operators \
-    -- redis-cli -a Opstree@1234 -c set tony stark
-...
-Defaulting container name to redis-leader.
-Use 'kubectl describe pod/redis-leader-0 -n ot-operatorsr' to see all of the containers in this pod.
-Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
-OK
-

Verify the key has been inserted properly by fetching its value.

$ kubectl exec -it redis-leader-0 -n ot-operators \
-    -- redis-cli -a Opstree@1234 -c get tony
-...
-Use 'kubectl describe pod/redis-leader-0 -n ot-operators' to see all of the containers in this pod.
-Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
-"stark"
-

Let’s restart the pod name redis-leader-0 and see the redis node behavior.

$ kubectl delete pod redis-leader-0 -n ot-operators
-...
-pod "redis-leader-0" deleted
-

Now we can again try to list redis cluster nodes from redis-leader-0 pod and from some other pod as well like:- redis-follower-2

$ kubectl exec -it redis-leader-0 -n ot-operators \
-    -- redis-cli -a Opstree@1234 cluster nodes
-...
-Defaulting container name to redis-leader.
-Use 'kubectl describe pod/redis-leader-0 -n ot-operators' to see all of the containers in this pod.
-Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
-eef84b7dada737051c32d592bd66652b9af0cb35 10.42.2.184:6379@16379 slave 0a36dc5064b0a61afa8bd850e93ff0a1c2267704 0 1619958171517 3 connected
-a7c424b5ec0e696aa7be15a691846c8820e48cd1 10.42.1.181:6379@16379 master - 0 1619958172520 4 connected 0-5460
-118dbe4f49fa224b7d48fbe71990d054c7e9e853 10.42.0.228:6379@16379 slave 85747fe5cabf96e00fd0365737996a93e05cf947 0 1619958173523 2 connected
-50c3f58a1e2911a68b614f6a1a766cc4a7063e95 10.42.0.229:6379@16379 myself,slave a7c424b5ec0e696aa7be15a691846c8820e48cd1 0 1619958172000 4 connected
-0a36dc5064b0a61afa8bd850e93ff0a1c2267704 10.42.1.183:6379@16379 master - 0 1619958173000 3 connected 10923-16383
-85747fe5cabf96e00fd0365737996a93e05cf947 10.42.2.182:6379@16379 master - 0 1619958173523 2 connected 5461-10922
-

So if you notice the output of cluster nodes command, the node IP is updated and it’s connected as a leader.

Let's try to get value of key from some other pods

$ kubectl exec -it redis-follower-1 -n ot-operators \
-    -- redis-cli -a Opstree@1234 -c get tony
-...
-Defaulting container name to redis-follower.
-Use 'kubectl describe pod/redis-follower-1 -n ot-operators' to see all of the containers in this pod.
-Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
-"stark"
-
- - - diff --git a/guide/grafana.html b/guide/grafana.html deleted file mode 100644 index b0bc6de427..0000000000 --- a/guide/grafana.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - Grafana Dashboard | Redis Operator - - - - - - - - - - - - - - - diff --git a/guide/index.html b/guide/index.html deleted file mode 100644 index c02dfd1c20..0000000000 --- a/guide/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - Introduction | Redis Operator - - - - - - - - - - - -

# Introduction

A Golang based redis operator that will make/oversee Redis standalone/cluster mode setup on top of the Kubernetes. It can create a redis cluster setup with best practices on Cloud as well as the Bare-metal environment. Also, it provides an in-built monitoring capability using redis-exporter.

Documentation is available here:- https://ot-container-kit.github.io/redis-operator/

The type of Redis setup which is currently supported:-

  • Redis Cluster (in-built leader follower with sharding and replication mode)
  • Redis standalone setup

# Supported Features

Here the features which are supported by this operator:-

  • Redis cluster(leader-follower in sharding and replication mode) and standalone setup
  • Inbuilt monitoring support using the Redis Exporter to give detailed insights
  • Dynamic storage provisioning using the PVC template
  • Performance tuned best practices in redis configuration
  • Password and password-less support for cluster and standalone setup
  • A few Kubernetes based object supported like:- -
    • NodeSelector
    • Affinity
    • Resource and Limits
    • Tolerations
    • SecurityContext
    • Storage
    • ServiceAccount

# Architecture

- - - diff --git a/guide/installation.html b/guide/installation.html deleted file mode 100644 index dd786c6402..0000000000 --- a/guide/installation.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Installation | Redis Operator - - - - - - - - - - - -

# Installation

We have developed our in-house CRD(Custom Resource Definition) to deploy and manage Redis in standalone/cluster mode. So CRD is an amazing feature of Kubernetes which allows us to create our own resources and APIs in Kubernetes. We are not going in the depth of the CRD but soon we will write a blog on CRD as well. Till that time you guys can read about CRD from the official documentation (opens new window).

The API name which we have created is redis.redis.opstreelabs.in/v1beta1 and this operator is also published under the OperatorHub catalog.

https://operatorhub.io/operator/redis-operator (opens new window)

So for deploying the redis-operator and setup we need a Kubernetes cluster 1.11+ and that’s it. Let’s deploy the redis operator first.

The easiest way to install a redis operator is using Helm chart. The operator helm chart is developed on the helm=>3.0.0 version. Also, you can customize the values.yaml (opens new window) file as per the need.

$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
-$ helm upgrade redis-operator ot-helm/redis-operator \
-    --install --namespace ot-operators
-...
-Release "redis-operator" does not exist. Installing it now.
-NAME: redis-operator
-LAST DEPLOYED: Sun May  2 14:42:23 2021
-NAMESPACE: ot-operators
-STATUS: deployed
-REVISION: 1
-TEST SUITE: None
-

Check the state of the pod is running or not.

$ kubectl get pods -n ot-operators
-...
-NAME                              READY   STATUS    RESTARTS   AGE
-redis-operator-74b6cbf5c5-td8t7   1/1     Running   0          2m11s
-

If you are beginner to Kubernetes and don't want to go inside the complexities of helm, in that case, you can use kubectl to install the operator.

$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/redis-operator/master/config/crd/bases/redis.redis.opstreelabs.in_redis.yaml
-$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/redis-operator/master/config/crd/bases/redis.redis.opstreelabs.in_redisclusters.yaml
-$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/redis-operator/master/config/manager/manager.yaml
-$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/redis-operator/master/config/rbac/serviceaccount.yaml
-$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/redis-operator/master/config/rbac/role.yaml
-$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/redis-operator/master/config/rbac/role_binding.yaml
-
- - - diff --git a/guide/monitoring.html b/guide/monitoring.html deleted file mode 100644 index 8bd4ebe2e3..0000000000 --- a/guide/monitoring.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - Prometheus Monitoring | Redis Operator - - - - - - - - - - - -

# Prometheus Monitoring

The redis-operator uses redis-exporter (opens new window) to expose metrics of redis setup in Prometheus format. This exporter captures metrics for both redis standalone and cluster setup.

If we are using helm chart for the installation of redis setup, we can simply enable the redis exporter by creating a custom values file for helm chart. The content of the values file will look like this:-

redisExporter:
-  enabled: true
-  image: quay.io/opstree/redis-exporter:1.0
-  imagePullPolicy: Always
-  resources:
-    requests:
-      cpu: 100m
-      memory: 128Mi
-    limits:
-      cpu: 100m
-      memory: 128Mi
-  env:
-  - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS
-    value: "true"
-  - name: UI_PROPERTIES_FILE_NAME
-    valueFrom:
-      configMapKeyRef:
-        name: game-demo
-        key: ui_properties_file_name
-  - name: SECRET_USERNAME
-    valueFrom:
-      secretKeyRef:
-        name: mysecret
-        key: username
-

When we have defined the redis-exporter related config in values file, we can apply or upgrade the redis setup. We need to pass the created file as an argument to the helm command.

# redis standalone
-$ helm upgrade redis ot-helm/redis -f custom-values.yaml \
-  --install --namespace ot-operators
-
-# redis cluster
-$ helm upgrade redis-cluster ot-helm/redis-cluster -f custom-values.yaml \
-  --set redisCluster.clusterSize=3 --install --namespace ot-operators
-

# ServiceMonitor

Once the exporter is configured, we may have to update Prometheus to monitor this endpoint. For Prometheus Operator (opens new window), we have to create a CRD based object called ServiceMonitor. We can apply the CRD definition as well using the helm command.

serviceMonitor:
-  enabled: false
-  interval: 30s
-  scrapeTimeout: 10s
-  namespace: monitoring
-
# redis standalone
-$ helm upgrade redis ot-helm/redis -f custom-values.yaml \
-  --install --namespace ot-operators
-
-# redis cluster
-$ helm upgrade redis-cluster ot-helm/redis-cluster -f custom-values.yaml \
-  --set redisCluster.clusterSize=3 --install --namespace ot-operators
-

For kubectl related configuration, we may have to create ServiceMonitor definition in a yaml file and apply it using kubectl command.

Redis Cluster

---
-apiVersion: monitoring.coreos.com/v1
-kind: ServiceMonitor
-metadata:
-  name: redis-monitoring-cluster
-  labels:
-    redis-operator: "true"
-    env: production
-spec:
-  selector:
-    matchLabels:
-      redis_setup_type: cluster
-  endpoints:
-  - port: redis-exporter
-    interval: 30s
-    scrapeTimeout: 10s
-  namespaceSelector:
-    matchNames:
-    - monitoring
-

Redis Standalone

---
-apiVersion: monitoring.coreos.com/v1
-kind: ServiceMonitor
-metadata:
-  name: redis-monitoring-standalone
-  labels:
-    redis-operator: "true"
-    env: production
-spec:
-  selector:
-    matchLabels:
-      redis_setup_type: standalone
-  endpoints:
-  - port: redis-exporter
-    interval: 30s
-    scrapeTimeout: 10s
-  namespaceSelector:
-    matchNames:
-    - monitoring
-
- - - diff --git a/guide/redis-cluster-config.html b/guide/redis-cluster-config.html deleted file mode 100644 index e3284c7ab2..0000000000 --- a/guide/redis-cluster-config.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - Redis Cluster | Redis Operator - - - - - - - - - - - -

# Redis Cluster

The redis setup cluster mode can be customized using custom configuration. If redis setup is done by Helm, in that case values.yaml can be updated.

But if the setup is not done via Helm, in that scenario we may have to customize the CRD parameters.

In this configuration section, we have these configuration parameters:-

# Helm Parameters

Name Default Value Description
imagePullSecrets [] List of image pull secrets, in case redis image is getting pull from private registry
redisCluster.clusterSize 3 Size of the redis cluster leader and follower nodes
redisCluster.clusterVersion v7 Major version of Redis setup, values can be v6 or v7
redisCluster.persistenceEnabled true Persistence should be enabled or not in the Redis cluster setup
redisCluster.secretName redis-secret Name of the existing secret in Kubernetes
redisCluster.secretKey password Name of the existing secret key in Kubernetes
redisCluster.image quay.io/opstree/redis Name of the redis image
redisCluster.tag v6.2 Tag of the redis image
redisCluster.imagePullPolicy IfNotPresent Image Pull Policy of the redis image
redisCluster.leader.affinity {} Affinity for node and pods for redis leader statefulset
redisCluster.follower.affinity {} Affinity for node and pods for redis follower statefulset
externalService.enabled false If redis service needs to be exposed using LoadBalancer or NodePort
externalService.annotations {} Kubernetes service related annotations
externalService.serviceType NodePort Kubernetes service type for exposing service, values - ClusterIP, NodePort, and LoadBalancer
externalService.port 6379 Port number on which redis external service should be exposed
serviceMonitor.enabled false Servicemonitor to monitor redis with Prometheus
serviceMonitor.interval 30s Interval at which metrics should be scraped.
serviceMonitor.scrapeTimeout 10s Timeout after which the scrape is ended
serviceMonitor.namespace monitoring Namespace in which Prometheus operator is running
redisExporter.enabled true Redis exporter should be deployed or not
redisExporter.image quay.io/opstree/redis-exporter Name of the redis exporter image
redisExporter.tag v6.2 Tag of the redis exporter image
redisExporter.imagePullPolicy IfNotPresent Image Pull Policy of the redis exporter image
redisExporter.env [] Extra environment variables which needs to be added in redis exporter
nodeSelector {} NodeSelector for redis statefulset
priorityClassName "" Priority class name for the redis statefulset
storageSpec {} Storage configuration for redis setup
securityContext {} Security Context for redis pods for changing system or kernel level parameters
tolerations [] Tolerations for redis statefulset
sidecars [] Sidecar for redis pods

# CRD Parameters

These are the CRD Parameters which is currently supported by Redis Exporter for standalone CRD.

clusterSize

clusterSize is size of the Redis leader and follower nodes.

spec:
-  clusterSize: 3
-

clusterVersion

clusterVersion is a paramter through which we can control Redis major values. The possible values are:-

  • v6
  • v7
spec:
-  clusterVersion: v7
-

persistenceEnabled

persistenceEnabled is a configuration parameter to enable the persistence storage in redis cluster. The possible values are:-

  • true
  • false
spec:
-  persistenceEnabled: true
-

redisLeader

redisLeader is the field for Redis leader related configurations.

spec:
-  redisLeader:
-    redisConfig:
-      additionalRedisConfig: redis-external-config
-    affinity:
-      nodeAffinity:
-        requiredDuringSchedulingIgnoredDuringExecution:
-          nodeSelectorTerms:
-          - matchExpressions:
-            - key: disktype
-              operator: In
-              values:
-              - ssd
-

redisFollower

redisFollower is the field for Redis follower related configurations.

spec:
-  redisFollower:
-    redisConfig:
-      additionalRedisConfig: redis-external-config
-    affinity:
-      nodeAffinity:
-        requiredDuringSchedulingIgnoredDuringExecution:
-          nodeSelectorTerms:
-          - matchExpressions:
-            - key: disktype
-              operator: In
-              values:
-              - ssd
-

kubernetesConfig

In the kubernetesConfig section, we define configuration related to Kubernetes.

spec:
-  kubernetesConfig:
-    image: quay.io/opstree/redis:v6.2
-    imagePullPolicy: IfNotPresent
-    resources:
-      requests:
-        cpu: 101m
-        memory: 128Mi
-      limits:
-        cpu: 101m
-        memory: 128Mi
-    redisSecret:
-      name: redis-secret
-      key: password
-    imagePullSecrets:
-      - name: regcred
-

redisExporter

redisExporter configuration which enable the metrics for Redis Database to get monitored by Prometheus.

spec:
-  redisExporter:
-    enabled: true
-    image: quay.io/opstree/redis-exporter:1.0
-    imagePullPolicy: Always
-    resources:
-      requests:
-        cpu: 100m
-        memory: 128Mi
-      limits:
-        cpu: 100m
-        memory: 128Mi
-    env:
-    - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS
-      value: "true"
-    - name: UI_PROPERTIES_FILE_NAME
-      valueFrom:
-        configMapKeyRef:
-          name: game-demo
-          key: ui_properties_file_name
-    - name: SECRET_USERNAME
-      valueFrom:
-        secretKeyRef:
-          name: mysecret
-          key: username
-

storage

storage configuration for Redis Statefulset pods.

spec:
-  storage:
-    volumeClaimTemplate:
-      spec:
-        storageClassName: standard
-        accessModes: ["ReadWriteOnce"]
-        resources:
-          requests:
-            storage: 1Gi
-

priorityClassName

Name of the Kubernetes priority class which you want to associate with redis setup.

spec:
-  priorityClassName: priority-100
-

nodeSelector

Map of the labels which you want to use as nodeSelector.

spec:
-  nodeSelector:
-    kubernetes.io/hostname: minikube
-

securityContext

Kubernetes security context for redis pods.

spec:
-  securityContext:
-    runAsUser: 1000
-    fsGroup: 1000
-

tolerations

Tolerations for nodes and pods in Kubernetes.

spec:
-  tolerations:
-  - key: "key1"
-    operator: "Equal"
-    value: "value1"
-    effect: "NoSchedule"
-

sidecars

Sidecars for redis pods

spec:
-  sidecars:
-  - name: "sidecar1"
-    image: "image:1.0"
-    imagePullPolicy: Always
-    resources:
-      limits:
-        cpu: 50m
-        memory: 64Mi
-      requests:
-        cpu: 10m
-        memory: 32M
-    env:
-    - name: VAR_NAME
-      value: "value1"
-

pdb

PodDisruptionBugets for redis cluster pods

spec:
-  pdb:
-    enabled: true
-    maxUnavailable: 1
-    minAvailable: 1
-

probes

Probes for redis leader and follower pods

#  redisFollower:
-#  redisLeader:
-spec:
-    readinessProbe:
-      failureThreshold: 5
-      initialDelaySeconds: 15
-      periodSeconds: 15
-      successThreshold: 1
-      timeoutSeconds: 5
-    livenessProbe:
-      failureThreshold: 5
-      initialDelaySeconds: 15
-      periodSeconds: 15
-      successThreshold: 1
-      timeoutSeconds: 5
-

TLS

TLS configuration for redis cluster

spec:
-  TLS:
-    ca: ca.key
-    cert: tls.crt
-    key: tls.key
-    secret:
-      secretName: sample-cert
-
- - - diff --git a/guide/redis-config.html b/guide/redis-config.html deleted file mode 100644 index 14bb25a78f..0000000000 --- a/guide/redis-config.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - Redis Standalone | Redis Operator - - - - - - - - - - - -

# Redis Standalone

The redis setup in standalone mode can be customized using custom configuration. If redis setup is done by Helm, in that case values.yaml can be updated.

But if the setup is not done via Helm, in that scenario we may have to customize the CRD parameters.

In this configuration section, we have these configuration parameters:-

# Helm Parameters

Name Value Description
imagePullSecrets [] List of image pull secrets, in case redis image is getting pull from private registry
redisStandalone.secretName redis-secret Name of the existing secret in Kubernetes
redisStandalone.secretKey password Name of the existing secret key in Kubernetes
redisStandalone.image quay.io/opstree/redis Name of the redis image
redisStandalone.tag v6.2 Tag of the redis image
redisStandalone.imagePullPolicy IfNotPresent Image Pull Policy of the redis image
redisStandalone.resources {} Request and limits for redis statefulset
externalService.enabled false If redis service needs to be exposed using LoadBalancer or NodePort
externalService.annotations {} Kubernetes service related annotations
externalService.serviceType NodePort Kubernetes service type for exposing service, values - ClusterIP, NodePort, and LoadBalancer
externalService.port 6379 Port number on which redis external service should be exposed
serviceMonitor.enabled false Servicemonitor to monitor redis with Prometheus
serviceMonitor.interval 30s Interval at which metrics should be scraped.
serviceMonitor.scrapeTimeout 10s Timeout after which the scrape is ended
serviceMonitor.namespace monitoring Namespace in which Prometheus operator is running
redisExporter.enabled true Redis exporter should be deployed or not
redisExporter.image quay.io/opstree/redis-exporter Name of the redis exporter image
redisExporter.tag v6.2 Tag of the redis exporter image
redisExporter.imagePullPolicy IfNotPresent Image Pull Policy of the redis exporter image
redisExporter.env [] Extra environment variables which needs to be added in redis exporter
nodeSelector {} NodeSelector for redis statefulset
priorityClassName "" Priority class name for the redis statefulset
storageSpec {} Storage configuration for redis setup
securityContext {} Security Context for redis pods for changing system or kernel level parameters
affinity {} Affinity for node and pod for redis statefulset
tolerations [] Tolerations for redis statefulset
sidecars [] Sidecar for redis pods

# CRD Parameters

These are the CRD Parameters which is currently supported by Redis Exporter for standalone CRD.

kubernetesConfig

In the kubernetesConfig section, we define configuration related to Kubernetes.

spec:
-  kubernetesConfig:
-    image: quay.io/opstree/redis:v6.2
-    imagePullPolicy: IfNotPresent
-    resources:
-      requests:
-        cpu: 101m
-        memory: 128Mi
-      limits:
-        cpu: 101m
-        memory: 128Mi
-    redisSecret:
-      name: redis-secret
-      key: password
-    imagePullSecrets:
-      - name: regcred
-

redisExporter

redisExporter configuration which enable the metrics for Redis Database to get monitored by Prometheus.

spec:
-  redisExporter:
-    enabled: true
-    image: quay.io/opstree/redis-exporter:1.0
-    imagePullPolicy: Always
-    resources:
-      requests:
-        cpu: 100m
-        memory: 128Mi
-      limits:
-        cpu: 100m
-        memory: 128Mi
-    env:
-    - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS
-      value: "true"
-    - name: UI_PROPERTIES_FILE_NAME
-      valueFrom:
-        configMapKeyRef:
-          name: game-demo
-          key: ui_properties_file_name
-    - name: SECRET_USERNAME
-      valueFrom:
-        secretKeyRef:
-          name: mysecret
-          key: username
-

storage

storage configuration for Redis Statefulset pods.

spec:
-  storage:
-    volumeClaimTemplate:
-      spec:
-        storageClassName: standard
-        accessModes: ["ReadWriteOnce"]
-        resources:
-          requests:
-            storage: 1Gi
-

priorityClassName

Name of the Kubernetes priority class which you want to associate with redis setup.

spec:
-  priorityClassName: priority-100
-

nodeSelector

Map of the labels which you want to use as nodeSelector.

spec:
-  nodeSelector:
-    kubernetes.io/hostname: minikube
-

securityContext

Kubernetes security context for redis pods.

spec:
-  securityContext:
-    runAsUser: 1000
-

affinity

Affinity for node and pod for redis setup.

spec:
-  affinity:
-    nodeAffinity:
-      requiredDuringSchedulingIgnoredDuringExecution:
-        nodeSelectorTerms:
-        - matchExpressions:
-          - key: disktype
-            operator: In
-            values:
-            - ssd
-

tolerations

Tolerations for nodes and pods in Kubernetes.

spec:
-  tolerations:
-  - key: "key1"
-    operator: "Equal"
-    value: "value1"
-    effect: "NoSchedule"
-

sidecars

Sidecars for redis pods

spec:
-  sidecars:
-  - name: "sidecar1"
-    image: "image:1.0"
-    imagePullPolicy: Always
-    resources:
-      limits:
-        cpu: 50m
-        memory: 64Mi
-      requests:
-        cpu: 10m
-        memory: 32M
-    env:
-    - name: VAR_NAME
-      value: "value1"
-

pdb

PodDisruptionBugets for redis standalone pods

spec:
-  pdb:
-    enabled: true
-    maxUnavailable: 1
-    minAvailable: 1
-

probes

Probes for redis standalone pods

spec:
-    readinessProbe:
-      failureThreshold: 5
-      initialDelaySeconds: 15
-      periodSeconds: 15
-      successThreshold: 1
-      timeoutSeconds: 5
-    livenessProbe:
-      failureThreshold: 5
-      initialDelaySeconds: 15
-      periodSeconds: 15
-      successThreshold: 1
-      timeoutSeconds: 5
-

TLS

TLS configuration for redis standalone

spec:
-  TLS:
-    ca: ca.key
-    cert: tls.crt
-    key: tls.key
-    secret:
-      secretName: sample-cert
-
- - - diff --git a/guide/redis.html b/guide/redis.html deleted file mode 100644 index dd9b45d4f0..0000000000 --- a/guide/redis.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Redis Overview | Redis Operator - - - - - - - - - - - -

# Redis Overview

Redis is a popular and opensource in-memory database that supports multiple data structures like strings, hashes, lists, and sets. But similar to other tools, we can scale standalone redis to a particular extent and not beyond that. That’s why we have a cluster mode setup in which we can scale Redis nodes horizontally and then distribute data among those nodes.

# Redis as a Database

Sometimes getting data from disks can be time-consuming. In order to increase the performance, we can put the requests those either need to be served first or rapidly in Redis memory and then the Redis service there will keep rest of the data in the main database. So the whole architecture will look like this:-

# Redis Leader-Follower Replication

Beginning with the explanation about Redis Leader-Follower. In this phenomenon, Redis can replicate data to any number of nodes. ie. it lets the follower have the exact copy of their leader. This helps in performance optimizations.

# Redis Cluster

A Redis cluster is simply a data sharding strategy (opens new window). It automatically partitions data across multiple Redis nodes. It is an advanced feature of Redis which achieves distributed storage and prevents a single point of failure.

# Replication vs Sharding

Replication is also known as mirroring of data. In replication, all the data get copied from the leader node to the follower node. -Sharding is also known as partitioning. It splits up the data by the key to multiple nodes.

As shown in the above figure, all keys 1, 2, 3, 4 are getting stored on both machine A and B.

In sharding, the keys are getting distributed across both machine A and B. That is, the machine A will hold the 1, 3 key and machine B will hold 2, 4 key.

# Challenges with Kubernetes

Kubernetes has made the deployment of stateful application quite easy by StatefulSets. By using StatefulSets, we can easily deploy and scale any kind of stateful applications like Kafka, Zookeeper, etc. -But in the case of redis, the setup is not straightforward, there are some additional things which needs to be taken care:-

  • We have to use the headless service of Redis because it’s a TCP based service and normal service is HTTP(Layer 7) based Loadbalancer. So in case of headless service, no ClusterIP will be used and we have to rely on Pod IP.
  • Redis doesn’t use DNS to form clusters instead of that it uses IP. So we cannot use the internal DNS name of headless service, instead of that, we have to use Pod IP to form a Redis cluster.
  • In Kubernetes, Pod IP is dynamic and it can change after the pod restart, so in case of the restart the cluster will be malformed and the restarted pod will act as a lost node.
- - - diff --git a/guide/release.html b/guide/release.html deleted file mode 100644 index 7e97b08821..0000000000 --- a/guide/release.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - Release Management | Redis Operator - - - - - - - - - - - -

# Release Management

Redis operator will have a release cycle from 26th January 2022. Here are few key pointers for release management of redis-operator.

  • Release will follow the semantic versioning.
  • Major release will happen at every quarter.
  • Minor release will happen every month.
  • For security issues and potential bugs, adhoc releases can be made.
- - - diff --git a/guide/setup.html b/guide/setup.html deleted file mode 100644 index e86835ed46..0000000000 --- a/guide/setup.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - Redis Setup | Redis Operator - - - - - - - - - - - -

# Redis Setup

This redis operator supports below deployment strategies for redis:-

  • Redis cluster setup (in-built leader follower with sharding and replication mode)
  • Redis standalone setup

Here we will see how we can leverage these strategies.

If we want to use password based authentication inside Redis, we need to create a secret for it. By default the name of the secret is redis-secret and key name is password, but it can be overidden in helm charts.

$ kubectl create secret generic redis-secret \ 
-    --from-literal=password=password -n ot-operators
-

# Redis Standalone

In redis standalone mode, we deploy redis as a single Stateful pod which means ease of setup, no complexity, no high availability, and no resilience.

$ helm upgrade redis ot-helm/redis --install --namespace ot-operators
-...
-Release "redis" does not exist. Installing it now.
-NAME: redis
-LAST DEPLOYED: Sun May  2 15:59:48 2021
-NAMESPACE: ot-operators
-STATUS: deployed
-REVISION: 1
-TEST SUITE: None
-

Verify the standalone redis setup by kubectl command line.

$ kubectl get pods -n ot-operators
-...
-NAME                              READY   STATUS    RESTARTS   AGE
-redis-operator-74b6cbf5c5-td8t7   1/1     Running   0          81m
-redis-standalone-0                2/2     Running   0          56s
-

# Redis Cluster

A Redis cluster is simply a data sharding strategy (opens new window). It automatically partitions data across multiple Redis nodes. It is an advanced feature of Redis which achieves distributed storage and prevents a single point of failure.

For redis cluster setup we can use same helm command but with different parameters.

$ helm upgrade redis-cluster ot-helm/redis-cluster \
-  --set redisCluster.clusterSize=3 --install --namespace ot-operators
-...
-Release "redis-cluster" does not exist. Installing it now.
-NAME: redis-cluster
-LAST DEPLOYED: Sun May  2 16:11:38 2021
-NAMESPACE: ot-operators
-STATUS: deployed
-REVISION: 1
-TEST SUITE: None
-

Verify the cluster by checking the pod status of leader and follower pods.

$ kubectl get pods -n ot-operators
-...
-NAME                                 READY   STATUS    RESTARTS   AGE
-redis-cluster-follower-0             1/1     Running   0          149m
-redis-cluster-follower-1             1/1     Running   0          150m
-redis-cluster-follower-2             1/1     Running   0          151m
-redis-cluster-leader-0               1/1     Running   0          149m
-redis-cluster-leader-1               1/1     Running   0          150m
-redis-cluster-leader-2               1/1     Running   0          151m
-redis-operator-5944ffd957-pt57s      1/1     Running   0          156m
-

If all the pods are in the running state of leader and follower Statefulsets, then we can check the health of the redis cluster by using redis-cli.

$ kubectl exec -it redis-leader-0 -n ot-operators -- redis-cli -a Opstree@1234 cluster nodes
-...
-Defaulting container name to redis-leader.
-Use 'kubectl describe pod/redis-leader-0 -n ot-operators' to see all of the containers in this pod.
-Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
-528438a759cee4528c3071d17d75b27b0818555d 10.42.0.219:6379@16379 myself,master - 0 1619952294000 1 connected 0-5460
-8ec7812903b7e046bec2f2a7bce4a9ccadfa4188 10.42.0.221:6379@16379 slave d0ff3892d2eba0b2707199cb5df57adbba214bcd 0 1619952297241 3 connected
-60f932272322bafbd8c3e16328d26af676aeb8d6 10.42.0.220:6379@16379 slave 6e80da4902802ebffa94cbac9b7d98e9fd74121f 0 1619952297000 2 connected
-6e80da4902802ebffa94cbac9b7d98e9fd74121f 10.42.2.178:6379@16379 master - 0 1619952297000 2 connected 5461-10922
-d0ff3892d2eba0b2707199cb5df57adbba214bcd 10.42.1.178:6379@16379 master - 0 1619952298245 3 connected 10923-16383
-c2b74bd2a360068db01dfc8f00b8d0b012e21215 10.42.1.177:6379@16379 slave 528438a759cee4528c3071d17d75b27b0818555d 0 1619952297000 1 connected
-
- - - diff --git a/index.html b/index.html index c2d6a832d2..c904f3f3fe 100644 --- a/index.html +++ b/index.html @@ -15,24 +15,24 @@ -