ethercalc icon indicating copy to clipboard operation
ethercalc copied to clipboard

Add a Helm Chart to deploy in K8s

Open Crivaledaz opened this issue 5 years ago • 2 comments

It is to make it easier to deploy EtherCalc in a Kubernetes cluster using Helm.

I based my work on the docker-compose.yaml file from master. The chart does the following :

  • Deploy a Redis server and a EtherCalc server in the same pod.
  • Create associated Kubernetes resources : Service, Service Account, Deployment, Ingress (if enabled), PVC (if persistence is enabled)
  • Can be deploy with data persistence (by using PVC and PV)

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.

Crivaledaz avatar Mar 04 '21 17:03 Crivaledaz

Testing & install? ... It is good to catch problems early. Please describe the testing that you did and explain the install process.

eddyparkinson avatar Mar 19 '21 00:03 eddyparkinson

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 : helm install ethercalc-kube crivaledaz/ethercalc, as explained in the Readme.

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/ethercalc

Once 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_PORT

After 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 http://127.0.0.1:8080.

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

Crivaledaz avatar Mar 30 '21 09:03 Crivaledaz