kustomize:cert-manager 证书通用名称中的命名空间(字符串内的变量)

kustomize: namespace in common name of cert-manager certificate (variable inside string)

我想使用 kustomize 创建一个 cert-manager 证书,其中 commonName-Field 的字符串包含命名空间。这可能吗?

开箱即用的 Kustomize 没有这样的选项来实现它。

幸运的是 Kustomize 提供了一个插件框架,允许您编写自己的“转换”插件。

您可以基于 Agilicus, released under Apache 2.0 license, specifically on the resemblance of the their certificatetransformer 插件中的现有插件集创建它,您需要在其中修改它以满足您的需要。

因此,与其让它替换 Certificate 资源中的命名空间,不如通过修改 ['spec']['commonName'] 列表来解决它。