-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added Ingress Module #46
Conversation
…ClusterRoleBinding and ServiceAccount modules
…ates # Conflicts: # receiver/k8sclusterreceiver/internal/collection/collector.go # receiver/k8sclusterreceiver/internal/metadata/generated_config.go # receiver/k8sclusterreceiver/internal/metadata/generated_config_test.go # receiver/k8sclusterreceiver/internal/metadata/generated_resource_test.go # receiver/k8sclusterreceiver/metadata.yaml # receiver/k8sclusterreceiver/watcher.go
…ClusterRoleBinding and ServiceAccount modules
…ates # Conflicts: # receiver/k8sclusterreceiver/internal/collection/collector.go # receiver/k8sclusterreceiver/internal/gvk/gvk.go # receiver/k8sclusterreceiver/internal/metadata/generated_config.go # receiver/k8sclusterreceiver/internal/metadata/generated_config_test.go # receiver/k8sclusterreceiver/internal/metadata/generated_resource_test.go # receiver/k8sclusterreceiver/metadata.yaml # receiver/k8sclusterreceiver/watcher.go
rb := mb.NewResourceBuilder() | ||
rb.SetK8sIngressUID(string(i.GetUID())) | ||
rb.SetK8sIngressName(i.GetName()) | ||
rb.SetK8sClusterName("unknown") |
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.
Why is this hardcoded to "unknown"
?
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.
Here, we are just adding the "k8s.cluster.name" key, the "unknown" is fallback value,
when user will run the installation script the value will be filled
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.
return strings.Join(res, seperator) | ||
} | ||
|
||
func convertIngressRulesToString(rules []netv1.IngressRule) string { |
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.
Why do we need this function ? Can we just use https://pkg.go.dev/k8s.io/api/networking/v1#Ingress.String ?
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.
Tried rule.String()
functionality, but it converts complex structs into a string format. This would make it hard for our developers to understand when displaying rules in a detailed view on the side-panel.
Right now:
host=www.example.com&http=(paths=(path=/foo&pathType=Prefix&backend=(service=(name=service1&port=(number=80))));host=api.example.com&http=(paths=(path=/&pathType=Prefix&backend=(service=(name=api-service&port=(number=8080))))
With rule.String()
functionality:
&IngressRule{Host:www.example.com,IngressRuleValue:IngressRuleValue{HTTP:&HTTPIngressRuleValue{Paths:[]HTTPIngressPath{HTTPIngressPath{Path:/foo,Backend:IngressBackend{Resource:nil,Service:&IngressServiceBackend{Name:service1,Port:ServiceBackendPort{Name:,Number:80,},},},PathType:*Prefix,},},},},}&IngressRule{Host:api.example.com,IngressRuleValue:IngressRuleValue{HTTP:&HTTPIngressRuleValue{Paths:[]HTTPIngressPath{HTTPIngressPath{Path:/,Backend:IngressBackend{Resource:nil,Service:&IngressServiceBackend{Name:api-service,Port:ServiceBackendPort{Name:,Number:8080,},},},PathType:*Prefix,},},},},}
@tejaskokje-mw @bhogayatakb Which approach do you think is better?
@@ -258,6 +258,46 @@ resource_attributes: | |||
type: string | |||
enabled: true | |||
|
|||
k8s.ingress.uid: | |||
description: The UID of the Role. |
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 should be The UID of the Ingress
. Same for other metadata below.
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 see, Updated the metadata
3532e3c
to
9d45e18
Compare
* ENG-947 & ENG-1241: Removed Persistent-Volume from transformObject flow * ENG-947: Added Persistent-Volume-Claim flow * ENG-1948, ENG-1949 & ENG-1955: Added Role, RoleBinding, ClusterRole, ClusterRoleBinding and ServiceAccount modules * ENG-1948, ENG-1949 & ENG-1955: Added Role, RoleBinding, ClusterRole, ClusterRoleBinding and ServiceAccount modules * ENG-946: Added Ingresses modules * ENG-946: Changes in Ingresses modules * ENG-946: Changes in Ingresses modules
* ENG-947 & ENG-1241: Removed Persistent-Volume from transformObject flow * ENG-947: Added Persistent-Volume-Claim flow * ENG-1948, ENG-1949 & ENG-1955: Added Role, RoleBinding, ClusterRole, ClusterRoleBinding and ServiceAccount modules * ENG-1948, ENG-1949 & ENG-1955: Added Role, RoleBinding, ClusterRole, ClusterRoleBinding and ServiceAccount modules * ENG-946: Added Ingresses modules * ENG-946: Changes in Ingresses modules * ENG-946: Changes in Ingresses modules
Description:
ENG-946: Added Ingresses modules
Link to tracking Issue:
https://linear.app/middleware/issue/ENG-946/need-to-add-k8s-ingresses-data
Testing:
Tested on Stage, working fine there.