kadaster-labs / sensrnet-helm-charts

Other
0 stars 0 forks source link

[registry-backend] cli setting eventstore.clusterSize=1 fails (for local development purposes) #20

Closed marcvanandel closed 3 years ago

marcvanandel commented 3 years ago

For local development (with just a single node in the Kubernetes cluster: the development laptop) it is required for the eventstore to run as a single container instead of a cluster. This can be applied by setting clusterSize to 1 (instead of the default 3).

BUT this fails in the eventstore helm chart (included and installed with the .tgz file in the registry-backend chart

Executing the following cli command fails:

$ helm upgrade --install -n sensrnet-registry registry-backend sensrnet/registry-backend \
     --set eventstore.clusterSize=1 \
     --set mongodb.replicaCount=1

with error message:

Release "registry-backend" does not exist. Installing it now.
Error: template: registry-backend/charts/eventstore/templates/NOTES.txt:12:10: executing "registry-backend/charts/eventstore/templates/NOTES.txt" at <gt .Values.clusterSize 1.0>: error calling gt: incompatible types for comparison
marcvanandel commented 3 years ago

Quick fix for short term workaround:

  1. Clone this (the sensrnet-helm-charts) repo

  2. Open the values file charts/registry-backend/values.yaml and update eventstore.clusterSize from 3 to 1 (and store of cource 😉 )

  3. Install this helm chart by referencing this local copy instead of the published version:

    $ sensrnet-helm-charts> helm upgrade --install -n sensrnet-registry registry-backend charts/registry-backend \
        --set mongodb.replicaCount=1
  4. (and update afterwards to start the actual SensRNet Registry Backend)

    $ sensrnet-helm-charts> helm upgrade -n sensrnet-registry --install registry-backend charts/registry-backend \
     --set replicaCount=1 \
     --set ingress.host=localhost \
     --set ingress.path=/api/ \
     --set "settings.oidc_issuer=http://localhost/dex" \
     --set "settings.oidc_jwks_url=http://localhost/dex/keys" \
     --set mongodb.replicaCount=1
kad-busses commented 3 years ago

Another alternative is to disable affinity, this way the deployment will still use 3 replica's, but will allow them to all run on the same node

helm upgrade -n sensrnet-registry --install registry-backend charts/registry-backend \
  --set eventstore.affinity=null \
  ...

We mostly use the standard EventStore Helm Chart. The described problem is actually a problem with the Chart itself https://github.com/EventStore/EventStore.Charts/issues/53. As the chart is deprecated, it will not be fixed. We'll have to consider how best to move forward regarding EventStore and its deployment

marcvanandel commented 3 years ago

Oh huh ... too bad they ditched the helm charts ... Do we need to move to another way of working for the EventStore as well then? At least they provided more information and considerations in this blog post ... in which they advice to install on bare metal 😳 I don't know ... I'm not ready for that, I think 😏

kad-busses commented 3 years ago

This is fixed in https://github.com/kadaster-labs/sensrnet-helm-charts/pull/32. We can now use correctly set eventstore.clusterSize=1