我正在尝试使用 Terraform 在 Azure Kubernetes 服务 (AKS) 上设置 Jaeger Operator。我在为 Jaeger Operator 部署 Helm 版本时遇到了问题。我收到的错误消息表明 Jaeger Operator 运行所需的自定义资源定义 (CRD) 缺失,尤其是与 cert-manager 相关的自定义资源定义。
Terraform 代码:
resource "helm_release" "jaeger_operator" {
name = "jaeger-operator"
repository = "https://jaegertracing.github.io/helm-charts"
chart = "jaeger-operator"
version = "2.46.2"
depends_on = [helm_release.elastic]
}
错误信息:
│ Error: unable to build kubernetes objects from release manifest: [resource mapping not found for name: "jaeger-operator-service-cert" namespace: "default" from "": no matches for kind "Certificate" in version "cert-manager.io/v1"
│ ensure CRDs are installed first, resource mapping not found for name: "selfsigned-issuer" namespace: "default" from "": no matches for kind "Issuer" in version "cert-manager.io/v1"
│ ensure CRDs are installed first]
│
│ with module.kube.helm_release.jaeger_operator,
│ on ../modules/kube/jaeger.tf line 1, in resource "helm_release" "jaeger_operator":
│ 1: resource "helm_release" "jaeger_operator" {
│
我尝试在网上寻找解决方案,但一直无法找到此问题的明确解决方案。
我用这个 terraform 代码解决了这个问题:
resource "helm_release" "cert_manager" {
name = "cert-manager"
repository = "https://charts.jetstack.io"
chart = "cert-manager"
version = "v1.7.1"
namespace = var.namespace
set {
name = "installCRDs"
value = "true"
}
}