apache / incubator-streampark

Make stream processing easier! Easy-to-use streaming application development framework and operation platform.
https://streampark.apache.org/
Apache License 2.0
3.79k stars 977 forks source link

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

Open SoWhat-ET opened 1 month ago

SoWhat-ET commented 1 month ago

Search before asking

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?

Code of Conduct

SbloodyS commented 2 weeks ago

You can try using docker login ${dockerUrl} to test it locally. @SoWhat-ET