Skip to content

Commit

Permalink
refactor(chart): provide CRDs in a subchart
Browse files Browse the repository at this point in the history
This changeset is mainly intended to skip Jaeger CRDs if it is not enabled.
It is especially relevant when Jaeger tracing is installed separately from OpenEBS Mayastor.

Helm 3 does not manage CRDs (see https://helm.sh/docs/chart_best_practices/custom_resource_definitions/).
`helm uninstall` won't remove CRDs, and `helm updgrade` won't upgrade them. Manual intervention is required
with the current setup.
 - CRDs installed from `crds` folder **are not included into the helm release**.

Additionally, it is not possible to template CRDs in Helm 3 in the `crds` folder.

Moving CRDs to a chart solves several issues: clean uninstall, possibility for upgrades, templating.

close openebs/mayastor/#1586

Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com>
  • Loading branch information
cmontemuino committed Feb 6, 2024
1 parent b2e99be commit de4761b
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ version: 0.0.0
appVersion: "0.0.0"

dependencies:
- name: crds
version: "0.0.0"
condition: crds.enabled
- name: etcd
repository: https://charts.bitnami.com/bitnami
version: 8.6.0
Expand Down
15 changes: 14 additions & 1 deletion chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,24 @@ To install the chart with the release name `my-release`:

```console
$ helm repo add openebs https://openebs.github.io/mayastor-extensions/
$ helm install my-release openebs/mayastor
$ helm install mymayastor
```

### Uninstall Helm Chart

```console
$ helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

*See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation.*

## Chart Dependencies

| Repository | Name | Version |
|------------|------|---------|
| | crds | 0.0.0 |
| https://charts.bitnami.com/bitnami | etcd | 8.6.0 |
| https://grafana.github.io/helm-charts | loki-stack | 2.9.11 |
| https://jaegertracing.github.io/helm-charts | jaeger-operator | 2.25.0 |
Expand Down Expand Up @@ -93,6 +104,8 @@ $ helm install my-release openebs/mayastor
| base.&ZeroWidthSpace;jaeger.&ZeroWidthSpace;enabled | Enable jaeger tracing | `false` |
| base.&ZeroWidthSpace;logSilenceLevel | Silence specific module components | `nil` |
| base.&ZeroWidthSpace;metrics.&ZeroWidthSpace;enabled | Enable the metrics exporter | `true` |
| crds.&ZeroWidthSpace;enabled | Install CRDs | `true` |
| crds.&ZeroWidthSpace;jaeger.&ZeroWidthSpace;enabled | Install Jaeger CRDs | `false` |
| csi.&ZeroWidthSpace;controller.&ZeroWidthSpace;logLevel | Log level for the csi controller | `"info"` |
| csi.&ZeroWidthSpace;controller.&ZeroWidthSpace;preventVolumeModeConversion | Prevent modifying the volume mode when creating a PVC from an existing VolumeSnapshot | `true` |
| csi.&ZeroWidthSpace;controller.&ZeroWidthSpace;priorityClassName | Set PriorityClass, overrides global | `""` |
Expand Down
10 changes: 10 additions & 0 deletions chart/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ $ helm repo add openebs https://openebs.github.io/mayastor-extensions/
$ helm install my-release openebs/{{ template "chart.name" . }}
```

### Uninstall Helm Chart

```console
$ helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

*See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation.*

## Chart Dependencies

{{ template "chart.requirementsTable" . }}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.jaeger.enabled -}}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -42,3 +43,4 @@ spec:
storage: true
subresources:
status: {}
{{- end -}}
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
crds:
# -- Install CRDs
enabled: true
jaeger:
# -- Install Jaeger CRDs
enabled: false

image:
# -- Image registry to pull our product images
registry: docker.io
Expand Down

0 comments on commit de4761b

Please sign in to comment.