opendevreview | Merged openstack/kuryr-kubernetes master: Use correct logger when setting pyroute2 log level https://review.opendev.org/c/openstack/kuryr-kubernetes/+/797956 | 08:35 |
---|---|---|
digitalsimboja | Hello! 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 doubt | 14:03 |
digitalsimboja | Thanks | 14:03 |
digitalsimboja | For now I can only get a single resource and not able to fetch all resources before I can loop through | 14:03 |
digitalsimboja | Appreciate any assist | 14:03 |
digitalsimboja | Thanks | 14:03 |
ltomasbo | you can get all the CRDs with "kubectl get CRD_TYPE -A" | 14:16 |
ltomasbo | digitalsimboja, ^ | 14:16 |
ltomasbo | and for the openstack, "openstack loadbalancer list" should list them all | 14:17 |
digitalsimboja | No I mean on the code? | 14:17 |
digitalsimboja | is their a get_loadbalancer_crds() | 14:17 |
digitalsimboja | which would return all the CRDs on k8s? | 14:18 |
ltomasbo | the 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 services | 14:18 |
digitalsimboja | alright perfect | 14:18 |
digitalsimboja | I wanted to be sure there is none method currently listing that | 14:19 |
ltomasbo | you 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.py | 14:20 |
ltomasbo | there are similar calls being made for networkpolicy CRDs | 14:20 |
ltomasbo | so, you can easily translate that for loadbalancer CRD | 14:20 |
ltomasbo | you can create a new function for that, if not yet there, in a similar way as how the get_kuryrnetworkpolicy_crds is there | 14:21 |
ltomasbo | regarding how to get all the loadbalancers, I think I pointing one previous example in the code | 14:24 |
ltomasbo | this one should help you understand how to do it: | 14:25 |
ltomasbo | https://github.com/openstack/kuryr-kubernetes/blob/stable/ussuri/kuryr_kubernetes/controller/handlers/lbaas.py#L647-L650 | 14:25 |
ltomasbo | digitalsimboja, ^ | 14:25 |
digitalsimboja | checking | 14:25 |
digitalsimboja | Perfect!!!! | 14:26 |
digitalsimboja | This is loading all the loadbalancers on OpenStack | 14:26 |
digitalsimboja | Thank you very much! | 14:26 |
ltomasbo | digitalsimboja, in that example, it is getting all the loadbalancers that match the expresion on the lbaas_spec var | 14:27 |
ltomasbo | so, as that is only adding the tags... it is just returning all the loadbalancers that have a given tag | 14:28 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!