Description
Description
When specified as a dependency of a Helm chart, the Zookeeper Operator fails to install due to CRD's not being installed.
apiVersion: v2
name: my-name
description: My description
type: application
version: 0.1.0
appVersion: 0.1.0
dependencies:
- name: zookeeper
version: "0.2.9"
repository: "https://charts.pravega.io"
- name: zookeeper-operator
version: "0.2.9"
repository: "https://charts.pravega.io"
...
Helm cannot find the relevant CRD's because they have not yet been installed, so fails with the following error:
Error: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "BookkeeperCluster" in version "bookkeeper.pravega.io/v1alpha1", unable to recognize "": no matches for kind "PravegaCluster" in version "pravega.pravega.io/v1beta1", unable to recognize "": no matches for kind "ZookeeperCluster" in version "zookeeper.pravega.io/v1beta1"]
The CRD template file has the conditional statement which prevents kubectl apply -f https://raw.githubusercontent.com/pravega/zookeeper-operator/master/charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yamll
:
error: error parsing https://raw.githubusercontent.com/pravega/zookeeper-operator/master/charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yaml: json: line 0: invalid character '{' looking for beginning of object key string
This is equally applicable to the Pravega and Bookkeeper CRD's - I'll raise separate issues for those.
Importance
This is a must have for packaging Pravega as part of a larger application.
Location
charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yaml
Suggestions for an improvement
CRD's can be included in a crd
directory and Helm will apply these first. The CRD's could also be provided in a separate Helm chart but I wouldn't find this particularly useful due to not being able to specify a dependency application order. https://helm.sh/docs/chart_best_practices/custom_resource_definitions/
Alternatively, the CRD could be provided as a release artefact that can be installed before running Helm with crd.create=false
:
kubectl apply -f https://github.com/pravega/zookeeper-operator/releases/download/0.2.9/zookeeper-operator.crds.yaml