Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
SoWhat-ET opened this issue Jun 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@SoWhat-ET
Copy link

Search before asking

  • 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?

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

Code of Conduct

@SoWhat-ET SoWhat-ET added the bug Something isn't working label Jun 6, 2024
@SbloodyS
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants