pelias-deprecated / kubernetes

Tools for running Pelias services on kubernetes
MIT License
54 stars 47 forks source link

Helm 3 error #135

Open skulos opened 4 years ago

skulos commented 4 years ago

Using helm 3, I'm getting errors. This might help with your testing.

I downloaded the repo:

~$ git clone https://github.com/pelias/kubernetes.git

Then I changed the directory

~$ cd kubernetes/

And the ran the helm 3, suggested in a closed issue - see link below, command:

~/kubernetes$ helm install pelias --namespace pelias . -f values.yaml
Error: template: pelias/templates/configmap.tpl:34:14: executing "pelias/templates/configmap.tpl" at <(.Values.api.targets.auto_discover) and (or (eq .Values.api.targets.auto_discover true) (eq .Values.api.targets.auto_discover false))>: can't give argument to non-function .Values.api.targets.auto_discover  

Originally posted by @skulos in https://github.com/pelias/kubernetes/issues/123#issuecomment-692057009

skulos commented 4 years ago

https://github.com/pelias/kubernetes/blob/b88039f283be6495f95c7ec5ade0d65da1b6625d/templates/canary-configmap.json.tpl#L34

https://github.com/pelias/kubernetes/blob/b88039f283be6495f95c7ec5ade0d65da1b6625d/templates/configmap.tpl#L34

Took out the if-statements (...) and then the chart seemed to install.

$ helm install pelias -n pelias -f values-override.yaml chart-dir
NAME: pelias
LAST DEPLOYED: Thu Sep 17 11:12:33 2020
NAMESPACE: pelias
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Hey you've just installed Pelias, congrats!

(Oh and I threw the Charts.yamland templates/ into chart-dir, like so:

$ tree -f -L 2
.
├── ./build
│   ├── ./build/Chart.yaml
│   ├── ./build/README.md
│   ├── ./build/templates
│   └── ./build/values.yaml
├── ./chart-dir
│   ├── ./chart-dir/Chart.yaml
│   └── ./chart-dir/templates
├── ./LICENSE
├── ./README.md
├── ./values-override.yaml
└── ./values.yaml

5 directories, 32 files
skulos commented 4 years ago

Dashboard doesn't come up, but think that's my elastic stack config that's the problem. And probing is still little off, taking that out. But seems to be okay ...

skulos commented 4 years ago

I left the pods to run this weekend with the hope it would eventually restart and (magically) work.

~$ kubectl describe pod pelias-interpolation-85f854d877-22zfs -n pelias

Gives the event output like:

Events:
  Type     Reason   Age                      From     Message
  ----     ------   ----                     ----     -------
  Warning  BackOff  92s (x23780 over 3d16h)  kubelet  Back-off restarting failed container

This is on the pelias-interpolation pod. The dashboard I diasbled, and pelias-placeholder seems to spit the same problems.

vdups commented 3 years ago

Hi,

Original issue

More than Helm3, it seems that a more Golang 1.14 patch created a couple of Helm charts to fail.

Here's the most explicit explaination that I've found. https://go-review.googlesource.com/c/go/+/217978/3/doc/go1.14.html#831

In the 2 lines you mentionned here https://github.com/pelias/kubernetes/issues/135#issuecomment-694119938 @skulos , I inverted the 'and' placement.

From if (test 1) and (test 2)

To if and (test 1) (test 2)

This did remove a first error you mentionned in your original Bug report

Second issue Despite this, I still have an error message complaining about incompatible types Error: template: pelias/templates/configmap.tpl:34:60: executing "pelias/templates/configmap.tpl" at <eq .Values.api.targets.auto_discover true>: error calling eq: incompatible types for comparison

My intuition is that the null value for api.targets.auto_discover in values.yaml creates some issue for a boolean. I don't have a pretty solution, but overloading the parameter with --set api.targets.auto_discover=true allowed me to deploy the chart with Helm 3

helm version
version.BuildInfo{Version:"v3.3.2", GitCommit:"e5077257b6ca106d1f65652b4ca994736d221ab1", GitTreeState:"clean", GoVersion:"go1.14.9"}

Cheers,