AWS Karpenter CRD 安装不正确

问题描述 投票:0回答:0

我通过 Helm Chart 将 Karpenter 安装到我的 EKS 集群https://github.com/aws/karpenter/tree/main/charts/karpenter。这是一次升级,所以我已经手动升级了 CRD https://karpenter.sh/v0.28/upgrade-guide/

    kubectl apply -f https://raw.githubusercontent.com/aws/karpenter/v0.28.0/pkg/apis/crds/karpenter.sh_provisioners.yaml
    kubectl apply -f https://raw.githubusercontent.com/aws/karpenter/v0.28.0/pkg/apis/crds/karpenter.sh_machines.yaml
    kubectl apply -f https://raw.githubusercontent.com/aws/karpenter/v0.28.0/pkg/apis/crds/karpenter.k8s.aws_awsnodetemplates.yaml

但是,问题是,虽然 Helm Chart 已安装,但

AWSNodeTemplate
Provisioner
的自定义清单并未安装。我收到以下错误:

错误: Bottlerocket 无法创建 kubernetes Rest 客户端以更新 资源:资源 [karpenter.k8s.aws/v1alpha1/AWSNodeTemplate] 无效 集群,检查 APIVersion 和 Kind 字段是否有效 与 kubectl_manifest.karpenter_br_spot_nt 在 karpenter.tf 第 120 行,资源“kubectl_manifest”“karpenter_br_spot_nt”中:

用我的地形代码:

resource "kubectl_manifest" "karpenter_br_spot_nt" {
  depends_on = [helm_release.karpenter]
  yaml_body  = templatefile("templates/manifests/karpenter.k8s.aws/nodetemplate.yaml", {
          CLUSTER_NAME   = local.cluster_name
          SECURITY_GROUP = module.eks.node_security_group_id
      })
}

编辑 这是节点模板文件:

apiVersion: karpenter.k8s.aws/v1alpha1
kind: AWSNodeTemplate
metadata:
  name: bottlerocket
spec:
  amiFamily: Bottlerocket
  subnetSelector:
    karpenter.sh/discovery/${CLUSTER_NAME}: "shared"
  securityGroupSelector:
    aws-ids: "${SECURITY_GROUP}"
  tags:
    Name: "${CLUSTER_NAME}-br"
    karpenter.sh/discovery: "${CLUSTER_NAME}"
    karpenter.sh/discovery/${CLUSTER_NAME}: "shared"
    map-migrated: d-server-00zvzpo0tu9l7i
  blockDeviceMappings:
    - deviceName: /dev/xvda
      ebs:
        volumeType: gp3
        volumeSize: 4Gi
        deleteOnTermination: true
        encrypted: true
    - deviceName: /dev/xvdb
      ebs:
        volumeType: gp3
        volumeSize: 250Gi
        deleteOnTermination: true
        encrypted: true**

编辑** 我发现我能够在这个模板上手动执行 kubectl apply,所以这显然是一个 terraform 问题。

kubernetes terraform kubernetes-helm terraform-provider-kubernetes
© www.soinside.com 2019 - 2024. All rights reserved.