如何在application.yml中使用quarkus.kubernetes-config.secrets.enabled?

How to use quarkus.kubernetes-config.secrets.enabled in application.yml?

我正在努力使用 application.yml 读取机密。

当我这样做时:

quarkus:
    application:
        name: pi-quarkus-fund-persistence-service
    kubernetes-config:
        enabled: true
        fail-on-missing-config: false
        config-maps: pi-quarkus-fund-persistence-service-configmap
        secrets: pi-quarkus-fund-persistence-service-secrets
            enabled: true

构建失败:

Failed to build quarkus application: mapping values are not allowed here
    in 'reader', line 16, column 20:
                enabled: true
                        ^

时间:

quarkus:
    application:
        name: pi-quarkus-fund-persistence-service
    kubernetes-config:
        enabled: true
        secrets.enabled: true
        fail-on-missing-config: false
        config-maps: pi-quarkus-fund-persistence-service-configmap
        secrets: pi-quarkus-fund-persistence-service-secrets

构建失败:

Unrecognized configuration key "quarkus.kubernetes-config."secrets.enabled"" was provided; it will be ignored; verify that the dependency extension for this configuration is set or you did not make a typo

时间:

quarkus.kubernetes-config.secrets.enabled: true
quarkus:
    application:
        name: pi-quarkus-fund-persistence-service
    kubernetes-config:
        enabled: true
        fail-on-missing-config: false
        config-maps: pi-quarkus-fund-persistence-service-configmap
        secrets: pi-quarkus-fund-persistence-service-secrets

构建成功但服务在启动时失败:

从 Secrets [pi-quarkus-fund-persistence-service-secrets] 读取配置,但 quarkus.kubernetes-config.secrets.enabled 为 false。检查您的应用程序的服务帐户是否有足够的权限来读取机密。

当我查看此提交时:https://github.com/quarkusio/quarkus/commit/93f00af9444deafe950afa1fad60f56fceb81ca3

第 48 行:// TODO:应该在这里使用转换器

难道是因为属性不是yaml转过来的?

我认为这只是关于如何编写正确的 YAML。应该是:

quarkus:
    application:
        name: pi-quarkus-fund-persistence-service
    kubernetes-config:
        enabled: true
        fail-on-missing-config: false
        config-maps: pi-quarkus-fund-persistence-service-configmap
        secrets:
            ~: pi-quarkus-fund-persistence-service-secrets
            enabled: true

回想起来,quarkus.kubernetes-config.secrets.enabled 不是此配置的最佳选择 属性,对此感到抱歉:-(