You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "531651225 (via GitHub)" <gi...@apache.org> on 2023/10/31 10:32:29 UTC
[PR] [FIX] fix ingrress to flink ui static resources 404 [incubator-streampark]
531651225 opened a new pull request, #3302:
URL: https://github.com/apache/incubator-streampark/pull/3302
<!--
Thank you for contributing to StreamPark! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
## Contribution Checklist
- If this is your first time, please read our contributor guidelines: [Submit Code](https://streampark.apache.org/community/submit_guide/submit_code).
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-streampark/issues).
- Name the pull request in the form "[Feature] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- If the PR is unfinished, add `[WIP]` in your PR title, e.g., `[WIP][Feature] Title of the pull request`.
-->
## What changes were proposed in this pull request
refer to https://github.com/apache/incubator-streampark/issues/3301
Issue Number: close #3301 <!-- REMOVE this line if no issue to close -->
<!--(For example: This pull request proposed to add checkstyle plugin).-->
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
## Verifying this change
This change added tests and can be verified as follows:

<!--*(Please pick either of the following options)*-->
<!--*(example:)*
- *Added integration tests for end-to-end.*
- *Added *Test to verify the change.*
- *Manually verified the change by testing locally.* -->
## Does this pull request potentially affect one of the following parts
- Dependencies (does it add or upgrade a dependency): (no)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FIX] fix ingrress to flink ui static resources 404 [incubator-streampark]
Posted by "Al-assad (via GitHub)" <gi...@apache.org>.
Al-assad merged PR #3302:
URL: https://github.com/apache/incubator-streampark/pull/3302
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FIX] fix ingrress to flink ui static resources 404 [incubator-streampark]
Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys commented on PR #3302:
URL: https://github.com/apache/incubator-streampark/pull/3302#issuecomment-1788366691
cc @Al-assad PTAH, thx
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FIX] fix ingrress to flink ui static resources 404 [incubator-streampark]
Posted by "531651225 (via GitHub)" <gi...@apache.org>.
531651225 commented on code in PR #3302:
URL: https://github.com/apache/incubator-streampark/pull/3302#discussion_r1378591394
##########
streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala:
##########
@@ -47,11 +47,15 @@ trait IngressStrategy {
}
}
- def buildIngressAnnotations(clusterId: String): Map[String, String] = {
+ def buildIngressAnnotations(clusterId: String, namespace: String): Map[String, String] = {
val annotations = Map(
"nginx.ingress.kubernetes.io/rewrite-target" -> "/$2",
"nginx.ingress.kubernetes.io/proxy-body-size" -> "1024m",
- "nginx.ingress.kubernetes.io/configuration-snippet" -> ("rewrite ^(/" + clusterId + ")$ $1/ permanent;")
+ "nginx.ingress.kubernetes.io/configuration-snippet" -> ("rewrite ^(/" + clusterId + ")$ $1/ permanent;" + String
+ .format(
Review Comment:
THKS, already fix it. PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FIX] fix ingrress to flink ui static resources 404 [incubator-streampark]
Posted by "531651225 (via GitHub)" <gi...@apache.org>.
531651225 commented on code in PR #3302:
URL: https://github.com/apache/incubator-streampark/pull/3302#discussion_r1378590060
##########
streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategyV1.scala:
##########
@@ -55,11 +55,12 @@ class IngressStrategyV1 extends IngressStrategy {
val ingress = new IngressBuilder()
.withNewMetadata()
.withName(clusterId)
- .addToAnnotations(buildIngressAnnotations(clusterId).asJava)
+ .addToAnnotations(buildIngressAnnotations(clusterId, nameSpace).asJava)
.addToLabels(buildIngressLabels(clusterId).asJava)
.addToOwnerReferences(ownerReference) // Add OwnerReference
.endMetadata()
.withNewSpec()
+ .withIngressClassName("nginx")
Review Comment:
THKS, i agree whith you. already fix it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FIX] fix ingrress to flink ui static resources 404 [incubator-streampark]
Posted by "Al-assad (via GitHub)" <gi...@apache.org>.
Al-assad commented on code in PR #3302:
URL: https://github.com/apache/incubator-streampark/pull/3302#discussion_r1378374269
##########
streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala:
##########
@@ -47,11 +47,15 @@ trait IngressStrategy {
}
}
- def buildIngressAnnotations(clusterId: String): Map[String, String] = {
+ def buildIngressAnnotations(clusterId: String, namespace: String): Map[String, String] = {
val annotations = Map(
"nginx.ingress.kubernetes.io/rewrite-target" -> "/$2",
"nginx.ingress.kubernetes.io/proxy-body-size" -> "1024m",
- "nginx.ingress.kubernetes.io/configuration-snippet" -> ("rewrite ^(/" + clusterId + ")$ $1/ permanent;")
+ "nginx.ingress.kubernetes.io/configuration-snippet" -> ("rewrite ^(/" + clusterId + ")$ $1/ permanent;" + String
+ .format(
Review Comment:
It can be made more concise by modifying it to:
```scala
"nginx.ingress.kubernetes.io/configuration-snippet" -> s"rewrite ^(/ $clusterId )$$ $$1/ permanent; sub_filter '<base href=\"./\">' '<base href=\"/$namespace/$clusterId/\">'; sub_filter_once off;"
```
##########
streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategyV1.scala:
##########
@@ -55,11 +55,12 @@ class IngressStrategyV1 extends IngressStrategy {
val ingress = new IngressBuilder()
.withNewMetadata()
.withName(clusterId)
- .addToAnnotations(buildIngressAnnotations(clusterId).asJava)
+ .addToAnnotations(buildIngressAnnotations(clusterId, nameSpace).asJava)
.addToLabels(buildIngressLabels(clusterId).asJava)
.addToOwnerReferences(ownerReference) // Add OwnerReference
.endMetadata()
.withNewSpec()
+ .withIngressClassName("nginx")
Review Comment:
I think there is no need to set the ingressClass forcibly. The default value of ingressClass is "". Kubernetes will choose the default ingressClass, which is "nginx" for many Kubernetes instances. However, there are also some special cases, such as the default ingress provided by some cloud providers for Kubernetes not being nginx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org