Tuesday, 2021-06-29

opendevreviewMerged openstack/kuryr-kubernetes master: Use correct logger when setting pyroute2 log level  https://review.opendev.org/c/openstack/kuryr-kubernetes/+/79795608:35
digitalsimbojaHello! Is there a call to get all Kuryr CRDs on k8s and also to get all Loadbalancers on OpenStack at the moment? I mean 'ALL' and not a single resource? I am afraid I might have come across this but I doubt14:03
digitalsimbojaThanks14:03
digitalsimbojaFor now I can only get a single resource and not able to fetch all resources before I can loop through14:03
digitalsimbojaAppreciate any assist14:03
digitalsimbojaThanks14:03
ltomasboyou can get all the CRDs with "kubectl get CRD_TYPE -A"14:16
ltomasbodigitalsimboja, ^14:16
ltomasboand for the openstack, "openstack loadbalancer list" should list them all14:17
digitalsimbojaNo I mean on the code?14:17
digitalsimbojais their a get_loadbalancer_crds()14:17
digitalsimbojawhich would return all the CRDs on k8s?14:18
ltomasbothe crd is another API resource, so you can list the resources in a similar way as how it is done for listing all the pods or all the services14:18
digitalsimbojaalright perfect14:18
digitalsimbojaI wanted to be sure there is none method currently listing that14:19
ltomasboyou can check how that is done for other resources, for instance in here: https://github.com/openstack/kuryr-kubernetes/blob/master/kuryr_kubernetes/controller/drivers/utils.py14:20
ltomasbothere are similar calls being made for networkpolicy CRDs14:20
ltomasboso, you can easily translate that for loadbalancer CRD14:20
ltomasboyou can create a new function for that, if not yet there, in a similar way as how the get_kuryrnetworkpolicy_crds is there14:21
ltomasboregarding how to get all the loadbalancers, I think I pointing one previous example in the code14:24
ltomasbothis one should help you understand how to do it:14:25
ltomasbohttps://github.com/openstack/kuryr-kubernetes/blob/stable/ussuri/kuryr_kubernetes/controller/handlers/lbaas.py#L647-L65014:25
ltomasbodigitalsimboja, ^14:25
digitalsimbojachecking14:25
digitalsimbojaPerfect!!!!14:26
digitalsimbojaThis is loading all the loadbalancers on OpenStack14:26
digitalsimbojaThank you very much!14:26
ltomasbodigitalsimboja, in that example, it is getting all the loadbalancers that match the expresion on the lbaas_spec var14:27
ltomasboso, as that is only adding the tags... it is just returning all the loadbalancers that have a given tag14:28

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!