- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
两者似乎都达到了相同的效果 - 在构建时配置一个 pod。
谁能解释一下这两者有什么区别?
如果您认为这会让它更清楚,也许还会给出一个简单的 1 个用例示例。
最佳答案
Pod 预设比 configmaps/secrets 更具可扩展性和强大功能,可将公共(public)信息注入(inject) Pod。
一个 Kubernetes 集群可能包含数百个 Pod。其中许多 Pod 共享常见的结构,例如环境变量、ConfigMaps、Secrets 等。例如,在使用 MySQL 的微服务的情况下,我们需要将 MySQL 凭据作为 K8s Secrets 注入(inject)到 Pod 中。如果集群有 100 个微服务(并不少见),我们需要在所有 100 个 pod 的配置中添加以下部分。
这是非常低效且容易出错的。 Pod Preset 通过在多个 Pod 中注入(inject)公共(public)信息来帮助我们避免这种情况,以便我们将所有公共(public)信息放在一个地方。
env:
- name: SECRET_USERNAME
valueFrom:
secretKeyRef:
name: mysecret
key: mysql-username
- name: SECRET_PASSWORD
valueFrom:
secretKeyRef:
name: mysecret
key: mysql-password
Motivation:
Consuming a service involves more than just connectivity. In addition to coordinates to reach the service, credentials and non-secret configuration parameters are typically needed to use the service. The primitives for this already exist, but a gap exists where loose coupling is desired: it should be possible to inject pods with the information they need to use a service on a service-by-service basis, without the pod authors having to incorporate the information into every pod spec where it is needed.
Use Cases
- As a user, I want to be able to provision a new pod without needing to know the application configuration primitives the services my pod will consume.
- As a cluster admin, I want specific configuration items of a service to be withheld visibly from a developer deploying a service, but not to block the developer from shipping.
- As an app developer, I want to provision a Cloud Spanner instance and then access it from within my Kubernetes cluster.
- As an app developer, I want the Cloud Spanner provisioning process to configure my Kubernetes cluster so the endpoints and credentials for my Cloud Spanner instance are implicitly injected into Pods matching a label selector (without me having to modify the PodSpec to add the specific Configmap/Secret containing the endpoint/credential data).
关于kubernetes - Kubernetes 中的 Pod 预设与 ConfigMap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61577043/
我想我读过一些可以在 cocoa 应用程序中包含 NSUserDefaults 文件的地方。我似乎无法找到如何做到这一点。 我知道我可以在第一次应用程序启动时创建,但我还不想这样做...... 最佳答
所以我有一个 HTML 表单,用户可以在其中通过选中三个预设答案之一或编写自己的自定义答案来回答单选题。 虽然这显然是一个多对多关系,但我仍然找不到合适的方法来设计数据库表以处理这两种类型(TEXT
这个问题在这里已经有了答案: Unexpected token '=' in React Component [duplicate] (2 个答案) 关闭 4 年前。 我在使用 Webpack 构建
我正在创建一个自定义相机 View ,并尝试查看是否有办法为输入和输出设置不同的 session 预设。我希望能够向用户展示高分辨率,但以低分辨率捕获 var captureSession: AVCa
我当前的设置如下(基于 Brad Larson 的 ColorTrackingCamera 项目): 我正在使用设置为 AVCaptureSessionPreset640x480 的 AVCaptur
我正在开发一个 React-Native 应用程序,它是使用 Expo 安装的,使用以下代码创建 .babelrc 配置: { "presets": ["babel-preset-expo"]
在一个工作 Jest + puppeteer 操作项目中, 为了使用 jest-circus retry feature,我要去 jest-circus . 正如所记录的,我安装了 jest-circ
这个问题已经有答案了: How to use arrow functions (public class fields) as class methods? (4 个回答) 已关闭 4 年前。 当我尝
我正在使用实现 Browserify-Rails 的 Rails 4.0 项目实现Babelify . 在我的本地和远程 Beta 服务器上,一切似乎都很顺利。但是当我部署到生产环境时,某些文件将被跳
我正在向 dat.gui 界面动态添加控件,但“保存设置”功能无法识别它们。 var mygui = new dat.GUI(); mygui.remember(mygui); // standard
我想创建一个录制方形视频的自定义相机。然而,所有的捕获 session 预设都不是方形格式 例如: 1920x1080 1280x720 640x480 无论如何我可以创建一个自定义预设。我仍然想要高
function floatTo16BitPCM(output, offset, input){ for (var i = 0; i < input.length; i++, offset+=2)
我正在阅读有关使用 systemd 预设的 Fedora 打包指南,但遗漏了一个关键点: 宏 %systemd_post 运行 systemctl preset 意味着有关是否启用或禁用该服务的信息必
错误描述:当为 javascript 代码的简单单元测试运行 jest 时,出现错误测试套件无法运行未知选项:.preset 以下是重现错误的文件: { "name": "Relocati
我正在尝试使用 ffmpeg 和 x264 对视频进行编码。我知道 ffmpeg 从命令行使用程序 ffmpeg 时可以使用 x264 预设。但是在代码中使用 ffmpeg 编码时是否可以轻松使用
我的 npm 包构建使用 babel 运行,我在我的 package.json 中配置了一个 babel 预设 "babel": { "presets": ["es2015"] } 我还配置了一个 m
我们正在尝试使用 javacpp 重新编译 ffmpeg 项目,并启用 --enable-libfdk-aac ,构建可以正常工作,但我们无法使用 libfdk_aac 来解码 audio_strea
美好的一天: 我刚刚通过 NPM 安装了 Babel Preset-ENV 并遇到了这个问题: [nodemon] starting `babel-node server.js server.js`
我正在通过 ffmpeg(在 C++ 程序中)使用 libx264,我需要知道如何激活“非常快”预设。 x264 源代码树中的 grep 生成: include/x264.h:static const
我正在处理的一个项目已经配置了 Jest,并且测试工作正常。这就是当前 jest.config.js 文件的样子; const ignores = [...]; const coverageIgnor
我是一名优秀的程序员,十分优秀!