You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/fleet/README.md
+64-22Lines changed: 64 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
# kubectl-fleet
2
2
3
-
A unified kubectl plugin for KubeFleet cluster management operations, providing drain and uncordon functionality for member clusters in a fleet.
3
+
A unified kubectl plugin for KubeFleet cluster management operations, providing draincluster, and uncordoncluster functionality for member clusters in a fleet,
4
+
as well as staged update approval capability.
4
5
5
6
## Description
6
7
7
-
`kubectl-fleet` allows you to manage member clusters in a KubeFleet deployment by draining workloads from clusters for maintenance and uncordoning them when ready to accept workloads again.
8
+
`kubectl-fleet` allows you to manage member clusters in a KubeFleet deployment by approving staged updates, draining workloads from clusters for maintenance, and uncordoning them when ready to accept workloads again.
8
9
9
10
## Installation
10
11
@@ -63,57 +64,83 @@ CURRENT NAME CLUSTER AUTHINFO
63
64
64
65
Here you can see that the context of the hub cluster is called `hub` under the `NAME` column.
65
66
67
+
### Approve a ClusterApprovalRequest
68
+
69
+
Use the `approve` subcommand to approve ClusterApprovalRequest resources for staged update runs. This allows staged updates to proceed to the next stage by patching an "Approved" condition to the resource status.
Use the `drain` subcommand to remove all resources propagated to a member cluster from the hub cluster by any `Placement` resource. This is useful when you want to temporarily move all workloads off a member cluster in preparation for an event like upgrade or reconfiguration.
82
+
Use the `draincluster` subcommand to remove all resources propagated to a member cluster from the hub cluster by any `Placement` resource. This is useful when you want to temporarily move all workloads off a member cluster in preparation for an event like upgrade or reconfiguration.
Use the `uncordon` subcommand to uncordon a member cluster that has been previously drained, allowing resources to be propagated to the cluster again.
95
+
Use the `uncordoncluster` subcommand to uncordon a member cluster that has been previously drained, allowing resources to be propagated to the cluster again.
Approves ClusterApprovalRequest resources for staged update runs by:
111
+
112
+
1.**Status Update**: Patches the ClusterApprovalRequest resource with an "Approved" condition
113
+
2.**Stage Progression**: Allows staged updates to proceed to the next stage automatically
114
+
115
+
The approve command currently supports the following resource kinds:
116
+
-`clusterapprovalrequest`: Approve a ClusterApprovalRequest for staged updates
117
+
118
+
### draincluster
95
119
96
120
Drains a member cluster by performing the following actions:
97
121
98
122
1.**Cordoning**: Adds a `Taint` to the `MemberCluster` resource to prevent any new resources from being propagated to the member cluster
99
123
2.**Eviction**: Creates `Eviction` objects for all the `Placement` objects that have propagated resources to the member cluster
100
124
3.**Resource Removal**: Waits for all evictions to complete and resources to be removed from the member cluster
101
125
102
-
**Note**: The `drain` command is a best-effort mechanism. Once the command runs successfully, you must verify that all resources propagated by `Placement` resources are removed from the member cluster. Re-running the command is safe and recommended if you notice any resources still present on the member cluster.
126
+
**Note**: The `draincluster` command is a best-effort mechanism. Once the command runs successfully, you must verify that all resources propagated by `Placement` resources are removed from the member cluster. Re-running the command is safe and recommended if you notice any resources still present on the member cluster.
103
127
104
-
### uncordon
128
+
### uncordoncluster
105
129
106
130
Uncordons a previously drained member cluster by:
107
131
108
-
1.**Taint Removal**: Removes the `cordon` taint that was added to the `MemberCluster` resource by the `drain` command
132
+
1.**Taint Removal**: Removes the `cordon` taint that was added to the `MemberCluster` resource by the `draincluster` command
109
133
2.**Resource Propagation**: Allows resources to be propagated to the cluster again according to existing `Placement` objects
110
134
111
135
If the `cordon` taint is not present on the member cluster, the command will have no effect and complete successfully.
112
136
113
137
## Flags
114
138
115
-
Both `drain` and `uncordon` subcommands use the following flags:
139
+
The `approve` subcommand uses the following flags:
140
+
-`--hubClusterContext`: kubectl context for the hub cluster (required)
141
+
-`--name`: name of the resource to approve (required)
116
142
143
+
Both `draincluster` and `uncordoncluster` subcommands use the following flags:
117
144
-`--hubClusterContext`: kubectl context for the hub cluster (required)
118
145
-`--clusterName`: name of the member cluster to operate on (required)
119
146
@@ -126,42 +153,57 @@ Both `drain` and `uncordon` subcommands use the following flags:
0 commit comments