Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Support Karpenter
eksctlmemberikan dukungan untuk menambahkan Karpenter0.28.0+. Lihat bagian kompatibilitas Karpenter
Konfigurasi cluster berikut menguraikan instalasi Karpenter yang khas:
apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: cluster-with-karpenter region: us-west-2 version: '1.32' # requires a version of Kubernetes compatible with Karpenter tags: karpenter.sh/discovery: cluster-with-karpenter # here, it is set to the cluster name iam: withOIDC: true # required karpenter: version: '1.2.1' # Exact version should be specified according to the Karpenter compatibility matrix managedNodeGroups: - name: managed-ng-1 minSize: 1 maxSize: 2 desiredCapacity: 1
Versi ini adalah versi Karpenter karena dapat ditemukan di Repositori Helm mereka. Opsi berikut juga tersedia untuk diatur:
karpenter: version: '1.2.1' createServiceAccount: true # default is false defaultInstanceProfile: 'KarpenterNodeInstanceProfile' # default is to use the IAM instance profile created by eksctl withSpotInterruptionQueue: true # adds all required policies and rules for supporting Spot Interruption Queue, default is false
OIDC harus didefinisikan untuk menginstal Karpenter.
Setelah Karpenter berhasil diinstal, tambahkan NodePool(s)
nodeClassRefBagian NodePool ini harus cocok dengan nama sebuahEC2NodeClass. Misalnya:
apiVersion: karpenter.sh/v1 kind: NodePool metadata: name: example annotations: kubernetes.io/description: "Example NodePool" spec: template: spec: requirements: - key: kubernetes.io/arch operator: In values: ["amd64"] - key: kubernetes.io/os operator: In values: ["linux"] - key: karpenter.sh/capacity-type operator: In values: ["on-demand"] - key: karpenter.k8s.aws/instance-category operator: In values: ["c", "m", "r"] - key: karpenter.k8s.aws/instance-generation operator: Gt values: ["2"] nodeClassRef: group: karpenter.k8s.aws kind: EC2NodeClass name: example # must match the name of an EC2NodeClass
apiVersion: karpenter.k8s.aws/v1 kind: EC2NodeClass metadata: name: example annotations: kubernetes.io/description: "Example EC2NodeClass" spec: role: "eksctl-KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name subnetSelectorTerms: - tags: karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name securityGroupSelectorTerms: - tags: karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name amiSelectorTerms: - alias: al2023@latest # Amazon Linux 2023
Perhatikan bahwa Anda harus menentukan salah satu dari role atau instanceProfile untuk node lauch. Jika Anda memilih untuk menggunakan instanceProfile nama profil yang dibuat dengan eksctl mengikuti pola:eksctl-KarpenterNodeInstanceProfile-<cluster-name>.
Penandaan Grup Keamanan Otomatis
eksctlsecara otomatis menandai grup keamanan simpul bersama cluster karpenter.sh/discovery ketika kedua Karpenter diaktifkan (karpenter.versionditentukan) dan karpenter.sh/discovery tag ada di. metadata.tags Ini memungkinkan kompatibilitas AWS Load Balancer Controller.
Catatan dengan karpenter 0.32.0+, Penyedia telah usang dan diganti dengan. NodePool