I can't access a kubernetes service from localhost - docker

I've recently been learning Docker and Kubernetes. I think i now understand docker pretty well so ive been trying to make the kubernetes work. I'm on Windows btw.
I have installed kubernetes with the standard windows docker dashboard and done everything that was in the tutorials I've found to get the kubernetes dashboard.
Now I have my dashboard and I'm running a simple nginx pod.
with a service :
but when I go on localhost:88 it tells me that localhost hasnt sent any data.
I have also tried :
kubectl port-forward nginx-67d74d8fbc-qnzgf :88
and when I tried in the port that was assigned automatically it said inaccessible website and did this error in the cmd:
Handling connection for 58193
Handling connection for 58193
E0523 12:49:36.846094 16200 portforward.go:406] an error occurred forwarding 58193 ->
88: error forwarding port 88 to pod 764194941a96bf6dc7b3d491ffe910cd34885e20a0b98690392b9a4c4feca310, uid : exit status 1:
2022/05/23 10:49:36 socat[7405] E connect(16, AF=2 127.0.0.1:88, 16): Connection refused
E0523 12:49:36.847735 16200 portforward.go:406] an error occurred forwarding 58193 88: error forwarding port 88 to pod 764194941a96bf6dc7b3d491ffe910cd34885e20a0b98690392b9a4c4feca310, uid : exit status 1:
2022/05/23 10:49:36 socat[7406] E connect(16, AF=2 127.0.0.1:88, 16): Connection refused
E0523 12:49:36.884999 16200 portforward.go:234] lost connection to pod
Handling connection for 58193
E0523 12:49:36.885522 16200 portforward.go:391] error copying from local connection to
remote stream: EOF
E0523 12:49:36.888639 16200 portforward.go:346] error creating error stream for port
58193 -> 88: EOF
I don't know what to do to access the nginx app I created in my browser and i cant find any doc.

OK I have found what the problem was, I had opened docker and kubernetes on my admin session but was accessing it from a browser on my normal session.

Related

Connection refused trying to get account info in Solana

solana account <address>
When I get account info, I have this error:
Error: RPC request error: cluster version query failed: error sending request for url (http://localhost:8899/): error trying to connect: tcp connect error: Connection refused (os error 111)
The error is indicating that the CLI RpcClient can not communicate with the Solana validator.
This is usually caused by not having solana-test-validator running in another terminal. Many make the mistake of thinking that the localhost is running the validator all the time... it's not.
In one terminal do: solana-test-validator which will startup up the local validator
Open a second terminal and do solana account - This will return account info for the default keypair
It's a network connection problem.
I use ubuntu 20.04, I was using windscribe VPN because my location and got the error, now I'm using psiphon VPN and it's working fine.

OpenShift 4 error: Error reading manifest

during OpenShift installation from a local mirror registry, after I started the bootstrap machine i see the following error in the journal log:
release-image-download.sh[1270]:
Error: error pulling image "quay.io/openshift-release-dev/ocp-release#sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129":
unable to pull quay.io/openshift-release-dev/ocp-release#sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129: unable to pull image:
Error initializing source docker://quay.io/openshift-release-dev/ocp-release#sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129:
(Mirrors also failed: [my registry:5000/ocp4/openshift4#sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129: Error reading manifest
sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129 in my registry:5000/ocp4/openshift4: manifest unknown: manifest unknown]):
quay.io/openshift-release-dev/ocp-release#sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129: error pinging docker registry quay.io:
Get "https://quay.io/v2/": dial tcp 50.16.140.223:443: i/o timeout
Does anyone have any idea what it can be?
The answer is here in the error:
... dial tcp 50.16.140.223:443: i/o timeout
Try this on the command line:
$ podman pull quay.io/openshift-release-dev/ocp-release#sha256:999a6a4bd731075e389ae601b373194c6cb2c7b4dadd1ad06ef607e86476b129
You'll need to be authenticated to actually download the content (this is what the pull secret does). However, if you can't get the "unauthenticated" error then this would more solidly point to some network configuration.
That IP resolves to a quay host (you can verify that with "curl -k https://50.16.140.223"). Perhaps you have an internet filter or firewall in place that's blocking egress?
Resolutions:
fix your network issue, if you have one
look at doing an disconnected /airgap install -- https://docs.openshift.com/container-platform/4.7/installing/installing-mirroring-installation-images.html has more details on that
(If you're already doing an airgap install and it's your local mirror that's failing, then your local mirror is failing)

ngrok and docker, failed to complete tunnel connection

i've changed nothing within my setup and ngrok seems to have stopped working for me.
Running ngrok http -host-header=rewrite launch.localhost:80 would usually work just fine.
This is my error:
The connection to http://d678207f86ae.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address launch.localhost:80.
Make sure that a web service is running on launch.localhost:80 and that it is a valid address.
The error encountered was: dial tcp: lookup launch.localhost: no such host
If I navigate to launch.localhost the docker server is running just fine.
Not too sure what kind of other information you'd need to help?
For me, it was never running before, but I was getting the same error for
ngrok http -host-header=rewrite launch.local:80
It helped when I changed it to
ngrok http -host-header=launch.local 80

Run testcontainer test OK in local environment but failed in jenkins

Background
In my application, it needs to connect to zookeeper to get some useful information. So I start a zookeeper container in my integration test with port binding like -p 2859:2181.
zookeeper = new GenericContainer<>("zookeeper:3.6.1")
.withEnv("ZOOKEEPER_CLIENT_PORT", "2181")
.withExposedPorts(2181);
zookeeper.setPortBindings(Arrays.asList("2859:2181"));
zookeeper.start();
Then I use the following command to run the test. It goes smoothly connecting to localhost:2859 without any problems.
mvn -Dtest=xxxIntegrationTest.java test
Problem
However, when I use jenkins to run the same test with same command, it cannot connect to localhost:2859, complaining that
2020-10-28 12:16:04.282 INFO [main-SendThread(localhost:2859)] Opening socket connection to server localhost/127.0.0.1:2859. Will not attempt to authenticate using SASL (unknown error)
2020-10-28 12:16:04.283 WARN [main-SendThread(localhost:2859)] Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
I don't know why it behaves differently in these two senarios. Could anyone give me some suggestions?

Docker setup - facing issues while running chaincode locally

I've successfully installed Docker and Hyperledge-fabric v0.6 on my local system. Unfortunately while trying to run a sample chaincode, I'm facing with the below mentioned error. Please guide me to run my chaincode successfully.
addrConn.resetTransport failed to create client transport: connection
error: desc = "transport: dial tcp [::1]:30303: connectex: No
connection could be made because the target machine actively refused
it."; Reconnecting to {"localhost:30303" } 10:05:25.048 [shim]
ERRO : Error trying to connect to local peer: grpc: timed out when
dialing Error starting Simple chaincode: Error trying to connect to
local peer: grpc: timed out when dialing
C:\Users\Arunh\goworkspace\src\github.com\testapp\learn-chaincode\start>docker-compose
op 'docker-compose' is not recognized as an internal or external
command, operable program or batch file.
Hyperledger Fabric has evolved quite a bit since the v0.6 release. Recommend if you are still on v0.6 that you upgrade to v1.0.x. http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html

Resources