Example R Shiny app that has been dockerized and is run using Kubernetes. Useful for deployment of R Shiny apps on Kubernetes.
File uses dockerized shiny app that can be found here:
- install docker desktop for windows with WSL enabled
- install minikube for windows
- start docker desktop
- in PowerShell in Admin mode:
- set default driver for minikube to docker using
minikube config set driver docker
- run
minikube start
- set default driver for minikube to docker using
- copy %USERPROFILE%.kube\config from Windows to ~/.kube/config but change directory structure to WSL to point to Windows files. You may need to do this everytime you start up docker to update the IP:port.
image: bbcho/docker_shiny_example:0.2.0 # tag is required
kubectl create -f deployment.yaml
kubectl create -f loadbalancer.yaml
minikube service shiny-loadbalancer
https://medium.com/swlh/how-to-run-locally-built-docker-images-in-kubernetes-b28fbc32cc1d
kubectl get nodes -o yaml
Use either the internal IP that you get from the kubectl get nodes -o yaml
command or the url from minikube service shiny-loadbalancer --url
via powershell.