Skip to content

Commit

Permalink
Updated docs with latest information of v0.12.0
Browse files Browse the repository at this point in the history
Signed-off-by: iamabhishek-dubey <[email protected]>
  • Loading branch information
iamabhishek-dubey committed Oct 14, 2022
1 parent 6a0440f commit 6398f49
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 92 deletions.
1 change: 1 addition & 0 deletions docs/src/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Here the features which are supported by this operator:-
- Tolerations
- SecurityContext
- Storage
- ServiceAccount

## Architecture

Expand Down
30 changes: 30 additions & 0 deletions docs/src/guide/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
### v0.12.0
##### October 12, 2022

**:beetle: Bug Fixes**

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

**:tada: 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**

**:beetle: 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**

Expand Down
20 changes: 10 additions & 10 deletions docs/src/guide/failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,42 @@
Before failover testing, we have to write some dummy data inside the Redis cluster, we can write the dummy data using the `redis-cli`.

```shell
$ kubectl exec -it redis-leader-0 -n redis-operator \
$ 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 redis-operator' to see all of the containers in this pod.
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.

```shell
$ kubectl exec -it redis-leader-0 -n redis-operator \
$ 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 redis-operator' to see all of the containers in this pod.
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.

```shell
$ kubectl delete pod redis-leader-0 -n redis-operator
$ 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`

```shell
$ kubectl exec -it redis-leader-0 -n redis-operator \
$ 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 redis-operator' to see all of the containers in this pod.
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
Expand All @@ -50,14 +50,14 @@ a7c424b5ec0e696aa7be15a691846c8820e48cd1 10.42.1.181:6379@16379 master - 0 16199

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 pod
Let's try to get value of key from some other pods

```shell
$ kubectl exec -it redis-follower-1 -n redis-operator \
$ 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 redis-operator' to see all of the containers in this pod.
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"
```
6 changes: 3 additions & 3 deletions docs/src/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ The easiest way to install a redis operator is using Helm chart. The operator he
```shell
$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
$ helm upgrade redis-operator ot-helm/redis-operator \
--install --namespace 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: redis-operator
NAMESPACE: ot-operators
STATUS: deployed
REVISION: 1
TEST SUITE: None
Expand All @@ -27,7 +27,7 @@ TEST SUITE: None
Check the state of the pod is running or not.

```shell
$ kubectl get pods -n redis-operator
$ kubectl get pods -n ot-operators
...
NAME READY STATUS RESTARTS AGE
redis-operator-74b6cbf5c5-td8t7 1/1 Running 0 2m11s
Expand Down
113 changes: 73 additions & 40 deletions docs/src/guide/redis-cluster-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,38 @@ 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.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
| **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

Expand All @@ -53,14 +55,40 @@ These are the CRD Parameters which is currently supported by Redis Exporter for
`clusterSize` is size of the Redis leader and follower nodes.

```yaml
spec:
clusterSize: 3
```
**clusterVersion**
`clusterVersion` is a paramter through which we can control Redis major values. The possible values are:-

- v6
- v7

```yaml
spec:
clusterVersion: v7
```

**persistenceEnabled**

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

- true
- false

```yaml
spec:
persistenceEnabled: true
```

**redisLeader**

`redisLeader` is the field for Redis leader related configurations.

```yaml
spec:
redisLeader:
redisConfig:
additionalRedisConfig: redis-external-config
Expand All @@ -80,6 +108,7 @@ These are the CRD Parameters which is currently supported by Redis Exporter for
`redisFollower` is the field for Redis follower related configurations.

```yaml
spec:
redisFollower:
redisConfig:
additionalRedisConfig: redis-external-config
Expand All @@ -99,6 +128,7 @@ These are the CRD Parameters which is currently supported by Redis Exporter for
In the `kubernetesConfig` section, we define configuration related to Kubernetes.

```yaml
spec:
kubernetesConfig:
image: quay.io/opstree/redis:v6.2
imagePullPolicy: IfNotPresent
Expand All @@ -122,6 +152,7 @@ In the `kubernetesConfig` section, we define configuration related to Kubernetes
`redisExporter` configuration which enable the metrics for Redis Database to get monitored by Prometheus.

```yaml
spec:
redisExporter:
enabled: true
image: quay.io/opstree/redis-exporter:1.0
Expand Down Expand Up @@ -153,6 +184,7 @@ In the `kubernetesConfig` section, we define configuration related to Kubernetes
`storage` configuration for Redis Statefulset pods.

```yaml
spec:
storage:
volumeClaimTemplate:
spec:
Expand All @@ -168,14 +200,16 @@ In the `kubernetesConfig` section, we define configuration related to Kubernetes
Name of the Kubernetes priority class which you want to associate with redis setup.

```yaml
priorityClassName: priority-100
spec:
priorityClassName: priority-100
```

**nodeSelector**

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

```yaml
spec:
nodeSelector:
kubernetes.io/hostname: minikube
```
Expand All @@ -185,15 +219,18 @@ Map of the labels which you want to use as nodeSelector.
Kubernetes security context for redis pods.

```yaml
spec:
securityContext:
runAsUser: 1000
fsGroup: 1000
```

**tolerations**

Tolerations for nodes and pods in Kubernetes.

```yaml
spec:
tolerations:
- key: "key1"
operator: "Equal"
Expand All @@ -206,6 +243,7 @@ Tolerations for nodes and pods in Kubernetes.
Sidecars for redis pods

```yaml
spec:
sidecars:
- name: "sidecar1"
image: "image:1.0"
Expand All @@ -227,6 +265,7 @@ Sidecars for redis pods
PodDisruptionBugets for redis cluster pods

```yaml
spec:
pdb:
enabled: true
maxUnavailable: 1
Expand All @@ -240,21 +279,14 @@ Probes for redis leader and follower pods
```yaml
# redisFollower:
# redisLeader:
spec:
readinessProbe:
exec:
command:
- bash
- /usr/bin/healthcheck.sh
failureThreshold: 5
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
livenessProbe:
exec:
command:
- bash
- /usr/bin/healthcheck.sh
failureThreshold: 5
initialDelaySeconds: 15
periodSeconds: 15
Expand All @@ -267,10 +299,11 @@ Probes for redis leader and follower pods
TLS configuration for redis cluster

```yaml
spec:
TLS:
ca: ca.key
cert: tls.crt
key: tls.key
secret:
secretName: sample-cert
```
```
Loading

0 comments on commit 6398f49

Please sign in to comment.