8000 fix(k8s): Do not hard code the FQDN by gaocegege · Pull Request #3422 · jina-ai/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

fix(k8s): Do not hard code the FQDN #3422

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

Merged
merged 3 commits into from
Sep 17, 2021
Merged

Conversation

gaocegege
Copy link
Contributor

It is not recommended to hard code service FQDN.

Ref https://github.com/kubernetes/dns/blob/master/docs/specification.md

The cluster domain can be configured by the CoreDNS/KubeDNS, and it can be run without the FQDN.

@gaocegege gaocegege requested a review from a team as a code owner September 16, 2021 08:35
@codecov
Copy link
codecov bot commented Sep 16, 2021

Codecov Report

Merging #3422 (593ec38) into master (e8dcccc) will increase coverage by 0.33%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3422      +/-   ##
==========================================
+ Coverage   90.01%   90.34%   +0.33%     
==========================================
  Files         152      152              
  Lines       10907    10907              
==========================================
+ Hits         9818     9854      +36     
+ Misses       1089     1053      -36     
Flag Coverage Δ
daemon 45.69% <0.00%> (ø)
jina 90.33% <100.00%> (+0.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/peapods/pods/k8s.py 91.86% <ø> (ø)
jina/peapods/pods/k8slib/kubernetes_deployment.py 94.82% <100.00%> (ø)
jina/peapods/peas/__init__.py 85.89% <0.00%> (-4.49%) ⬇️
jina/peapods/pods/compound.py 90.34% <0.00%> (-1.38%) ⬇️
jina/peapods/zmq/__init__.py 89.04% <0.00%> (+0.23%) ⬆️
jina/peapods/runtimes/gateway/http/app.py 92.40% <0.00%> (+1.26%) ⬆️
jina/flow/base.py 89.91% <0.00%> (+1.59%) ⬆️
jina/peapods/runtimes/zmq/asyncio.py 92.98% <0.00%> (+1.75%) ⬆️
jina/types/routing/table.py 94.06% <0.00%> (+3.38%) ⬆️
jina/peapods/grpc/__init__.py 91.20% <0.00%> (+4.39%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a70c35d...593ec38. Read the comment docs.

8000
Copy link
Contributor
@jacobowitz jacobowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the change, looks good to me!

I think you just have to adapt some more tests for CI to pass

===End Flaky Test Report=== =========================== short test summary info ============================ FAILED tests/unit/peapods/pods/test_k8s_pod.py::test_deployments[gateway-1-expected_deployments0] FAILED tests/unit/peapods/pods/test_k8s_pod.py::test_deployments[test-pod-1-expected_deployments1] FAILED tests/unit/peapods/pods/test_k8s_pod.py::test_deployments[test-pod-2-expected_deployments2] FAILED tests/unit/peapods/pods/k8slib/test_kubernetes_deployment.py::test_deploy_service[None-None] FAILED tests/unit/peapods/pods/k8slib/test_kubernetes_deployment.py::test_deploy_service[init_container1-None] FAILED tests/unit/peapods/pods/k8slib/test_kubernetes_deployment.py::test_deploy_service[None-/test] ====== 6 failed, 206 passed, 10 skipped, 3 warnings in 217.04s (0:03:37) ======= Error: Process completed with exit code 1.

https://github.com/jina-ai/jina/pull/3422/checks?check_run_id=3619423946

@jacobowitz jacobowitz self-assigned this Sep 16, 2021
@gaocegege
Copy link
Contributor Author

Sure, will fix them ASAP. Thanks for your review.

@florian-hoenicke
Copy link
Member

@gaocegege Thanks, I did not know that we can just skip the last part of the domain name.
Will this always work when deploying it to a cluster?

@gaocegege
Copy link
Contributor Author
gaocegege commented Sep 17, 2021

@gaocegege Thanks, I did not know that we can just skip the last part of the domain name.
Will this always work when deploying it to a cluster?

There are two situations with the DNS configuration:

  • The cluster domain is configured to xxx.xxx (default value is cluster.local)
  • The cluster domain is by default to cluster.local

The PR should work with these two situations.

It will not work if the deployment is using hostNetwork. But it is not caused by this PR, it is caused by the DNSPolicy defined in https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy I do not see the scenario in Jina core, thus I do not think we should care about it.

@gaocegege
Copy link
Contributor Author

Do we have the integration test with Kubernetes?

Copy link
Contributor
@jacobowitz jacobowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the PR 👍
I think its good to go. There are also K8s intergration tests in tests/k8s
They are still working so our use cases should be fine with this change.

95AE

@jacobowitz jacobowitz merged commit e7d569c into jina-ai:master Sep 17, 2021
@gaocegege gaocegege deleted the svc branch September 17, 2021 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0