English 中文(简体)
列出使用kubectl[复制]特定名称空间的所有物体
原标题:List all objects from a given namespace using kubectl [duplicate]

我愿列出所有以特定名称出现在青春期的物体。

kubectl get all -n <namespace>

上述指挥系统没有从指定名称空间列出所有现有物体。 是否有办法用库宾特罗来将他们列入名单?

i can list all objects that i want by passing them to kubectl. but i dont want that.

kubectl -n <namespace> get deployment,rs,sts,ds,job,cronjobs -oyaml
问题回答

以下所有规则中首先决定资源是否属于all。 类别或非类别。

这里的规则是,在输出。

  • 没有集群范围的资源

  • No namespace admin level resources (limits, quota, policy,
    authorization rules)

  • 没有可能无法收回的资源(秘密和临时)

  • Resources that are considered "similar" to #3 should be grouped the
    same (configmaps)

回答<> 取自rcorre s Response

kubectl api-resources --verbs=list --namespaced -o name 
  | xargs -n 1 kubectl get --show-kind --ignore-not-found -l <label>=<value> -n <namespace>

Lastly, If you want to add a Custom Resource in all category, you need to provide these field in your CRD spec. custom-resource-definitions:categories

# categories is a list of grouped resources the custom resource belongs to.
    categories:
    - all

Perhaps you could try this:

kubectl get `kubectl api-resources -o name | tr  
   ,  | sed  s/.$// `

资料来源:Github

For listing all the objects in your namespace:

kubectl get all -n=<namespace>

Try:

kubectl -n your_namespace get all




相关问题
HTTP call from Celery worker

I am running a Flask-Celery server in docker desktop Kubernetes. It uses a Redis Result Backend. I want to use a Celery Task to make an HTTP call to a program that might take a while. This program ...

Why my website cookies are not being set on my browser?

Hello I am developing a web app, with a microservices architecture. I am using golang (Fiber) on the backend and Next.js on the frontend. When I send a request from restaurant.quiqr.co/signin to api....

我如何终止Kubernetes的名称空间?

我正试图终止Kubernetes的名称空间。 过去,我uc切地遵循了在库韦涅斯这里发现的在终止地位方面摇摇摇欲坠的空地。

helm with if condition and its scope for the value set

I would like to overwrite the user template with .Values.userTemplate if it exist. But I always get $user as undefined when the .Vaues.userTemplate exist. If i remove if condition and use {{- $user := ...

热门标签