incubator-streampark icon indicating copy to clipboard operation
incubator-streampark copied to clipboard

[Bug] There was a malfunction with the Docker environment configuration feature when deploying Streampark on a k8s cluster.

Open SoWhat-ET opened this issue 8 months ago • 1 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Java Version

1.8

Scala Version

2.12.x

StreamPark Version

2.1.4

Flink Version

1.16.2

deploy mode

None

What happened

1 Deploying on K8S according to the official guide

https://github.com/apache/incubator-streampark/tree/release-2.1.4/helm#readme

2 Error occurred when trying to log in to the system and configure the Docker service.

image Failed to validate Docker registry, error: org.apache.hc.client5.http.HttpHostConnectException: Connect to http://localhost:2375 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

3 I looked up relevant information and asked the LLM:

Q: Error encountered while configuring Docker repository after successful deployment: Failed to validate Docker registry, error: org.apache.hc.client5.http.HttpHostConnectException: Connect to [http://localhost:2375](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) [localhost/127.0.0.1] failed: Connection refused (Connection refused)

是否需要修改helm/streampark/values.yaml 文件中的 { name: DOCKER_HOST, value: "tcp://localhost:2375" }

A: This configuration sets the environment variable DOCKER_HOST to tcp://localhost:2375, which means your application will try to connect to the Docker API on localhost:2375.

In Kubernetes, each Pod has its own network namespace, so localhost refers to the Pod itself, not the node. That's why your application can't find the Docker API on localhost:2375.

If you've enabled the Docker API on the node and want your application to access it, you need to change the value of DOCKER_HOST to the node's IP and Docker API port. For example, if your node's IP is 192.168.1.100, you can set the DOCKER_HOST value to tcp://192.168.1.100:2375.

Note that this is just an example. You need to replace 192.168.1.100 with your actual node IP.

Additionally, you need to make sure your application has permission to access the node's network. This might require setting hostNetwork: true in the Pod's specification.

Be aware that enabling the Docker API and using hostNetwork can pose security risks. You should ensure your network security and enable these options only in a trusted network.

4 I want to know if this is a bug or a configuration issue.

Error Exception

Failed to validate Docker registry, error: org.apache.hc.client5.http.HttpHostConnectException: Connect to http://localhost:2375 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

Screenshots

image image

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!(您是否要贡献这个PR?)

Code of Conduct

SoWhat-ET avatar Jun 06 '24 09:06 SoWhat-ET