在Kubernetes中获取字段引用列表的方法 [英] Way to get list of field references in Kubernetes

查看:223
本文介绍了在Kubernetes中获取字段引用列表的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在kubernetes中,我们可以通过环境变量轻松地暴露某些参数和值.这些示例可以是节点IP,容器uid等.

In kubernetes we can easily expose certain params and values through environment variables. Examples of these can be the node IP, the container uid, etc.

示例

 - name: POD_ID
      valueFrom:
        fieldRef:
          fieldPath: metadata.uid

但是,我想知道是否有一种方法可以列出吊舱中可能包含的引用.可以采用API引用的形式,也可以动态地放在pod上.

However, I was wondering if there is a way to list the possible references that can be included in the pod. Either in the form of an API reference or dynamically on a pod.

推荐答案

我自己弄清楚了,您只能引用kubectl edit pod <podname>吊舱时也会公开的变量.

Figured it out myself, you can only reference the variables that are also exposed if you kubectl edit pod <podname> a pod.

这篇关于在Kubernetes中获取字段引用列表的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆