diff --git a/charts/redis-operator/Chart.lock b/charts/redis-operator/Chart.lock deleted file mode 100644 index 8da343e30..000000000 --- a/charts/redis-operator/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: cert-manager - repository: https://charts.jetstack.io - version: v1.12.4 -digest: sha256:026d03c56e2f8369b0f7d79f9560d5a33b2c5ae8a7d751213e56e2a0176cb874 -generated: "2023-10-02T14:14:45.164829041+05:30" diff --git a/charts/redis-operator/Chart.yaml b/charts/redis-operator/Chart.yaml index 65db54c66..7f94573b3 100644 --- a/charts/redis-operator/Chart.yaml +++ b/charts/redis-operator/Chart.yaml @@ -1,6 +1,6 @@ --- apiVersion: v2 -version: 0.19.1 +version: 0.19.2 appVersion: "0.19.0" description: Provides easy redis setup definitions for Kubernetes services, and deployment. engine: gotpl @@ -19,10 +19,3 @@ keywords: - opstree - kubernetes - openshift - -dependencies: - - name: cert-manager - version: v1.12.4 - repository: https://charts.jetstack.io - alias: certmanager - condition: certmanager.enabled diff --git a/charts/redis-operator/README.md b/charts/redis-operator/README.md index 23d0c0ea6..b81eb6b73 100644 --- a/charts/redis-operator/README.md +++ b/charts/redis-operator/README.md @@ -16,7 +16,7 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope - 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. +- If you plan to use cert-manager integration (certmanager.enabled=true), cert-manager must be pre-installed in your cluster ## Source Code @@ -30,13 +30,10 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope helm repo add ot-helm https://ot-container-kit.github.io/helm-charts ``` -### 2. Install Cert-Manager CRDs (if using cert-manager) +### 2. Install Cert-Manager (Optional) -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 -``` +If you plan to use cert-manager with the redis-operator, you need to install cert-manager before deploying the operator. +You can follow the [official cert-manager installation guide](https://cert-manager.io/docs/installation/). ### 3. Install Redis Operator @@ -91,6 +88,7 @@ kubectl create secret tls --key tls.key --cert tls.crt -n | affinity | object | `{}` | | | certificate.name | string | `"serving-cert"` | | | certificate.secretName | string | `"webhook-server-cert"` | | +| certmanager.apiVersion | string | `"cert-manager.io/v1"` | | | certmanager.enabled | bool | `false` | | | issuer.email | string | `"shubham.gupta@opstree.com"` | | | issuer.name | string | `"redis-operator-issuer"` | | diff --git a/charts/redis-operator/README.md.gotmpl b/charts/redis-operator/README.md.gotmpl index c8cc09315..59706f8fe 100644 --- a/charts/redis-operator/README.md.gotmpl +++ b/charts/redis-operator/README.md.gotmpl @@ -16,7 +16,7 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope - 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. +- If you plan to use cert-manager integration (certmanager.enabled=true), cert-manager must be pre-installed in your cluster ## Source Code @@ -30,13 +30,10 @@ This Helm chart deploys the redis-operator into your Kubernetes cluster. The ope helm repo add ot-helm https://ot-container-kit.github.io/helm-charts ``` -### 2. Install Cert-Manager CRDs (if using cert-manager) +### 2. Install Cert-Manager (Optional) -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 -``` +If you plan to use cert-manager with the redis-operator, you need to install cert-manager before deploying the operator. +You can follow the [official cert-manager installation guide](https://cert-manager.io/docs/installation/). ### 3. Install Redis Operator diff --git a/charts/redis-operator/templates/NOTES.txt b/charts/redis-operator/templates/NOTES.txt new file mode 100644 index 000000000..531086292 --- /dev/null +++ b/charts/redis-operator/templates/NOTES.txt @@ -0,0 +1,10 @@ +{{- template "redis-operator.validateConfig" . -}} + +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. + +To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get all {{ .Release.Name }} \ No newline at end of file diff --git a/charts/redis-operator/templates/_helpers.tpl b/charts/redis-operator/templates/_helpers.tpl index 5a70733b0..54db103c5 100644 --- a/charts/redis-operator/templates/_helpers.tpl +++ b/charts/redis-operator/templates/_helpers.tpl @@ -31,4 +31,13 @@ app.kubernetes.io/part-of: {{ .Release.Name }} {{/* Selector labels */}} {{- define "redisOperator.selectorLabels" -}} name: {{ .Values.redisOperator.name }} -{{- end }} \ No newline at end of file +{{- end }} + +{{/* +Validate webhook and cert-manager configuration +*/}} +{{- define "redis-operator.validateConfig" -}} +{{- if and (not .Values.redisOperator.webhook) .Values.certmanager.enabled -}} +{{- fail "certmanager.enabled should not be true when webhook is disabled" -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/redis-operator/values.yaml b/charts/redis-operator/values.yaml index 50a195c54..6d68b7549 100644 --- a/charts/redis-operator/values.yaml +++ b/charts/redis-operator/values.yaml @@ -17,7 +17,10 @@ redisOperator: # When not specified, the operator will watch all namespaces. It can be set to a specific namespace or multiple namespaces separated by commas. watchNamespace: "" env: [] - # If you want to enable masterSlaveAntiAffinity, you need to set webhook to true. + # If set to true, webhook server will be enabled for masterSlaveAntiAffinity feature + # When enabled, you need to either: + # 1. Enable cert-manager (certmanager.enabled=true) for automatic certificate management, or + # 2. Manually create a certificate secret (see "How to generate private key" section in README) webhook: false automountServiceAccountToken: true @@ -58,7 +61,12 @@ issuer: ingressClass: nginx certmanager: + # Whether to use cert-manager for certificate management + # Only effective when webhook=true + # If webhook=true and certmanager.enabled=false, you need to manually create certificate secret enabled: false + # API version of the cert-manager CRDs + apiVersion: "cert-manager.io/v1" priorityClassName: "" nodeSelector: {}