CRD Type | Operation |
MachineSet | Creating a native node pool kubectl create -f machineset-demo.yaml |
| Viewing the list of native node pools kubectl get machineset |
| Viewing the YAML details of a native node pool kubectl describe ms machineset-name |
| Deleting a native node pool kubectl delete ms machineset-name |
| Scaling out a native node pool kubectl scale --replicas=3 machineset/machineset-name |
Machine | Viewing native nodes kubectl get machine |
| Viewing the YAML details of a native node kubectl describe ma machine-name |
| Deleting a native node kubectl delete ma machine-name |
HealthCheckPolicy | Creating a fault self-healing rule kubectl create -f demo-HealthCheckPolicy.yaml |
| Viewing the list of fault self-healing rules kubectl kubectl get HealthCheckPolicy |
| Viewing the YAML details of a fault self-healing rule kubectl describe HealthCheckPolicy HealthCheckPolicy-name |
| Deleting a fault self-healing rule kubectl delete HealthCheckPolicy HealthCheckPolicy-name |
apiVersion: node.tke.cloud.tencent.com/v1beta1kind: MachineSetspec:autoRepair: false #Fault self-healing switchdisplayName: testhealthCheckPolicyName: #Self-healing rule nameinstanceTypes: #Model specification- S5.MEDIUM2replicas: 1 #Node quantityscaling: #Auto-scaling policycreatePolicy: ZonePrioritymaxReplicas: 1subnetIDs: #Node pool subnet- subnet-nnwwb64wtemplate:metadata:annotations:node.tke.cloud.tencent.com/machine-cloud-tags: '[{"tagKey":"xxx","tagValue":"xxx"}]' #Tencent Cloud tagspec:displayName: tke-np-mpam3v4b-worker #Custom display namemetadata:annotations:annotation-key1: annotation-value1 #Custom annotationslabels:label-test-key: label-test-value #Custom labelsproviderSpec:type: Nativevalue:dataDisks: #Data disk parameters- deleteWithInstance: truediskID: ""diskSize: 50diskType: CloudPremiumfileSystem: ext4mountTarget: /var/lib/containerdinstanceChargeType: PostpaidByHour #Node billing modekeyIDs: #Node login SSH parameters- skey-xxxlifecycle: #Custom scriptpostInit: echo "after node init"preInit: echo "before node init"management: #Settings of Management parameters, including kubelet\\kernel\\nameserver\\hostnamesecurityGroupIDs: #Security group configuration- sg-xxxxxsystemDisk: #System disk configurationdiskSize: 50diskType: CloudPremiumruntimeRootDir: /var/lib/containerdtaints: #Taints, not required- effect: NoExecutekey: taint-key2value: value2type: Native
kubectl create -f machineset-demo.yaml
command to create a MachineSet based on the preceding YAML file.
kubectl get machineset
command to view the status of the MachineSet np-pjrlok3w. At this time, the corresponding node pool already exists in the console, and its node is being created.
kubectl describe machineset np-pjrlok3w
command to view the description of the MachineSet np-pjrlok3w.
kubectl scale --replicas=2 machineset/np-pjrlok3w
command to execute scaling of the node pool.
kubectl delete ms np-pjrlok3w
command to delete the node pool.
kubectl get machine
command to view the machine list. At this time, the corresponding node already exists in the console.
kubectl describe ma np-14024r66-nv8bk
command to view the description of the machine np-14024r66-nv8bk.
kubectl delete ma np-14024r66-nv8bk
command to delete the node.kubectl scale --replicas=1 machineset/np-xxxxx
command to adjust the expected number of nodes.kubectl delete machine np-xxxxxx-dtjhd
command to delete the corresponding node.
Apakah halaman ini membantu?