知识卡片
工作负载按需引用Secret
Deployment 可通过 envFrom.secretRef 把 Secret 的键值注入容器环境,使镜像无需内置数据库连接串。Secret 与工作负载需位于可引用的范围,并限制读取权限;环境变量仍可能经进程或诊断工具暴露,应按敏感信息管理。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 14 章《Deploying microservice APIs with Kubernetes》(源文件:_epub-src/OEBPS/Text/14.htm)
- 结论依据:原文在部署清单中用 envFrom.secretRef 加载 db-credentials,支持运行时注入敏感配置。
- 原始内容:we need to update the order service deployment to consume the secret and expose it as an environment variable. Listing 14.4 Consuming secrets as environment variables in a deployment # file: orders-service-deployment.yaml