Skip to content

Commit

Permalink
Add capability to skip crd installation during helm install
Browse files Browse the repository at this point in the history
Fixes #624

Signed-off-by: Esten Rye <[email protected]>
  • Loading branch information
estenrye committed Apr 23, 2024
1 parent e39e763 commit 42c9dd3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ set-helm-overlay:
${eval KUSTOMIZE_OVERLAY = HELM}

helm-package: set-helm-overlay generate release-manifests helm
mkdir -p chart/open-feature-operator/templates/crds
mv chart/open-feature-operator/templates/*customresourcedefinition* chart/open-feature-operator/templates/crds
$(HELM) package --version $(CHART_VERSION) chart/open-feature-operator
mkdir -p charts && mv open-feature-operator-*.tgz charts
$(HELM) repo index --url https://open-feature.github.io/open-feature-operator/charts charts
Expand Down
1 change: 1 addition & 0 deletions chart/open-feature-operator/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ignore generated templates
templates/*.yaml
templates/crds/*.yaml
# templates/namespace.yaml is not generated, it's a special case
!templates/namespace.yaml
18 changes: 4 additions & 14 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,16 @@ If you are upgrading OFO to `v0.5.3` or lower, `flagd-proxy` (if present) won't
CRDs are not upgraded automatically with helm (https://helm.sh/docs/chart_best_practices/custom_resource_definitions/).
OpenFeature Operator's CRDs are templated, and can be updated apart from the operator itself by using helm's template functionality and piping the output to `kubectl`:

```console
helm template openfeature/open-feature-operator -s templates/{CRD} | kubectl apply -f -
```

For the `featureflags.core.openfeature.dev` CRD:
To install the CRDs:

```sh
helm template openfeature/open-feature-operator -s templates/apiextensions.k8s.io_v1_customresourcedefinition_featureflags.core.openfeature.dev.yaml | kubectl apply -f -
```

For the `featureflagsources.core.openfeature.dev` CRD:

```sh
helm template openfeature/open-feature-operator -s templates/apiextensions.k8s.io_v1_customresourcedefinition_featureflagsources.core.openfeature.dev.yaml | kubectl apply -f -
helm template openfeature/open-feature-operator -s "templates/crds/*.yaml" | kubectl apply -f -
```

Keep in mind, you can set values as usual during this process:

```console
helm template openfeature/open-feature-operator -s templates/{CRD} --set defaultNamespace=myns | kubectl apply -f -
```sh
helm template openfeature/open-feature-operator -s "templates/crds/*.yaml" --set defaultNamespace=myns | kubectl apply -f -
```

### Uninstall
Expand Down

0 comments on commit 42c9dd3

Please sign in to comment.