Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pravega operator fails to install when used as a Helm dependency #490

Closed
junglie85 opened this issue Dec 20, 2020 · 4 comments
Closed

Pravega operator fails to install when used as a Helm dependency #490

junglie85 opened this issue Dec 20, 2020 · 4 comments

Comments

@junglie85
Copy link

Description

When specified as a dependency of a Helm chart, the Pravega 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: pravega
    version: "0.8.0"
    repository: "https://charts.pravega.io"
  - name: pravega-operator
    version: "0.5.1"
    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/pravega-operator/master/charts/pravega-operator/templates/pravega.pravega.io_pravegaclusters_crd.yaml:

error: error parsing https://raw.githubusercontent.com/pravega/pravega-operator/master/charts/pravega-operator/templates/pravega.pravega.io_pravegaclusters_crd.yaml: json: line 0: invalid character '{' looking for beginning of object key string

This is equally applicable to the Bookkeeper and Zookeeper 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/pravega-operator/templates/pravega.pravega.io_pravegaclusters_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/pravega-operator/releases/download/0.5.1/pravega-operator.crds.yaml
@SrishT
Copy link
Contributor

SrishT commented Dec 24, 2020

@ambye85 having the crds folder was not required in our use-case since the crd installation is done in the pravega-operator charts and required in the pravega charts. Hence if you can ensure that the dependencies are installed in a particular order, i.e. the pravega-operator installation happens before attempting to install the pravega charts, that should fix the issue you are facing.

@junglie85
Copy link
Author

junglie85 commented Dec 24, 2020

@SrishT I initially attempted to enforce an order but soft dependencies between charts is not supported by Helm:

Soft dependency: A chart may simply not function without another chart being installed in a cluster. Helm does not provide tooling for this case. In this case, dependencies may be managed separately.

There is a post from 2018 on Stackoverflow which suggests a possible workaround - if it works for Helm 3 the charts would need updating to allow custom annotations to be added. I think a CRD's folder would be a neater solution.

@junglie85
Copy link
Author

This is also the same issue as pravega/zookeeper-operator#285 and pravega/bookkeeper-operator#93. Is it worth consolidating into a single issue?

@junglie85
Copy link
Author

No longer an issue - so I'm going to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants