MLOps C4 W2 Ungraded Lab : Intro_to_Kubernetes - unable to send json for prediction

Hi @Th_o_Vy_Le_Nguy_n,
I am trying to complete the ungraded lab 2 of C4_W2.
My platform is Windows 11 with WSL2.
I am running Linux version of Minikube and started with the following in a wsl shell:
minikube start --mount=True --mount-string=“/var/tmp:/var/tmp” --vm-driver=docker
When I progressed the end of first part of the lab to the following:
curl -d ‘{“instances”: [1.0, 2.0, 5.0]}’ -X POST
I get error such as :
curl: (28) Failed to connect to port 30001 after 132587ms: Connection timed out

I saw your earlier replies to another user seemed to have similar connection problem and wonder would you be kind enough to look at it and advise. Many thanks in advance.

Hi @BHTan ,
When you said you’re using the Minikube Linux version. Did you mean you installed it with WSL? If that is the case, the network might be limited if using the Docker driver on Darwin, Windows, or WSL, and the Node IP is not reachable directly. Also, running minikube on Linux with the Docker driver will result in no tunnel being created.

You try switching to Docker or try these steps to fix minikube:

  • remove minikube from WSL
    minikube delete --purge

  • Then installed VirtualBox on Windows

  • Install Ubuntu

  • Install docker then minikube, kubectl on Ubuntu

  • Start minikube
    minikube start --memory=6g --cpus=4 --driver=docker

many thanks @Th_o_Vy_Le_Nguy_n. I will try it later today and update.

Hi @Th_o_Vy_Le_Nguy_n, something is wrong with my local PC set up. May I clarify the following is the correct steps?
0. Docker was installed from previous lab in C4_W1.

  1. Turn on Windows Features for Hyper-V, Virtual Machine Platform, Windows Subsystem for Linux (see below).
  2. On Windows Powershell, enter command:
    wsl --set-default-version 2
  3. With Microsoft Store, installed Ubuntu 22.04.2 LTS
  4. Install VirtualBox 7.0.10 for Windows Host and start the Virtual machine
  5. Start Ubuntu on Windows 11 with WSL2
  6. Install fresh Docker Engine on Ubuntu
  7. Install minikube and kubectl in Ubuntu Terminal
  8. Start minikube:
    minikube start --memory=6g --cpus=4 --driver=docker

also, one question regarding starting minikube command above, why the driver=docker and not virtualbox?

Thanks @Th_o_Vy_Le_Nguy_n

I had restarted the whole installation from fresh without VirtualBox and docker’s.
Also, most important, I edited the deployment.yaml to increase the memory.limit to 6000M (6G as per your suggestion).
I ran a separate Ubuntu window “minikube service tf-serving-service” to open a tunnel to the service.
I managed to run the curl command successful this time and saw the results returned by the model finally! I also completed the rest of the Lab 2 exercise successfully.

Most important 2 things I learned are : (1) how to use ‘kubectl describe all’ and to debug why found the container (tf-serving) got terminated/recreated multiple times - due to memory constraint problem and prompted me to edit the deployment.yaml. (2) given my local Windows11+wsl2+ubuntu setup, I must ran “minikube service tf-serving-service” to have minikube open a tunnel for me to connect the service server for submitting the json inputs.

Many thanks for your kind help.

1 Like

Below is my study notes for this lab. Hope it helps others.