|
6 | 6 | [id="nodes-nodes-working-deleting_{context}"]
|
7 | 7 | = Deleting nodes from a cluster
|
8 | 8 |
|
9 |
| -When you delete a node using the CLI, the node object is deleted in Kubernetes, |
10 |
| -but the pods that exist on the node are not deleted. Any bare pods not |
11 |
| -backed by a replication controller become inaccessible to {product-title}. |
12 |
| -Pods backed by replication controllers are rescheduled to other available |
13 |
| -nodes. You must delete local manifest pods. |
| 9 | +To delete a node from the {product-title} cluster, scale down the appropriate `MachineSet` object. |
14 | 10 |
|
15 |
| -.Procedure |
| 11 | +[IMPORTANT] |
| 12 | +==== |
| 13 | +When a cluster is integrated with a cloud provider, you must delete the corresponding machine to delete a node. Do not try to use the `oc delete node` command for this task. |
| 14 | +==== |
16 | 15 |
|
17 |
| -To delete a node from the {product-title} cluster, edit the appropriate `MachineSet` object: |
| 16 | +When you delete a node by using the CLI, the node object is deleted in Kubernetes, but the pods that exist on the node are not deleted. Any bare pods that are not backed by a replication controller become inaccessible to {product-title}. Pods backed by replication controllers are rescheduled to other available nodes. You must delete local manifest pods. |
18 | 17 |
|
19 | 18 | [NOTE]
|
20 | 19 | ====
|
21 |
| -If you are running cluster on bare metal, you cannot delete a node by editing |
22 |
| -`MachineSet` objects. Compute machine sets are only available when a cluster is integrated with a cloud provider. Instead you must unschedule and drain the node before manually |
23 |
| -deleting it. |
| 20 | +If you are running cluster on bare metal, you cannot delete a node by editing `MachineSet` objects. Compute machine sets are only available when a cluster is integrated with a cloud provider. Instead you must unschedule and drain the node before manually deleting it. |
24 | 21 | ====
|
25 | 22 |
|
26 |
| -. View the compute machine sets that are in the cluster: |
| 23 | +.Procedure |
| 24 | + |
| 25 | +. View the compute machine sets that are in the cluster by running the following command: |
27 | 26 | +
|
28 | 27 | [source,terminal]
|
29 | 28 | ----
|
30 | 29 | $ oc get machinesets -n openshift-machine-api
|
31 | 30 | ----
|
32 | 31 | +
|
33 |
| -The compute machine sets are listed in the form of <clusterid>-worker-<aws-region-az>. |
| 32 | +The compute machine sets are listed in the form of `<cluster-id>-worker-<aws-region-az>`. |
| 33 | + |
| 34 | +. Scale down the compute machine set by using one of the following methods: |
34 | 35 |
|
35 |
| -. Scale the compute machine set: |
| 36 | +** Specify the number of replicas to scale down to by running the following command: |
36 | 37 | +
|
37 | 38 | [source,terminal]
|
38 | 39 | ----
|
39 |
| -$ oc scale --replicas=2 machineset <machineset> -n openshift-machine-api |
| 40 | +$ oc scale --replicas=2 machineset <machine-set-name> -n openshift-machine-api |
40 | 41 | ----
|
41 |
| -+ |
42 |
| -Or: |
| 42 | + |
| 43 | +** Edit the compute machine set custom resource by running the following command: |
43 | 44 | +
|
44 | 45 | [source,terminal]
|
45 | 46 | ----
|
46 |
| -$ oc edit machineset <machineset> -n openshift-machine-api |
| 47 | +$ oc edit machineset <machine-set-name> -n openshift-machine-api |
47 | 48 | ----
|
48 | 49 | +
|
49 |
| -[TIP] |
50 |
| -==== |
51 |
| -You can alternatively apply the following YAML to scale the compute machine set: |
52 |
| -
|
| 50 | +.Example output |
53 | 51 | [source,yaml]
|
54 | 52 | ----
|
55 | 53 | apiVersion: machine.openshift.io/v1beta1
|
56 | 54 | kind: MachineSet
|
57 | 55 | metadata:
|
58 |
| - name: <machineset> |
| 56 | + # ... |
| 57 | + name: <machine-set-name> |
59 | 58 | namespace: openshift-machine-api
|
| 59 | + # ... |
60 | 60 | spec:
|
61 |
| - replicas: 2 |
62 |
| -#... |
| 61 | + replicas: 2 # <1> |
| 62 | + # ... |
63 | 63 | ----
|
64 |
| -==== |
65 |
| - |
| 64 | +<1> Specify the number of replicas to scale down to. |
0 commit comments