-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
feat: Make Argo UI aware of OpenShift objects#4601 #5096
Conversation
Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>
@alexmt can you review this ? |
@iam-veeramalla do you mind to create an issue to describe the enhancement? It would be nice to include some screen shots to illustrate the enhancement. |
Sure @wtam2018 |
Argo renders the Ingress url for Ingress resource deployed in k8s and shows it in the ingress object under network map, This will help users to access their applications(pods) directly from the Argo UI. This feature is not available for openshift routes as Argo does not identify/render/provide any route details. Also, by the nature of openshift, it will convert any ingress resource into routes. So, Argo does not render the url, health details of k8s ingress or openshift routes deployed in openshift. So, the network map is technically not openshift friendly. This enhancement will allow users to access the openshift route url from Argo UI. This will make user experience better as they don't have to describe route using Another screenshot to explain how this enhancement will provide Openshift route object identified by Argo does not even provide the health details. I will create an issue for that and add it as a follow up enhancement to this. Please let me know, If you need more details. |
Fixes #4601 |
I'll take a look. |
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.
#4601 also propose to support DeploymentConfig
. Should we address it? We could do it in a different PR.
@@ -170,6 +191,45 @@ func populateIngressInfo(un *unstructured.Unstructured, res *ResourceInfo) { | |||
res.NetworkingInfo = &v1alpha1.ResourceNetworkingInfo{TargetRefs: targets, Ingress: ingress, ExternalURLs: urls} | |||
} | |||
|
|||
func populateRouteInfo(un *unstructured.Unstructured, res *ResourceInfo) { |
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.
I'd rename this function to populateOpenShiftRouteInfo
.
@@ -170,6 +191,45 @@ func populateIngressInfo(un *unstructured.Unstructured, res *ResourceInfo) { | |||
res.NetworkingInfo = &v1alpha1.ResourceNetworkingInfo{TargetRefs: targets, Ingress: ingress, ExternalURLs: urls} | |||
} | |||
|
|||
func populateRouteInfo(un *unstructured.Unstructured, res *ResourceInfo) { | |||
route := getRoute(un) |
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.
This function is more like getOpenShiftIngress()
?
Namespace: un.GetNamespace(), | ||
Name: fmt.Sprintf("%s", backend["name"]), | ||
}] = true | ||
} |
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.
There is only one to
backend service per route but there can be a list of alternateBackends
. Please see https://docs.openshift.com/container-platform/3.6/architecture/networking/routes.html#alternateBackends
|
||
if backend, ok, err := unstructured.NestedMap(un.Object, "spec", "to"); ok && err == nil { | ||
targetsMap[v1alpha1.ResourceRef{ | ||
Kind: kube.ServiceKind, |
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.
Currently, Kind
can only be Service
but should we not hardcode here? Perhaps, use backend["kind"]
instead?
res := make([]v1.LoadBalancerIngress, 0) | ||
for _, item := range route { | ||
if lbIngress, ok := item.(map[string]interface{}); ok { | ||
if hostname := lbIngress["routerCanonicalHostname"]; hostname != nil { |
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.
routerCanonicalHostname
is optional. Please see https://docs.openshift.com/container-platform/4.6/rest_api/network_apis/route-route-openshift-io-v1.html
urls = append(urls, url) | ||
} | ||
|
||
res.NetworkingInfo = &v1alpha1.ResourceNetworkingInfo{TargetRefs: targets, Ingress: route, ExternalURLs: urls} |
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.
I think we need to handle edge cases when we are unable to extract backend services, ingress, and urls.
One thing I know that Argo supports for Deployment, but not for DeploymentConfig, is the ability to trigger a rollout by using the "three dots menu" on Deployment object. And there is also the icon at object's box. |
any update for this PR? |
Codecov Report
@@ Coverage Diff @@
## master #5096 +/- ##
==========================================
+ Coverage 40.82% 40.90% +0.08%
==========================================
Files 133 133
Lines 18154 18189 +35
==========================================
+ Hits 7411 7440 +29
- Misses 9672 9675 +3
- Partials 1071 1074 +3
Continue to review full report at Codecov.
|
I started to work back on this. I will probably get a PR for this by end of the week :) |
@iam-veeramalla could you please update on this? Do you need some help? |
Closing for now, @iam-veeramalla feel free to reopen when ready. :-) |
Signed-off-by: iam-veeramalla abhishek.veeramalla@gmail.com
Checklist:
This PR will make Argo UI aware of OpenShift objects. It provides details such as the route url and services attached to route. This feature is currently available for ingress.
Fixes #4601 #7052