Skip to content

Commit

Permalink
docs: generate chart README from helm-docs (#1041)
Browse files Browse the repository at this point in the history
* docs: generate chart README from helm-docs

Signed-off-by: drivebyer <[email protected]>

* update

Signed-off-by: drivebyer <[email protected]>

---------

Signed-off-by: drivebyer <[email protected]>
  • Loading branch information
drivebyer authored Aug 8, 2024
1 parent 31c5dca commit 10087be
Show file tree
Hide file tree
Showing 11 changed files with 787 additions and 196 deletions.
142 changes: 100 additions & 42 deletions charts/redis-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# Redis Cluster
# redis

Redis is a key-value based distributed database, this helm chart is for redis cluster setup. This helm chart needs [Redis Operator](../redis-operator) inside Kubernetes cluster. The redis cluster definition can be modified or changed by [values.yaml](./values.yaml).

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

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| iamabhishek-dubey | | |
| sandy724 | | |
| shubham-cmyk | | |

## Pre-Requisities

- Kubernetes 1.15+
- Helm 3.X
- Redis Operator 0.7.0

## Source Code

* <https://github.com/ot-container-kit/redis-operator>

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

Expand All @@ -22,45 +42,83 @@ For uninstalling the chart:-
helm delete <my-release> --namespace <namespace>
```

## Pre-Requisities

- Kubernetes 1.15+
- Helm 3.X
- Redis Operator 0.7.0
## Values

## 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.leaderServiceType` | ClusterIP | Kubernetes service type for Redis Leader |
| `redisCluster.followerServiceType` | ClusterIP | Kubernetes service type for Redis Follower |
| `redisCluster.name` | "" | Overwrites the name for the charts resources instead of the Release name |
| `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 |
| `sidecars` | [] | Sidecar for redis pods |
| `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 pods for redis statefulset |
| `tolerations` | [] | Tolerations for redis statefulset |
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| TLS.ca | string | `"ca.key"` | |
| TLS.cert | string | `"tls.crt"` | |
| TLS.key | string | `"tls.key"` | |
| TLS.secret.secretName | string | `""` | |
| acl.secret.secretName | string | `""` | |
| env | list | `[]` | |
| externalConfig.data | string | `"tcp-keepalive 400\nslowlog-max-len 158\nstream-node-max-bytes 2048\n"` | |
| externalConfig.enabled | bool | `false` | |
| externalService.enabled | bool | `false` | |
| externalService.port | int | `6379` | |
| externalService.serviceType | string | `"LoadBalancer"` | |
| initContainer.args | list | `[]` | |
| initContainer.command | list | `[]` | |
| initContainer.enabled | bool | `false` | |
| initContainer.env | list | `[]` | |
| initContainer.image | string | `""` | |
| initContainer.imagePullPolicy | string | `"IfNotPresent"` | |
| initContainer.resources | object | `{}` | |
| labels | object | `{}` | |
| podSecurityContext.fsGroup | int | `1000` | |
| podSecurityContext.runAsUser | int | `1000` | |
| priorityClassName | string | `""` | |
| redisCluster.clusterSize | int | `3` | |
| redisCluster.clusterVersion | string | `"v7"` | |
| redisCluster.follower.affinity | string | `nil` | |
| redisCluster.follower.nodeSelector | string | `nil` | |
| redisCluster.follower.pdb.enabled | bool | `false` | |
| redisCluster.follower.pdb.maxUnavailable | int | `1` | |
| redisCluster.follower.pdb.minAvailable | int | `1` | |
| redisCluster.follower.replicas | int | `3` | |
| redisCluster.follower.securityContext | object | `{}` | |
| redisCluster.follower.serviceType | string | `"ClusterIP"` | |
| redisCluster.follower.tolerations | list | `[]` | |
| redisCluster.image | string | `"quay.io/opstree/redis"` | |
| redisCluster.imagePullPolicy | string | `"IfNotPresent"` | |
| redisCluster.imagePullSecrets | object | `{}` | |
| redisCluster.leader.affinity | object | `{}` | |
| redisCluster.leader.nodeSelector | string | `nil` | |
| redisCluster.leader.pdb.enabled | bool | `false` | |
| redisCluster.leader.pdb.maxUnavailable | int | `1` | |
| redisCluster.leader.pdb.minAvailable | int | `1` | |
| redisCluster.leader.replicas | int | `3` | |
| redisCluster.leader.securityContext | object | `{}` | |
| redisCluster.leader.serviceType | string | `"ClusterIP"` | |
| redisCluster.leader.tolerations | list | `[]` | |
| redisCluster.minReadySeconds | int | `0` | |
| redisCluster.name | string | `""` | |
| redisCluster.persistenceEnabled | bool | `true` | |
| redisCluster.redisSecret.secretKey | string | `""` | |
| redisCluster.redisSecret.secretName | string | `""` | |
| redisCluster.resources | object | `{}` | |
| redisCluster.tag | string | `"v7.0.12"` | |
| redisExporter.enabled | bool | `false` | |
| redisExporter.env | list | `[]` | |
| redisExporter.image | string | `"quay.io/opstree/redis-exporter"` | |
| redisExporter.imagePullPolicy | string | `"IfNotPresent"` | |
| redisExporter.resources | object | `{}` | |
| redisExporter.tag | string | `"v1.44.0"` | |
| serviceAccountName | string | `""` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.interval | string | `"30s"` | |
| serviceMonitor.namespace | string | `"monitoring"` | |
| serviceMonitor.scrapeTimeout | string | `"10s"` | |
| sidecars.env | object | `{}` | |
| sidecars.image | string | `""` | |
| sidecars.imagePullPolicy | string | `"IfNotPresent"` | |
| sidecars.name | string | `""` | |
| sidecars.resources.limits.cpu | string | `"100m"` | |
| sidecars.resources.limits.memory | string | `"128Mi"` | |
| sidecars.resources.requests.cpu | string | `"50m"` | |
| sidecars.resources.requests.memory | string | `"64Mi"` | |
| storageSpec.nodeConfVolume | bool | `true` | |
| storageSpec.nodeConfVolumeClaimTemplate.spec.accessModes[0] | string | `"ReadWriteOnce"` | |
| storageSpec.nodeConfVolumeClaimTemplate.spec.resources.requests.storage | string | `"1Gi"` | |
| storageSpec.volumeClaimTemplate.spec.accessModes[0] | string | `"ReadWriteOnce"` | |
| storageSpec.volumeClaimTemplate.spec.resources.requests.storage | string | `"1Gi"` | |
45 changes: 45 additions & 0 deletions charts/redis-cluster/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# redis

Redis is a key-value based distributed database, this helm chart is for redis cluster setup. This helm chart needs [Redis Operator](../redis-operator) inside Kubernetes cluster. The redis cluster definition can be modified or changed by [values.yaml](./values.yaml).

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

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| iamabhishek-dubey | | |
| sandy724 | | |
| shubham-cmyk | | |

## Pre-Requisities

- Kubernetes 1.15+
- Helm 3.X
- Redis Operator 0.7.0

## Source Code

* <https://github.com/ot-container-kit/redis-operator>

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

helm install <my-release> ot-helm/redis-cluster \
--set redisCluster.clusterSize=3 --namespace <namespace>
```

Redis setup can be upgraded by using `helm upgrade` command:-

```shell
helm upgrade <my-release> ot-helm/redis-cluster --install \
--set redisCluster.clusterSize=5 --namespace <namespace>
```

For uninstalling the chart:-

```shell
helm delete <my-release> --namespace <namespace>
```

{{ template "chart.valuesSection" . }}
128 changes: 128 additions & 0 deletions charts/redis-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# 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

| Name | Email | Url |
| ---- | ------ | --- |
| iamabhishek-dubey | | |
| sandy724 | | |
| shubham-cmyk | | |

## Pre-Requisities

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

## Source Code

* <https://github.com/ot-container-kit/redis-operator>

## Installation Steps

### 1. Add Helm Repository

```bash
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.

```bash
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.

```bash
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.

```bash
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

```bash
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 )

```bash
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

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| certificate.name | string | `"serving-cert"` | |
| certificate.secretName | string | `"webhook-server-cert"` | |
| certmanager.enabled | bool | `false` | |
| issuer.email | string | `"[email protected]"` | |
| issuer.name | string | `"redis-operator-issuer"` | |
| issuer.privateKeySecretName | string | `"letsencrypt-prod"` | |
| issuer.server | string | `"https://acme-v02.api.letsencrypt.org/directory"` | |
| issuer.solver.enabled | bool | `true` | |
| issuer.solver.ingressClass | string | `"nginx"` | |
| issuer.type | string | `"selfSigned"` | |
| nodeSelector | object | `{}` | |
| podSecurityContext | object | `{}` | |
| priorityClassName | string | `""` | |
| rbac.enabled | bool | `true` | |
| redisOperator.automountServiceAccountToken | bool | `true` | |
| redisOperator.env | list | `[]` | |
| redisOperator.extraArgs | list | `[]` | |
| redisOperator.imageName | string | `"ghcr.io/ot-container-kit/redis-operator/redis-operator"` | |
| redisOperator.imagePullPolicy | string | `"Always"` | |
| redisOperator.imageTag | string | `""` | |
| redisOperator.name | string | `"redis-operator"` | |
| redisOperator.podAnnotations | object | `{}` | |
| redisOperator.podLabels | object | `{}` | |
| redisOperator.watchNamespace | string | `""` | |
| redisOperator.webhook | bool | `false` | |
| replicas | int | `1` | |
| resources.limits.cpu | string | `"500m"` | |
| resources.limits.memory | string | `"500Mi"` | |
| resources.requests.cpu | string | `"500m"` | |
| resources.requests.memory | string | `"500Mi"` | |
| securityContext | object | `{}` | |
| service.name | string | `"webhook-service"` | |
| service.namespace | string | `"redis-operator"` | |
| serviceAccount.automountServiceAccountToken | bool | `true` | |
| serviceAccountName | string | `"redis-operator"` | |
| tolerateAllTaints | bool | `false` | |
| tolerations | list | `[]` | |
Loading

0 comments on commit 10087be

Please sign in to comment.