This project provides a simple Flask "Hello World" application that can be deployed locally using Minikube and Skaffold.
The idea is to illustrate how Skaffold can keep local code in sync with a deployed container without needed to rebuild the container.
-
Start Minikube:
minikube start
-
Set Docker to use Minikube's Daemon:
eval $(minikube docker-env)
-
Run Skaffold:
skaffold dev
-
Access the Application:
minikube service hello-world
-
Check Skaffold's Output: Ensure there are no errors in Skaffold's terminal output.
-
Check Service and Pod Status: Ensure the service and pod are running using
kubectl get svc hello-world
andkubectl get pods -l app=hello-world
. -
Access Service Manually: Use
minikube service hello-world
to open the application in a new browser window/tab. -
Check Application Logs: Use
kubectl logs -l app=hello-world
to view logs for any errors or issues. -
Network Issues: Try accessing the application from a different browser or device on the same network.
-
Minikube Tunnel: If using a LoadBalancer service type, ensure you have
minikube tunnel
running in a separate terminal. -
Resource Constraints: Ensure Minikube has enough resources allocated.
-
Recreate Minikube Cluster: If all else fails, consider restarting Minikube using
minikube stop
,minikube delete
, andminikube start
. -
Skaffold Debugging: if you have issues running in skaffold, try running with the -vdebug flag
skaffold dev -vedbug
to see verbose output.
Skaffold uses Git tags or commits to tag Docker images by default. If your project directory isn't a Git repository, Skaffold might fail to generate a tag using Git but will fall back to using the latest
tag.
To address this:
-
Initialize a Git Repository:
git init git add . git commit -m "Initial commit"
-
Specify a Different Tagger in
skaffold.yaml
: Use a datetime-based tag or always use thelatest
tag.