Skip to content

Commit

Permalink
Move IAM CRDs back up one level and add README
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed May 13, 2024
1 parent 5382c08 commit 5b4f17f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
37 changes: 37 additions & 0 deletions chart/openfaas/crds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# CRDs

CRDs are installed by Helm in two ways, there is also a static copy of the CRDs that can be applied via `kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/artifacts/crds/crds.yaml`.

## 1. The `crds` folder

CRDs in the ./crds folder are installed once by Helm before installing the chart. This is required for the IAM CRDs because IAM CRs are created by the chart during the installation. If these CRDs change, you will have to apply them manually.

To suppress installation of type 1 CRDs, add `--skip-crds` to the helm command.

To update these CRDs, clone the faas-netes repository, and apply the files within the ./chart/openfaas/crds folder.

```sh
git clone https://github.com/openfaas/faas-netes --depth=1
cd faas-netes
kubectl apply -f ./chart/openfaas/crds/
```

## 2. CRDs in templates

CRDs in the ./templates folder are installed initially, then upgraded on each update of the chart. This has the advantage of updating CRDs like the Function CRD when the chart is updated, without having to run manual actions.

To suppress installation of type 2 CRDs, add `--set skipCRDs=true` to the helm command.

To update CRDs in the templates folder, run a normal helm install/upgrade.

To install only the CRDs in the templates folder, on their own for a split installation, run:

```sh
git clone https://github.com/openfaas/faas-netes --depth=1
cd faas-netes
helm template ./chart/openfaas --set skipCRDs=false \
--show-only templates/*-crd.yaml > templates-crds.yaml
```

You can then apply `templates-crds.yaml` as required.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{- if .Values.createCRDs }}

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -77,5 +75,3 @@ spec:
served: true
storage: true
subresources: {}

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{- if .Values.createCRDs }}

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -93,5 +91,3 @@ spec:
served: true
storage: true
subresources: {}

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{- if .Values.createCRDs }}

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -84,5 +82,3 @@ spec:
served: true
storage: true
subresources: {}

{{- end }}

0 comments on commit 5b4f17f

Please sign in to comment.