5. Run Springboot pet store with Minikube on WSL2
To run springboot pet store with Kubernetes, try this tutorial! https://docs.docker.com/language/java/deploy/
NOTE: The tutorial does not work if you run Minikube on WSL2.
The network is limited if using the Docker driver on Darwin, Windows, or WSL, and the Node IP is not reachable directly.
Running minikube on Linux with the Docker driver will result in no tunnel being created.
Services of type NodePort
can be exposed via the minikube service <service-name> --url
command.
https://minikube.sigs.k8s.io/docs/handbook/accessing/
Therefore, add the following command.
minikube service service-entrypoint --url
And the screenshot
The app can be accessed through the port exposed by the command (43365), not nodePort(30001) defined in the manifesto like below.
apiVersion: v1
kind: Service
metadata:
name: service-entrypoint
namespace: default
spec:
type: NodePort
selector:
service: server
ports:
- port: 8080
targetPort: 8080
nodePort: 30001