https://rancher.com/ logo
Title
d

delightful-alarm-89564

11/29/2022, 8:48 AM
https://docs.rancherdesktop.io/how-to-guides/hello-world-example/ I followed the above document and got stuck at "Deploy to Kubernetes". There seems to be a connection error, how do I solve it?
kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5", GitCommit:"5c99e2ac2ff9a3c549d9ca665e7bc05a3e18f07e", GitTreeState:"clean", BuildDate:"2021-12-16T08:38:33Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"windows/amd64"} Unable to connect to the server: dial tcp 10.250.5.174:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
PS C:\Users\boneis\rancher\nginx> kubectl run hello-world --image=nginx-helloworld:latest --image-pull-policy=Never --port=80 pod/hello-world created PS C:\Users\boneis\rancher\nginx> kubectl port-forward pods/hello-world 8080:80 error: unable to forward port because pod is not running. Current status=Pending PS C:\Users\boneis\rancher\nginx> kubectl port-forward pods/hello-world 8080:80 error: unable to forward port because pod is not running. Current status=Pending PS C:\Users\boneis\rancher\nginx> kubectl port-forward pods/hello-world 8080:80 error: unable to forward port because pod is not running. Current status=Pending PS C:\Users\boneis\rancher\nginx> kubectl get pods NAME READY STATUS RESTARTS AGE hello-world 0/1 ErrImageNeverPull 0 24s ErrImageNeverPull ??
s

sticky-summer-13450

11/29/2022, 10:09 AM
If you set
--image-pull-policy=Never
then how is the image going to be pulled to your kubernetes (Rancher Desktop) cluster?
1
Did you push the image into the cluster yourself?
d

delightful-alarm-89564

11/29/2022, 10:33 AM
may be yes. ^^;
How can I push the image to my cluster(rancher-desktop)?
s

sticky-summer-13450

11/29/2022, 11:05 AM
Okay. Were you following the
nerdctl
or the
docker
instructions?
d

delightful-alarm-89564

11/29/2022, 11:05 AM
docker
s

sticky-summer-13450

11/29/2022, 11:07 AM
Okay. Just doing the
docker build --tag...
should have made the image available to your cluster. Let me just replicate the process...
d

delightful-alarm-89564

11/29/2022, 11:07 AM
docker build --tag nginx-helloworld:latest .
Dockerfile FROM nginx:alpine COPY . /usr/share/nginx/html index.html <h1>Hello World from NGINX!!</h1>
I did as described, but why doesn't it work?
s

sticky-summer-13450

11/29/2022, 11:18 AM
Can you do
kubectl config get-contexts
just to check your kubectl config is pointing to your local Rancher Desktop context.
$ kubectl config get-contexts 
CURRENT   NAME                             CLUSTER            AUTHINFO           NAMESPACE
*         rancher-desktop                  rancher-desktop    rancher-desktop
d

delightful-alarm-89564

11/29/2022, 11:20 AM
rancher-desktop
s

sticky-summer-13450

11/29/2022, 11:23 AM
The instructions work exactly as expected for me...
$ kubectl get pods
NAME          READY   STATUS    RESTARTS   AGE
hello-world   1/1     Running   0          52s
1
Are you sure that Rancher Desktop is configured for
dockerd (moby)
d

delightful-alarm-89564

11/29/2022, 11:27 AM
same..
s

sticky-summer-13450

11/29/2022, 11:27 AM
I'm out of ideas 😞
😅 1
d

delightful-alarm-89564

11/29/2022, 11:28 AM
Thanks a lot
I succeeded It worked when I deleted docker-desktop and tried again.
Thank you very much!!
s

sticky-summer-13450

11/29/2022, 12:37 PM
How curious. Oh well - at least it's working now 🙂
🙏 1
d

delightful-alarm-89564

11/29/2022, 12:38 PM
All of this is thanks to you. thank you so much.
👍 1