Testing helm-invenio chart locally using Minikube.
The values file uses the front matter starter image ghcr.io/front-matter/invenio-rdm-starter:v12.1.0.0 but that uses gunicorn for a web server instead of uwsgi so the web pod crashes. The invenio demo images are incompatible with minikube on apple silicon. The most complete test would be to use a locally built Invenio image or our images in Artifact Registry with an image pull secret.
brew install minikube kubectl helm chart-testingdocker desktop start
minikube start
minikube addons enable ingress
minikube addons enable storage-provisioner
kubectl cluster-info # verify it's working
kubectl get nodesPull the helm-invenio repo or a fork of it.
Create a values override file (values.yaml). See the one included in this gist.
# with minikube running, kubectl using minikube context
kubectl create namespace invenio
helm install invenio ./charts/invenio \
--namespace invenio \
-f values.yaml
kubectl get pods -n invenio -w # watch for pods to come up
# Check logs of app pods
kubectl logs -n invenio -l app.kubernetes.io/component=web
kubectl logs -n invenio -l app.kubernetes.io/component=worker
kubectl logs -n invenio -l app.kubernetes.io/component=worker-beatLint all the charts like the repo does: ct lint --all.
Check that workers are running with default settings:
# Exec into worker pod
kubectl exec -it -n invenio (kubectl get pod -n invenio -l app.kubernetes.io/component=worker \
-o jsonpath='{.items[0].metadata.name}') -- /bin/bash
# Inside the pod, check celery workers
celery -A invenio_app.celery inspect active_queuesApply new values:
helm upgrade invenio ./charts/invenio \
--namespace invenio \
-f values.yaml# verify worker command
kubectl get pod -n invenio -l app.kubernetes.io/component=worker -o yaml | grep -A5 "command:"
# run a shell on the worker pod
kubectl exec -it -n invenio (kubectl get pod -n invenio -l app.kubernetes.io/component=worker \
-o jsonpath='{.items[0].metadata.name}') -- /bin/bash
celery -A invenio_app.celery inspect active_queues
celery -A invenio_app.celery inspect statsPort forward a service:
kubectl port-forward -n invenio service/flower-management 5555:5555 &
open http://localhost:5555helm uninstall invenio -n invenio
kubectl delete namespace invenio
minikube stopDependencies (these will all have to be replaced):
Need to add secrets and passwords or installation fails:
- invenio.hostname
- rabbitmq.auth.password
- postgresql.auth.password
the v12.0.0-beta3 docker image tag didn't work so changed web and worker images to use ghcr.io/inveniosoftware/demo-inveniordm/demo-inveniordm:latest but maybe even that isn't wise as it's not a stable release
Reduced all replicas to 1 because it couldn't run locally, runs out of resources. OpenSearch runs four types of pods (coordinating, data, ingest, and master) and we reduce the replicaCount of each to 1. Set redis.replica.replicaCount: 1 too.
To re-do the helm install you have to delete the shared-volume pvc too which helm refuses to cleanup:
helm delete invenio
kubectl delete pvc shared-volumeOutstanding issues:
- the web/worker pods crash, the images are the wrong architecture, if you try to
docker runone inside minikube you get an error "WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested"