- Flask server with game logic
- Preact frontend
- Make sure minikube is running:
minikube status
- In the
k8s
directory, 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 watch
infrontend
directorydocker-compose up --build
in root- Open
localhost
in a browser
LOCAL=true python server.py
inbackend
directoryyarn watch
infrontend
directoryopen dist/index.html
infrontend
directory
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
frontend
directory, 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: Always
in thedeployment.yml
, it will not pull a new image without restarting (apply
is not enough) - In the
k8s
directory, bring down the running kubernetes pods for the frontend:kubectl delete -f preact-frontend.yml
- Restart them:
kubectl apply -f preact-frontend.yml