apache / openwhisk-deploy-kube

The Apache OpenWhisk Kubernetes Deployment repository supports deploying the Apache OpenWhisk system on Kubernetes and OpenShift clusters.
https://openwhisk.apache.org/
Apache License 2.0
297 stars 231 forks source link

No way to override runtimes.json #635

Closed twavv closed 3 years ago

twavv commented 3 years ago

I want to override the runtimes.json file (in particular, I just want to disable the stem cells since I don't run nodejs in my deployment).

Could this be a customizable value? It could try to read a value from values.yaml and if it's not set, use the existing runtimes.json file.

upgle commented 3 years ago

Hi @travigd, you can create new runtimes-minimal.json and override it like this:

cat > mycluster.yaml <<EOF
whisk:
  runtimes: "runtimes-minimal.json"

https://github.com/apache/openwhisk-deploy-kube/blob/f9179825e78879f40436dbb5386268a888a0f716/helm/openwhisk/values.yaml#L126

twavv commented 3 years ago

For sure, but that still requires editing a file in the chart directory, which I'd rather not do (since I'd like to have all my git history outside of the openwhisk-deploy-kube repo).

dgrove-oss commented 3 years ago

use -f mycluster.yaml to override helm default values.

dgrove-oss commented 3 years ago

For example, see how we override runtime.json when running the TravisCI tests: https://github.com/apache/openwhisk-deploy-kube/blob/master/tools/travis/deploy-chart.sh#L197-#L225

twavv commented 3 years ago

Like I said above, this still requires writing a file INSIDE the chart directory, when (in my humble opinion) it shouldn't. The status quo isn't the worst thing in the world (I can just automate copying the file in) but in an ideal world, I'd just have my mycluster.yaml file and that's it.

dgrove-oss commented 3 years ago

Sorry, I'm missing why this requires something inside the chart directory. I routinely run with a mycluster.yaml located somewhere else on my harddrive. You just give a path in -f.

Reylak commented 1 year ago

Hello, I'd like to reopen this issue and to explain what I think @travigd meant.

Helm requires the files included with Files.get to be under the chart's root directory. So even by changing the runtimes manifest pointed to in mycluster.yaml, you require to include this file inside the chart directory. This is a hard limit to Helm, for security reasons.

Your example for Travis works because the custom runtimes manifest is already inside the directory of the Helm chart.

I think a nice solution would be to include the JSON of the runtimes file in the custom mycluster.yaml. Otherwise, we are left with including a clone of this repository (or of the Helm chart at least) in our projects.