You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "senlizishi (via GitHub)" <gi...@apache.org> on 2023/04/03 04:14:48 UTC
[GitHub] [incubator-streampark] senlizishi opened a new issue, #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
senlizishi opened a new issue, #2553:
URL: https://github.com/apache/incubator-streampark/issues/2553
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/incubator-streampark/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
### Java Version
_No response_
### Scala Version
2.12.x
### StreamPark Version
2.0.0
### Flink Version
1.16.1
### deploy mode
kubernetes-application
### What happened
After I configured Ingress, I found that I could not access the web UI.. After investigation, it is found that in the `IngressController.ingressUrlAddress()` method, the ingress address is obtained by obtaining the `field.cattle.io/publicEndpoints` annotation in the Ingress Metadata. When I debugged at the breakpoint, I found that the annotation did not exist in the Metadata of the ingress I deployed, which caused the failure to obtain the ingress address.
This is related to the `ingress controller` type, not all `ingress controller` types support generating this annotation. Therefore, it may be necessary to change the way to obtain the Ingress address.
### Error Exception
_No response_
### Screenshots
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!(您是否要贡献这个PR?)
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampark] Al-assad commented on issue #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
Posted by "Al-assad (via GitHub)" <gi...@apache.org>.
Al-assad commented on issue #2553:
URL: https://github.com/apache/incubator-streampark/issues/2553#issuecomment-1499286813
Good Job! I noticed something interesting when reading the Streampark code - it obtains Ingress information through Rancher's specific metadata. However, the default fabric8 kubeclient uses the `networking.k8s.io/v1beta1` API, which unfortunately has been officially deprecated since Kubernetes 1.22.
For changes to the Ingress API, please refer to: [https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122)
To ensure a more complete modification approach, both v1 and v1beta versions of the Ingress API should be retained, with v1 taking priority.
I've written a quick implementation that I hope will be helpful to you. Looking forward to seeing your PR soon :)
```scala
// for kubernetes 1.22+
lazy val fromV1 = Option(client.network.v1.ingresses.inNamespace("infra").withName("minio-test").get)
.map(ingress => ingress.getSpec.getRules.get(0))
.map(rule => rule.getHost -> rule.getHttp.getPaths.get(0).getPath)
// for kubernetes 1.22-
lazy val fromV1beta1 = Option(client.network.v1beta1.ingresses.inNamespace("infra").withName("minio-test").get)
.map(ingress => ingress.getSpec.getRules.get(0))
.map(rule => rule.getHost -> rule.getHttp.getPaths.get(0).getPath)
Try {
fromV1.orElse(fromV1beta1)
.map((host, path) => s"https://$host/$path")
.map(println)
}.getOrElse(throw new RuntimeException("[StreamPark] get ingressUrlAddress error."))
```
--
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
[GitHub] [incubator-streampark] Al-assad commented on issue #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
Posted by "Al-assad (via GitHub)" <gi...@apache.org>.
Al-assad commented on issue #2553:
URL: https://github.com/apache/incubator-streampark/issues/2553#issuecomment-1493687676
This is certainly an issue that needs to be addressed. The original code fetches the ingress address information from `field.cattle.io/publicEndpoints`, but this is specific to the Rancher ingress provider and is unlikely to work with other providers.
Can you provide more detailed suggestions for fixing this? I'm eager to hear your ideas.😃
--
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
[GitHub] [incubator-streampark] wolfboys closed issue #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys closed issue #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
URL: https://github.com/apache/incubator-streampark/issues/2553
--
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
[GitHub] [incubator-streampark] senlizishi commented on issue #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
Posted by "senlizishi (via GitHub)" <gi...@apache.org>.
senlizishi commented on issue #2553:
URL: https://github.com/apache/incubator-streampark/issues/2553#issuecomment-1493742679
@Al-assad As you said, after reviewing some information, I found that `field.cattle.io/publicEndpoints` annotation is related to the 'Rancher address provider'.But I don't have the Rancher platform for testing, so I'm not sure if it's really what I think :sweat_smile: .
I suggest modifying it as follows:
```scala
try {
val client = new DefaultKubernetesClient
val ingress = client.network.ingress.inNamespace(nameSpace).withName(clusterId).get
val rules = ingress.getSpec.getRules
val hostname = rules.get(0).getHost
val path = rules.get(0).getHttp.getPaths.get(0).getPath
logger.info(s"Retrieve flink cluster $clusterId successfully, JobManager Web Interface: https://$hostname$path")
s"https://$hostname$path"
} catch {
case e: Exception => throw new RuntimeException("[StreamPark] get ingressUrlAddress error.", e)
}
```
Use the above method instead of the old way of getting information from annotations, which will be more general. What do you think of this plan ?
--
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
[GitHub] [incubator-streampark] senlizishi commented on issue #2553: [Bug] Ingress Metadata cannot obtain the 'field. title. io/publicEndpoints' annotation
Posted by "senlizishi (via GitHub)" <gi...@apache.org>.
senlizishi commented on issue #2553:
URL: https://github.com/apache/incubator-streampark/issues/2553#issuecomment-1499838678
@Al-assad thanks for your advice :smile:
--
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