1

在启用 AutoTLS 的 Knative文档中,它说我需要将其添加到configmap中的data块中:config-certmanager

issuerRef: |
  kind: ClusterIssuer
  name: letsencrypt-issuer

我能想到的唯一解决方案是使用null_resource带有kubectl patch命令的资源。但是,这样做会给我以下错误:Error running command 'kubectl patch configmap config-certmanager -n knative-serving --type merge --patch '{"data":{"issuerRef":"kind:ClusterIssuer"}}'': exit status 1. Output: Error from server: Invalid JSON Patch

我试图将命令分成两部分。我还尝试对两行使用一个null_resourcekind: ClusterIssuername: letsencrypt-issuer

我的代码:

resource "null_resource" "patch_config_certmanager_1" {
    provisioner "local-exec" {
        command = "kubectl patch configmap config-certmanager -n knative-serving --type merge --patch '{\"data\":{\"issuerRef\":\"kind:ClusterIssuer\"}}'"
    }
    
}
resource "null_resource" "patch_config_certmanager_2" {
    provisioner "local-exec" {
        command = "kubectl patch configmap config-certmanager -n knative-serving --type merge --patch '{\"data\":{\"issuerRef\":\"name:my-clusterissuer\"}}'"
    }
    
}

我究竟做错了什么?

4

0 回答 0