kubernetes deployment cannot be created - docker

I'm running a minikube cluster on Hyper-V using windows 11 Pro.
I'm trying to create a deployment using a docker image (named k8s-web-hello), that is on Docker Hub using the following command :
kubectl create deployment k8s-web-hello --image=username/k8s-web-hello
but the I'm getting the following error :
error: failed to create deployment: Post "https://172.30.215.93:8443/apis/apps/v1/namespaces/default/deployments?fieldManager=kubectl-create&fieldValidation=Strict": dial tcp 172.30.215.93:8443: 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.
Operating System
Windows
Driver
Hyper-V

Related

Unable to pull any image from Docker public repository

I am unable to pull any image from the Docker public repository.
Until yesterday, everything was OK.
Nothing had changed in my network configuration.
No VPN, no proxy, working at home - connection at 540 Mbps according to fast.com.
I am using docker engine on Ubuntu 22.04 running inside WSL
Host Operating System:
Windows 11 Professionnal - Version 22H2 - Build 22621.819
$ docker -v
Docker version 20.10.19, build d85ef84
I have tried:
changed the default DNS to dns_google (8.8.8.8)
restarted the docker demon
restarted WSL
restarted the computer
connected to the internet on another network (4G)
flushed the DNS info locally (ipconfig /flushdns on Windows CMD)
searched for any reports of unavailability, change of rules on docker official site.
I was expecting the image to be downloaded to my local computer to be used by docker,
but I got this:
$ docker pull hello-world
Using default tag: latest
Error response from daemon:
Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on <my_ip>:53: read udp <my_ip>:42896-><my_ip>:53: read: connection refused

Docker: No connection could be made because the target machine actively refused it

ErrorDisplayedHere
I tried many ways like reinstalling Docker, changing DNS server,restarting windows, but nothing worked out.
Unable to find image 'hello-world:latest' locally docker: Error
response from daemon: Get https://registry-1.docker.io/v2/: dial tcp
100.24.246.89:443: connectex: No connection could be made because the target machine actively refused it.
Open Docker Settings and select "Expose daemon on tcp://localhost:2375 without TLS" (on the General tab), then apply & restart Docker. Do note the warning about the vulnerability that this option exposes.

Unable to delete unwanted docker images

I want to remove all the unwanted docker images and containers from my system's C: drive. Currently system running out of memory. I had used the commands but it's showing the following error:
error during connect: Post https://192.168.99.100:2376/v1.40/containers/prune: dial tcp 192.168.99.100:2376: 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.
How do I resolve it?
image1
Running docker comments require the docker daemon (service) to be running.

gRPC in docker container can't connect to services on host machine

I have slightly modified this example: https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/echo. I am running envoy on a docker container with exposed port 8080 (running this proxy server is required because the browser can't speak directly to a backend gRPC service). I am running all the services on my localhost (the host machine of the envoy docker container). However, I cannot seem to connect envoy in the docker container to the services running on the host machine.
I compiled grpc_cli in the container and when I run grpc_cli ls 192.168.1.10:9000 (host's LAN IP address and the port the service is running on), I get
root#bdc9ac396a87:~/grpc# ./bins/opt/grpc_cli ls 192.168.1.10:9000
Received an error when querying services endpoint.
ServerReflectionInfo rpc failed. Error code: 14, message: failed to connect to all addresses, debug info: {"created":"#1569023274.866465052","description":"Failed to pick subchannel","file"
:"src/core/ext/filters/client_channel/client_channel.cc","file_line":3876,"referenced_errors":[{"created":"#1569023274.866463178","description":"failed to connect to all addresses","file":"
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":395,"grpc_status":14}]}
I get an almost identical error when I use the IP address of the docker0 interface, which should also provide a connection to the host machine.
root#bdc9ac396a87:~/grpc# ./bins/opt/grpc_cli ls 172.17.0.1:9000
Received an error when querying services endpoint.
ServerReflectionInfo rpc failed. Error code: 14, message: failed to connect to all addresses, debug info: {"created":"#1569022455.801913949","description":"Failed to pick subchannel","file"
:"src/core/ext/filters/client_channel/client_channel.cc","file_line":3876,"referenced_errors":[{"created":"#1569022455.801910006","description":"failed to connect to all addresses","file":"
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":395,"grpc_status":14}]}
However, running a simple http server from the host with
python -m http.server
I can run the following commands from the container just fine:
wget 172.17.0.1:8000/test.txt // works
wget 192.168.1.10:8000/test.txt // works
A client on the host (not in the container) connects and works just fine with the service, so it's not a server problem.
Does docker block certain types of traffic? I noticed in the example the server was placed on another docker container, and it worked (it also worked locally for me), but I'd prefer to have my services running on my host machine while I build and test them. Is there a setting somewhere to enable gRPC from the container to a service on the host machine?
Docker version 1.13.1, build 47e2230/1.13.1
Fedora 29

"docker-machine create" gives connection attempt failed error when run from behind a corporate proxy

I am new to docker and am trying to create a docker host using the docker-machine create [name] command on Windows 7 but I always get a connection attempt failed error.
I added the HTTP_PROXY and HTTPS_PROXY to Docker Toolbox\start.sh but that did not help
Also tried :
--engine-env HTTP_PROXY=http://proxy IP:port CLI option for docker-machine create command
Windows powershell command $env:HTTP_PROXY=http://proxy IP:port to set the environment variable at global level
But none of these have resolved the issue.
docker-machine version and the error:
C:\Windows\system32> docker-machine -v
docker-machine.exe version 0.14.0, build 89b8332
C:\Windows\system32> docker-machine create node-1
(node-1) Unable to get the latest Boot2Docker ISO release version:
Get
https://api.github.com/repos/boot2docker/boot2docker/releases/latest:
dial tcp 192.30.253.116: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.
Since there was no response to my query above I uninstalled docker toolbox and installed docker on a VM. It is working perfectly now. I have written an article on Medium for all you are trying this for the first time and need help in setting up Docker on Win7 behind a corporate proxy. The article can be found here : https://medium.com/#uvnikgupta/installing-docker-on-win7-pc-79db4217bbae

Resources