You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Link to the issue (please include a link to the specific documentation or example):
I have the following command line below. It gives me the namespaces and ingressroutes names (see the Example below)
kubectl --context mlf-eks-dev get --all-namespaces ingressroutes
Example
NAMESPACE NAME AGE
aberdeentotalyes aberdeentotalgeyes-yesgepi 98d
Description of the issue (please include outputs or screenshots if possible):
I'm trying to replicate the results above with the python library client for Kubernetes.
I"m trying to replicate the kubetl command line above through my python code, using the python client for kubernetes but I miss on the option, on how to get the ingressroutes.
#My python code
from kubernetes import client, config
# Configs can be set in Configuration class directly or using helper utility
config.load_kube_config()
v1 = client.CoreV1Api()
print("Listing pods with their IPs:")
ret = v1.list_pod_for_all_namespaces(watch=False)
for i in ret.items:
print("%s\t%s" % (i.metadata.namespace, i.metadata.name))
Activity
tomplus commentedon Mar 5, 2021
I guess the context which you pass to kubectl may be important. Could you try to run:
kubectl get --all-namespaces ingressroutes?andy-kwo-any commentedon Mar 8, 2021
Hi @tomplus,
Thank you. The command you gave me, seems to be my initial command line without the
context.Best regards,
Andy
roycaihw commentedon Mar 15, 2021
/assign
roycaihw commentedon Mar 15, 2021
It looks like you were using the
list_pod_for_all_namespacesfunction and you want alist_ingressroute_for_all_namespacesfunction.ingressrouteis a CRD so it doesn't have a dedicated function for it. You can use the dynamic custom_object functions and pass in thegroup, version, pluralofingressroute: https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CustomObjectsApi.md#list_cluster_custom_object.Priyankasaggu11929 commentedon Apr 28, 2021
cc @Priyankasaggu11929
Priyankasaggu11929 commentedon May 2, 2021
/assign
add method 'list_ingressroute_for_all_namespaces' method
add method 'list_ingressroute_for_all_namespaces' method