Skip to content

Commit 546eaf2

Browse files
authored
feat: update redis-operator cert manager configuration. (#1220)
* fix: update redis-operator chart configuration and documentation. - Removed Chart.lock file for cert-manager dependency - Updated Chart.yaml to remove explicit cert-manager dependency - Bumped chart version to 0.19.2 - Updated README.md to clarify cert-manager installation instructions - Modified values.yaml to improve cert-manager and webhook configuration documentation - Added configuration validation helper in _helpers.tpl - Introduced NOTES.txt template for helm chart installation guidance Signed-off-by: drivebyer <wuyangmuc@gmail.com> * docs Signed-off-by: drivebyer <wuyangmuc@gmail.com> --------- Signed-off-by: drivebyer <wuyangmuc@gmail.com>
1 parent 5f98c43 commit 546eaf2

File tree

7 files changed

+39
-30
lines changed

7 files changed

+39
-30
lines changed

charts/redis-operator/Chart.lock

Lines changed: 0 additions & 6 deletions
This file was deleted.

charts/redis-operator/Chart.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: v2
3-
version: 0.19.1
3+
version: 0.19.2
44
appVersion: "0.19.0"
55
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
66
engine: gotpl
@@ -19,10 +19,3 @@ keywords:
1919
- opstree
2020
- kubernetes
2121
- openshift
22-
23-
dependencies:
24-
- name: cert-manager
25-
version: v1.12.4
26-
repository: https://charts.jetstack.io
27-
alias: certmanager
28-
condition: certmanager.enabled

charts/redis-operator/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope
1616

1717
- Helm v3+
1818
- Kubernetes v1.16+
19-
- If you intend to use the cert-manager, ensure that the cert-manager CRDs are installed before deploying the redis-operator.
19+
- If you plan to use cert-manager integration (certmanager.enabled=true), cert-manager must be pre-installed in your cluster
2020

2121
## Source Code
2222

@@ -30,13 +30,10 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope
3030
helm repo add ot-helm https://ot-container-kit.github.io/helm-charts
3131
```
3232

33-
### 2. Install Cert-Manager CRDs (if using cert-manager)
33+
### 2. Install Cert-Manager (Optional)
3434

35-
If you plan to use cert-manager with the redis-operator, you need to install the cert-manager CRDs before deploying the operator.
36-
37-
```bash
38-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.4/cert-manager.crds.yaml
39-
```
35+
If you plan to use cert-manager with the redis-operator, you need to install cert-manager before deploying the operator.
36+
You can follow the [official cert-manager installation guide](https://cert-manager.io/docs/installation/).
4037

4138
### 3. Install Redis Operator
4239

@@ -91,6 +88,7 @@ kubectl create secret tls <webhook-server-cert> --key tls.key --cert tls.crt -n
9188
| affinity | object | `{}` | |
9289
| certificate.name | string | `"serving-cert"` | |
9390
| certificate.secretName | string | `"webhook-server-cert"` | |
91+
| certmanager.apiVersion | string | `"cert-manager.io/v1"` | |
9492
| certmanager.enabled | bool | `false` | |
9593
| issuer.email | string | `"shubham.gupta@opstree.com"` | |
9694
| issuer.name | string | `"redis-operator-issuer"` | |

charts/redis-operator/README.md.gotmpl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope
1616

1717
- Helm v3+
1818
- Kubernetes v1.16+
19-
- If you intend to use the cert-manager, ensure that the cert-manager CRDs are installed before deploying the redis-operator.
19+
- If you plan to use cert-manager integration (certmanager.enabled=true), cert-manager must be pre-installed in your cluster
2020

2121
## Source Code
2222

@@ -30,13 +30,10 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope
3030
helm repo add ot-helm https://ot-container-kit.github.io/helm-charts
3131
```
3232

33-
### 2. Install Cert-Manager CRDs (if using cert-manager)
33+
### 2. Install Cert-Manager (Optional)
3434

35-
If you plan to use cert-manager with the redis-operator, you need to install the cert-manager CRDs before deploying the operator.
36-
37-
```bash
38-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.4/cert-manager.crds.yaml
39-
```
35+
If you plan to use cert-manager with the redis-operator, you need to install cert-manager before deploying the operator.
36+
You can follow the [official cert-manager installation guide](https://cert-manager.io/docs/installation/).
4037

4138
### 3. Install Redis Operator
4239

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- template "redis-operator.validateConfig" . -}}
2+
3+
Thank you for installing {{ .Chart.Name }}.
4+
5+
Your release is named {{ .Release.Name }}.
6+
7+
To learn more about the release, try:
8+
9+
$ helm status {{ .Release.Name }}
10+
$ helm get all {{ .Release.Name }}

charts/redis-operator/templates/_helpers.tpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,13 @@ app.kubernetes.io/part-of: {{ .Release.Name }}
3131
{{/* Selector labels */}}
3232
{{- define "redisOperator.selectorLabels" -}}
3333
name: {{ .Values.redisOperator.name }}
34-
{{- end }}
34+
{{- end }}
35+
36+
{{/*
37+
Validate webhook and cert-manager configuration
38+
*/}}
39+
{{- define "redis-operator.validateConfig" -}}
40+
{{- if and (not .Values.redisOperator.webhook) .Values.certmanager.enabled -}}
41+
{{- fail "certmanager.enabled should not be true when webhook is disabled" -}}
42+
{{- end -}}
43+
{{- end -}}

charts/redis-operator/values.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ redisOperator:
1717
# When not specified, the operator will watch all namespaces. It can be set to a specific namespace or multiple namespaces separated by commas.
1818
watchNamespace: ""
1919
env: []
20-
# If you want to enable masterSlaveAntiAffinity, you need to set webhook to true.
20+
# If set to true, webhook server will be enabled for masterSlaveAntiAffinity feature
21+
# When enabled, you need to either:
22+
# 1. Enable cert-manager (certmanager.enabled=true) for automatic certificate management, or
23+
# 2. Manually create a certificate secret (see "How to generate private key" section in README)
2124
webhook: false
2225
automountServiceAccountToken: true
2326

@@ -58,7 +61,12 @@ issuer:
5861
ingressClass: nginx
5962

6063
certmanager:
64+
# Whether to use cert-manager for certificate management
65+
# Only effective when webhook=true
66+
# If webhook=true and certmanager.enabled=false, you need to manually create certificate secret
6167
enabled: false
68+
# API version of the cert-manager CRDs
69+
apiVersion: "cert-manager.io/v1"
6270

6371
priorityClassName: ""
6472
nodeSelector: {}

0 commit comments

Comments
 (0)