Release Notes
Announcements
Release Notes

status.allocatable.tke.cloud.tencent.com/eni-ip value of the nodes. When a Pod is in the Pending state due to insufficient ENI IP addresses, the network component will dynamically adjust this value. However, this process has a certain delay, causing the component to quickly start new nodes when it detects Pod Pending. It is strongly recommended to enable the static IP network mode when you create a cluster (in Terraform, you should configure is_non_static_ip_mode = false). In this way, the status.allocatable.tke.cloud.tencent.com/eni-ip value of the node will remain fixed, preventing unnecessary node creation.
apiVersion: karpenter.sh/v1kind: NodePoolmetadata:name: testannotations:kubernetes.io/description: "NodePool to restrict the number of cpus provisioned to 10"spec:# Disruption section which describes the ways in which Karpenter can disrupt and replace Nodes# Configuration in this section constrains how aggressive Karpenter can be with performing operations# like rolling Nodes due to them hitting their maximum lifetime (expiry) or scaling down nodes to reduce cluster costdisruption:consolidationPolicy: WhenEmptyOrUnderutilizedconsolidateAfter: 5mbudgets:- nodes: 10%template:metadata:annotations:# node.tke.cloud.tencent.com/automation-service Node automation service (TAT logon capacity)# node.tke.cloud.tencent.com/security-agent Node security reinforcement# node.tke.cloud.tencent.com/monitor-service Cloud Monitorbeta.karpenter.k8s.tke.machine.meta/annotations: node.tke.cloud.tencent.com/automation-service=true,node.tke.cloud.tencent.com/security-agent=true,node.tke.cloud.tencent.com/monitor-service=true# node.tke.cloud.tencent.com/beta-image specifies the node mirror, where ts4-public corresponds to tencentos server 4beta.karpenter.k8s.tke.machine.spec/annotations: node.tke.cloud.tencent.com/beta-image=ts4-publicspec:# Requirements that constrain the parameters of provisioned nodes.# These requirements are combined with pod.spec.topologySpreadConstraints, pod.spec.affinity.nodeAffinity, pod.spec.affinity.podAffinity, and pod.spec.nodeSelector rules.# Operators { In, NotIn, Exists, DoesNotExist, Gt, and Lt } are supported.# https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#operatorsrequirements:- key: kubernetes.io/archoperator: Invalues: ["amd64"]- key: kubernetes.io/osoperator: Invalues: ["linux"]- key: karpenter.k8s.tke/instance-familyoperator: Invalues: ["S5","SA2"]- key: karpenter.sh/capacity-typeoperator: Invalues: ["on-demand"]# - key: node.kubernetes.io/instance-type# operator: In# values: ["S5.MEDIUM2", "S5.MEDIUM4"]- key: "karpenter.k8s.tke/instance-cpu"operator: Gtvalues: ["1"]# - key: "karpenter.k8s.tke/instance-memory-gb"# operator: Gt# values: ["3"]# References the Cloud Provider's NodeClass resourcenodeClassRef:group: karpenter.k8s.tkekind: TKEMachineNodeClassname: default# Resource limits constrain the total size of the pool.# Limits prevent Karpenter from creating new instances once the limit is exceeded.limits:cpu: 10
Selector | Description |
topology.kubernetes.io/zone | Availability zone of the instance, such as 900001. |
kubernetes.io/arch | Instance architecture. Currently only amd64 is supported. |
kubernetes.io/os | Operating system. Currently only linux is supported. |
karpenter.k8s.tke/instance-family | Model instance family, such as S5 and SA2. |
karpenter.sh/capacity-type | Instance billing mode, such as on-demand. |
node.kubernetes.io/instance-type | Instance specifications, such as S5.MEDIUM2. |
karpenter.k8s.tke/instance-cpu | Number of CPUs for an instance, such as 4. |
karpenter.k8s.tke/instance-memory-gb | Memory size of an instance, such as 8. |
topology.kubernetes.io/zone: "900001", and establishes correspondence between the tag value (such as topology.com.tencent.cloud.csi.cbs/zone: ap-singapore-1) of topology.com.tencent.cloud.csi.cbs/zone and the actual availability zone description. You can view the zone and zone ID of your subnet using the command describe tmnc Namexxx.karpenter.k8s.tke/instance-cpu: 2, but the nodepool requirements have been modified as follows:template: spec: requirements: - key: "karpenter.k8s.tke/instance-cpu" operator: Gt values: ["2"]
karpenter.k8s.tke/instance-cpu: 2 is not Gt 2, the nodeclaim will be replaced. If you want to ignore Drifted disruption, you should add the following disruption settings to the node pool:disruption:consolidationPolicy: WhenEmptyOrUnderutilizedconsolidateAfter: 5mbudgets:- nodes: "0"reasons: [Drifted]- nodes: 10%
expireAfter: 720h | Never
spec.template.spec.expireAfter field defines the duration for a node to survive in a cluster before the node is removed, reducing problems caused by nodes running for a long time, such as file fragmentation or memory leaks in system processes. Since this parameter will lead to regular termination and reconstruction of nodes, you can completely disable expiration by setting this field to the string value Never, to avoid business impact during the reconstruction process.spec.template.spec.nodeClassRef. Multiple NodePools may point to the same TKEMachineNodeClass.apiVersion: karpenter.k8s.tke/v1beta1kind: TKEMachineNodeClassmetadata:name: defaultannotations:kubernetes.io/description: "General purpose TKEMachineNodeClass"spec:## using kubectl explain tmnc.spec.internetAccessible to check how to use internetAccessible filed.# internetAccessible:# chargeType: TrafficPostpaidByHour# maxBandwidthOut: 2## using kubectl explain tmnc.spec.systemDisk to check how to use systemDisk filed.# systemDisk:# size: 60# type: CloudSSD## using kubectl explain tmnc.spec.dataDisks to check how to use systemDisk filed.# dataDisks:# - mountTarget: /var/lib/container# size: 100# type: CloudPremium# fileSystem: ext4subnetSelectorTerms:# repalce your tag which is already existed in https://console.tencentcloud.com/tag/taglist- tags:karpenter.sh/discovery: cls-xxx# - id: subnet-xxxsecurityGroupSelectorTerms:- tags:karpenter.sh/discovery: cls-xxx# - id: sg-xxxsshKeySelectorTerms:- tags:karpenter.sh/discovery: cls-xxx# - id: skey-xxx
# Get nodepoolkubectl get nodepool# Get nodeclaimkubectl get nodeclaim# Get TKEMachineNodeClass kubectl get tmnc# Check your cloud resources has been synced to nodeclasskubectl describe tmnc default
kubectl describe tmnc default command:Status:Conditions:Last Transition Time: 2024-08-21T09:17:26ZMessage:Reason: ReadyStatus: TrueType: ReadySecurity Groups:Id: sg-xxxSsh Keys:Id: skey-xxxId: skey-xxxId: skey-xxxSubnets:Id: subnet-xxxZone: ap-singapore-1Zone ID: 900001Id: subnet-xxxZone: ap-singapore-4Zone ID: 900004
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan