-
Clone this repo:
git clone https://github.com/asifkazi/presto-on-kubernetes.git
-
Create a K8S namespace for your cluster:
kubectl create namespace presto
-
Apply the persistent volume and mysql deployment
kubectl apply -f ./mysql-pv.yaml --namespace presto
kubectl apply -f ./mysql-deployment.yaml --namespace presto
-
Make sure the pod came up running
kubectl get pods -n presto
Example:
NAME READY STATUS RESTARTS AGE mysql-5477d96fbf-24r7p 1/1 Running 0 6s
-
Verify connectivity / working database
kubectl run -it --rm --image=mysql:5.7 --restart=Never mysql-client -n presto -- mysql -h mysql -udbuser -pdbuser
If you don't see a command prompt, try pressing enter.
+--------------------+ | Database | +--------------------+ | information_schema | | demodb | +--------------------+ 2 rows in set (0.00 sec)
-
Quit out of the client
Bye pod "mysql-client" deleted
-
Install Presto Coordinator and Workers in your K8s cluster:
kubectl apply -f presto.yaml --namespace presto
-
Change the configuration file
-
Apply the change to the cluster
kubectl apply -f presto.yaml --namespace presto
Uninstall Presto cluster in your K8s cluster:
kubectl delete -f presto.yaml --namespace presto
kubectl delete deployment,svc mysql --namespace presto
kubectl delete pvc mysql-pv-claim --namespace presto
kubectl delete pv mysql-pv-volume --namespace presto