如何在 Kubernetes 中正确挂载带有 subPath 的 configMap?更改后不更新配置

Rom*_*man 5 kubernetes

我尝试使用 configMap 在子目录中安装一些配置。例如:

spec.template.spec.containers.[0].volumeMounts:
  - name: fh16-volume
    mountPath: /etc/fh-16/application.log
    subPath: my-config.txt
spec.template.spec.volumes:
  - name: fh16-volume
    configMap:
      name: my-config
Run Code Online (Sandbox Code Playgroud)

在这种情况下,所有内容都会按预期安装。但在 configMap 发生任何更改后,此更改不会应用到容器中。需要为此重新创建 pod。

它看起来像是一些错误,但也许我在配置中犯了一些错误?在我不使用 subPath 指令的情况下,一切都会按预期工作。

Sla*_*hin 0

看起来像一些错误

是的,它是:https ://github.com/kubernetes/kubernetes/issues/50345