-
Notifications
You must be signed in to change notification settings - Fork 922
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
Add Fabric8 Kubernetes client integration #5167
Conversation
Motivation: Related: fabric8io/kubernetes-client#5307 TBU
@ikhoon quick note that there are chaos tests that you can possibly re-use to test that the implementation is solid enough: |
Thanks for the tip. I will take a look. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5167 +/- ##
===========================================
+ Coverage 0 73.66% +73.66%
- Complexity 0 20636 +20636
===========================================
Files 0 1791 +1791
Lines 0 76335 +76335
Branches 0 9716 +9716
===========================================
+ Hits 0 56233 +56233
- Misses 0 15448 +15448
- Partials 0 4654 +4654 ☔ View full report in Codecov by Sentry. |
4a4d504
to
115ef47
Compare
kubernetes/build.gradle.kts
Outdated
api(libs.kubernetes.client.api) | ||
testImplementation(variantOf(libs.kubernetes.client.api) { classifier("tests") }) | ||
testImplementation(libs.kubernetes.server.mock) | ||
testImplementation(libs.logback13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Logback 1.3.x is required since the Fabric Kubernetes client uses SLF4J 2.0.
Should it be nicer to exclude SLF4J 2.0 from transitive dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible? If so, yes I think we should exclude it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Left some minor questions 🙇
|
||
```bash | ||
eval $(minikube -p minikube docker-env) | ||
./gradlew :it:kubernetes-chaos-tests:k8sBuild :it:kubernetes-chaos-tests:test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just plainly running this fails due to the gradle junit timeout (although I saw the @Timeout
annotation in the test). Were you able to get this to run in your environment?
org.awaitility.core.ConditionTimeoutException: Condition with com.linecorp.armeria.kubernetes.it.ChaosIT was not fulfilled within 1 minutes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've tested locally and debugged many problems.
The test might be failed due to a wrong setup.
Would you paste the output of docker images
?
kubernetes/src/test/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientTest.java
Outdated
Show resolved
Hide resolved
kubernetes/src/test/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpInterceptorTest.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/AsyncBodySubscriber.java
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClient.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientFactory.java
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientBuilder.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocketClient.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocket.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically looks good to me! Can you check the CI failures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks so nice! 🎉 🎉 🎉
I didn't see the chaos part though. 😅
core/src/main/java/com/linecorp/armeria/client/proxy/ProxyConfig.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocketClient.java
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientBuilder.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientBuilder.java
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientBuilder.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocket.java
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocket.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocket.java
Outdated
Show resolved
Hide resolved
.../test/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpHttpLoggingInterceptorTest.java
Outdated
Show resolved
Hide resolved
...st/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientNewWebSocketBuilderTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will review once more after #5357 is merged. Thanks! 🎉
kubernetes/build.gradle.kts
Outdated
api(libs.kubernetes.client.api) | ||
testImplementation(variantOf(libs.kubernetes.client.api) { classifier("tests") }) | ||
testImplementation(libs.kubernetes.server.mock) | ||
testImplementation(libs.logback13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible? If so, yes I think we should exclude it.
Excluded via
|
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/AsyncBodySubscriber.java
Outdated
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocket.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice, only left nit questions! Thanks @ikhoon 🙇 👍 🙇
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaWebSocket.java
Show resolved
Hide resolved
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/AsyncBodySubscriber.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM. 👍
Please address the comment from @jrhee17. 😉
Thanks for the thorough review! 🙇♂️ |
Motivation:
Fabric8 is one of the popular Kubernetes client implementations. It has an abstract layer for HTTP and WebSocket protocols.
If Armeria provides a Kubernetes client to better support the cloud infrastructure, other useful functions such as #4497 will be able to be implemented based on it.
Modifications:
kubernetes
module to provide FabricStandardHttpClient
.ArmeriaHttpClientFactory
is automatically activated via Java SPI.ProxyConfig
to configure proxy headers.WebSocketClient
to configureHttpHeaders
andRequestOptions
when starting a WebSocket session.Result:
You can use the Fabric Kubernetes client on top of the Armeria client.