- Flask server with game logic
- Preact frontend
- Make sure minikube is running:
minikube status
- In the
k8sdirectory, create services/deployments:
kubectl apply -f .
- Enable an ingress controller:
minikube addons enable ingress
- Open a browser to the minikube IP address. You can find it by running:
minikube ip
yarn watchinfrontenddirectorydocker-compose up --buildin root- Open
localhostin a browser
LOCAL=true python server.pyinbackenddirectoryyarn watchinfrontenddirectoryopen dist/index.htmlinfrontenddirectory
If you make changes to a project, you'll need to do a few things to update kubernetes. For example,
after making changes to frontend:
- In the
frontenddirectory, rebuild fromsrc:yarn build:minikube - Rebuild docker image:
docker build -t helloitsjoe/blackjack-preact-frontend:minikube .(Note the.) - Push to docker hub:
docker push helloitsjoe/blackjack-preact-frontend:minikube - Despite the
imagePullPolicy: Alwaysin thedeployment.yml, it will not pull a new image without restarting (applyis not enough) - In the
k8sdirectory, bring down the running kubernetes pods for the frontend:kubectl delete -f preact-frontend.yml - Restart them:
kubectl apply -f preact-frontend.yml