我有一个 Docker 映像,其中包含一个 Python 应用程序,作为部署在 Kubernetes 中运行,我想向该应用程序传递一些数据。我使用了环境变量,但我想使用注释,但我不知道如何阅读它们,我看到有V1ObjectMeta一个名为的字段annotations,但我有点不知道如何调用它。
例如:
如果我的 Pod 有这个:
template:
metadata:
annotations:
foo: "var"
Run Code Online (Sandbox Code Playgroud)
如何foo: var使用 Kubernetes 库使用 pod 内运行的 python 程序进行读取?