Skip to content

how to get namespaces ingressroutes through  #1388

@andy-kwo-any

Description

@andy-kwo-any

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))

The results are below

wwwpaulolo   ci-job-backup-2kt6f
wwwpaulolo   wwwpaulolo-maowordpress-7dddccf44b-ftpbq
wwwvhugo        ci-job-backup-dz5hs
wwwvhugo        wwwvhua-maowordpress-5f7bdfdccd-v7kcx

I have the namespaces but not the ingressroutes, as I don't know how can I get it.

Question is what is the option to have the ingressroutes, please?

Any helps are more than welcomed.

Cheers

Metadata

Metadata

Labels

kind/documentationCategorizes issue or PR as related to documentation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions