stellar / helm-charts

Helm charts for deploying SDF maintained software
3 stars 12 forks source link

charts/horizon: helm install has failed pod startup #64

Closed sreuland closed 11 months ago

sreuland commented 11 months ago

What version are you using?

main

What did you do?

helm repo add stellar https://helm.stellar.org/charts && helm repo update stellar
helm install testhorizon stellar/horizon   --namespace sandbox   --set global.image.horizon.tag=2.26.1 --set global.network=testnet --devel

What did you expect to see?

horizon service running on cluster

What did you see instead?

statefulset startup failed due to pod/spec error:

kubectl get events -n sandbox
LAST SEEN   TYPE      REASON         OBJECT                          MESSAGE
69s         Warning   FailedCreate   statefulset/my-horizon-ingest   create Pod my-horizon-ingest-0 in StatefulSet my-horizon-ingest failed error: Pod "my-horizon-ingest-0" is invalid: spec.containers[0].envFrom[0].secretRef.name: Required value

looking at the statefulset created by helm on cluster, can see the secretRef issue, looks like it has invalid yaml, some empty braces:

....
 spec:
      containers:
      - args:
        - --apply-migrations
        envFrom:
        - secretRef: {}
        - configMapRef:
            name: my-horizon-ingest-env
        image: docker.io/stellar/stellar-horizon:2.26.1
        imagePullPolicy: Always
        name: horizon
....
sreuland commented 11 months ago

i figured out that reported problem was due to incorrect chart install, I didn't define a secret with DATABASE_URL=xxx for db url and then pass in -set ingress.existingSecret=<secret name>. Beyond that, I also ran into startup failures on captive core due to the chart by default tries to run captive core as --in-memory mode, which takes too much RAM, so, I configured the install to use USE_DB instead and still had to manually increase the resource limits to get that to not be OOMKilled. Here is the chart install command that worked for me:

helm install testhorizon stellar/horizon   --namespace sandbox  \
--set ingest.persistence.enabled=true \
--set web.enabled=true \
--set web.existingSecret=my-testnet-db-secret \
--set global.image.horizon.tag=2.26.1 \
--set global.network=testnet \
--set ingest.existingSecret=my-testnet-db-secret \
--set ingest.horizonConfig.captiveCoreUseDb=true \
--set ingest.resources.limits.cpu=2 \
--set ingest.resources.limits.memory=4Gi