CRD 类型 | 操作项 |
MachineSet | 创建原生节点池 kubectl create -f machineset-demo.yaml |
| 查看原生节点池列表 kubectl get machineset |
| 查看原生节点池 YAML 详情 kubectl describe ms machineset-name |
| 删除原生节点池 kubectl delete ms machineset-name |
| 扩容原生节点池 kubectl scale --replicas=3 machineset/machineset-name |
Machine | 查看原生节点 kubectl get machine |
| 查看原生节点 YAML 详情 kubectl describe ma machine-name |
| 删除原生节点 kubectl delete ma machine-name |
HealthCheckPolicy | 创建故障检测自愈规则 kubectl create -f demo-HealthCheckPolicy.yaml |
| 查看故障自愈规则列表 kubectl get HealthCheckPolicy |
| 查看故障自愈规则 YAML 详情 kubectl describe HealthCheckPolicy HealthCheckPolicy-name |
| 删除故障自愈规则 kubectl delete HealthCheckPolicy HealthCheckPolicy-name |
apiVersion: node.tke.cloud.tencent.com/v1beta1kind: MachineSetspec:autoRepair: false #故障自愈开关displayName: testhealthCheckPolicyName: #自愈规则名称instanceTypes: #机型规格- S5.MEDIUM2replicas: 1 #节点数scaling: #自动扩缩容策略createPolicy: ZonePrioritymaxReplicas: 1subnetIDs: #节点池子网- subnet-nnwwb64wtemplate:metadata:annotations:node.tke.cloud.tencent.com/machine-cloud-tags: '[{"tagKey":"xxx","tagValue":"xxx"}]' #腾讯云标签spec:displayName: tke-np-mpam3v4b-worker #可自定义显示名称metadata:annotations:annotation-key1: annotation-value1 #自定义annotationslabels:label-test-key: label-test-value #自定义labelsproviderSpec:type: Nativevalue:dataDisks: #数据盘参数- deleteWithInstance: truediskID: ""diskSize: 50diskType: CloudPremiumfileSystem: ext4mountTarget: /var/lib/containerdinstanceChargeType: PostpaidByHour #节点付费模式keyIDs: #节点登陆SSH参数- skey-xxxlifecycle: #自定义脚本postInit: echo "after node init"preInit: echo "before node init"management: #management参数设置,包含kubelet\\kernel\\nameserver\\hostnamesecurityGroupIDs: #安全组配置- sg-xxxxxsystemDisk: #系统盘配置diskSize: 50diskType: CloudPremiumruntimeRootDir: /var/lib/containerdtaints: #污点 非必填- effect: NoExecutekey: taint-key2value: value2type: Native
kubectl create -f machineset-demo.yaml
根据上述 YAML 创建 MachineSet:
kubectl get machineset
查看 MachineSet np-pjrlok3w 状态。
kubectl describe machineset np-pjrlok3w
查看 MachineSet np-pjrlok3w 描述:
kubectl scale --replicas=2 machineset/np-pjrlok3w
执行节点池扩缩容:
kubectl delete ms np-pjrlok3w
删除节点池。
kubectl get machine
查看 Machine 列表,此时控制台上已存在对应节点:
kubectl describe ma np-14024r66-nv8bk
查看 Machine np-14024r66-nv8bk 描述:
kubectl delete ma np-14024r66-nv8bk
删除节点。
本页内容是否解决了您的问题?