diff --git a/chart/openfaas/crds/README.md b/chart/openfaas/crds/README.md new file mode 100644 index 0000000000..b77e613f30 --- /dev/null +++ b/chart/openfaas/crds/README.md @@ -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. + diff --git a/chart/openfaas/templates/iam.openfaas.com_jwtissuers-crd.yaml b/chart/openfaas/crds/iam.openfaas.com_jwtissuers.yaml similarity index 98% rename from chart/openfaas/templates/iam.openfaas.com_jwtissuers-crd.yaml rename to chart/openfaas/crds/iam.openfaas.com_jwtissuers.yaml index 79115d60dd..a70b365b79 100644 --- a/chart/openfaas/templates/iam.openfaas.com_jwtissuers-crd.yaml +++ b/chart/openfaas/crds/iam.openfaas.com_jwtissuers.yaml @@ -1,5 +1,3 @@ -{{- if .Values.createCRDs }} - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -77,5 +75,3 @@ spec: served: true storage: true subresources: {} - -{{- end }} \ No newline at end of file diff --git a/chart/openfaas/templates/iam.openfaas.com_policies-crd.yaml b/chart/openfaas/crds/iam.openfaas.com_policies.yaml similarity index 98% rename from chart/openfaas/templates/iam.openfaas.com_policies-crd.yaml rename to chart/openfaas/crds/iam.openfaas.com_policies.yaml index 31a81659f4..aa4e9a282e 100644 --- a/chart/openfaas/templates/iam.openfaas.com_policies-crd.yaml +++ b/chart/openfaas/crds/iam.openfaas.com_policies.yaml @@ -1,5 +1,3 @@ -{{- if .Values.createCRDs }} - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -93,5 +91,3 @@ spec: served: true storage: true subresources: {} - -{{- end }} \ No newline at end of file diff --git a/chart/openfaas/templates/iam.openfaas.com_roles-crd.yaml b/chart/openfaas/crds/iam.openfaas.com_roles.yaml similarity index 98% rename from chart/openfaas/templates/iam.openfaas.com_roles-crd.yaml rename to chart/openfaas/crds/iam.openfaas.com_roles.yaml index 9f4e0bcffa..cf5ce584e2 100644 --- a/chart/openfaas/templates/iam.openfaas.com_roles-crd.yaml +++ b/chart/openfaas/crds/iam.openfaas.com_roles.yaml @@ -1,5 +1,3 @@ -{{- if .Values.createCRDs }} - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -84,5 +82,3 @@ spec: served: true storage: true subresources: {} - -{{- end }} \ No newline at end of file