Add a Helm Chart to deploy in K8s#754
Conversation
|
Testing & install? ... It is good to catch problems early. Please describe the testing that you did and explain the install process. |
|
Hi, You can follow the Readme to deploy on a Kubernetes cluster. Helm is a CNCF project which helps you define, install, and upgrade applications in Kubernetes. You can set up Helm by following the official guide. To use Helm, you need a Kubernetes cluster. If you don't have one you can easily begin with Minikube. So, to test my work, you can install a Kubernetes environment with Minikube, then set up Helm V3 with the Minikube cluster, and finally deploy Ethercalc in Minikube, by running : To summarize, on Linux : curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube kubectl -- get po -A
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm repo add crivaledaz http://clavier.iiens.net/helm
helm install ethercalc-kube crivaledaz/ethercalcOnce Helm has deployed Ethercalc in Kubernetes and the containers have started (it can take one minute) : export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=ethercalc,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORTAfter that, you have a Kubernetes cluster with an EtherCalc instance deployed by Helm using this Chart. You can now access EtherCalc in your web browser on The Helm Chart offers many parameters to adapt the deployment to Kubernetes cluster. You need to learn Kubernetes to understand usage of each of them. For your information, I have deployed this Chart in my company production cluster (Kubernetes 1.18.8 and Helm 3.5.2 with an Nginx Ingress) for one month, and it works fine. I hope this will help you test my work. Ask me if you encounter difficulties. Regards |
Two additions that together enable `helm install`-to-production deployment of EtherCalc on Kubernetes: **helm/** — minimum-viable chart for the single-pod Miniflare runtime. Diverges from the old PR #754 in the pieces that matter: - Hard-locked `replicas: 1` + `strategy: Recreate`. Two pods sharing the PVC would silently corrupt rooms — Miniflare is single-process with no consensus layer. HPA template from #754 dropped entirely; scaling requires Cloudflare Workers + DOs instead. - No Redis sidecar — all state (DO storage, D1 sqlite, KV, R2) lives in `/data` on a single `ReadWriteOnce` PVC. - Secret templating for `ETHERCALC_KEY` + `ETHERCALC_MIGRATE_TOKEN` with an `existingSecret` escape hatch for external secret managers. - PVC annotated `helm.sh/resource-policy: keep` so data survives `helm uninstall` → `helm install`. - Probes wired to `/_health`. **publish-image.yml** — GHA workflow that on each `0.YYYYMMDD.N` tag builds multi-arch (amd64 + arm64) via `docker/build-push-action@v6` and pushes `audreyt/ethercalc:<version>` + `:latest` to Docker Hub. Requires `DOCKERHUB_USERNAME` + `DOCKERHUB_TOKEN` repo secrets. **ci.yml** — added `helm-lint` job so chart drift (syntax, templating bugs) is caught on every PR. Renders four variants (default, ingress, existingSecret, persistence disabled) to exercise the template gates.
It is to make it easier to deploy EtherCalc in a Kubernetes cluster using Helm.
I based my work on the
docker-compose.yamlfile from master. The chart does the following :I tested it on a Kubernetes cluster version 1.18.8 with Helm 3.5.2.
The Helm Chart adds an installation method and do not change anything from existing installation methods.