Skip to content

Commit fa4557a

Browse files
authored
Merge pull request rook#16922 from subhamkrai/remove-fencing-obsolete-code
csi: remove automated node fencing code
2 parents 69826e8 + ae33d23 commit fa4557a

8 files changed

Lines changed: 4 additions & 1115 deletions

File tree

Documentation/Storage-Configuration/Block-Storage-RBD/block-storage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ The erasure coded pool must be set as the `dataPool` parameter in
196196

197197
## Node Loss
198198

199-
If a node goes down where a pod is running where a RBD RWO volume is mounted, the volume cannot automatically be mounted on another node. The node must be guaranteed to be offline before the volume can be mounted on another node.
199+
If a node goes down where a pod is running where a volume is mounted, the volume cannot automatically be mounted on another node. The node must be guaranteed to be offline before the volume can be mounted on another node.
200200

201201

202202
### Handling Node Loss
@@ -209,7 +209,7 @@ kubectl taint nodes <node-name> node.kubernetes.io/out-of-service=nodeshutdown:N
209209
kubectl taint nodes <node-name> node.kubernetes.io/out-of-service=nodeshutdown:NoSchedule
210210
```
211211

212-
After the taint is added to the node, the CephCSI driver will automatically handle the network fencing to prevent connections to Ceph from the RBD volume on that node.
212+
After the taint is added to the node, the CephCSI driver will automatically handle the network fencing to prevent connections to Ceph from the volume on that node.
213213

214214
### Node Recovery
215215

deploy/examples/operator-openshift.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,6 @@ data:
567567
ROOK_CEPH_COMMANDS_TIMEOUT_SECONDS: "15"
568568
# Enable the csi addons sidecar.
569569
CSI_ENABLE_CSIADDONS: "false"
570-
# Enable watch for faster recovery from rbd rwo node loss
571-
ROOK_WATCH_FOR_NODE_FAILURE: "true"
572570
# ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.14.0"
573571
# The GCSI RPC timeout value (in seconds). It should be >= 120. If this variable is not set or is an invalid value, it's default to 150.
574572
CSI_GRPC_TIMEOUT_SECONDS: "150"

deploy/examples/operator.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ data:
509509
ROOK_CEPH_COMMANDS_TIMEOUT_SECONDS: "15"
510510
# Enable the csi addons sidecar.
511511
CSI_ENABLE_CSIADDONS: "false"
512-
# Enable watch for faster recovery from rbd rwo node loss
513-
ROOK_WATCH_FOR_NODE_FAILURE: "true"
514512
# ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.14.0"
515513
# The CSI GRPC timeout value (in seconds). It should be >= 120. If this variable is not set or is an invalid value, it's default to 150.
516514
CSI_GRPC_TIMEOUT_SECONDS: "150"

design/ceph/node-loss-rbd-cephfs.md

Lines changed: 0 additions & 150 deletions
This file was deleted.

pkg/operator/ceph/cluster/controller.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
corev1 "k8s.io/api/core/v1"
4444
kerrors "k8s.io/apimachinery/pkg/api/errors"
4545
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
46-
"k8s.io/apimachinery/pkg/labels"
4746
apituntime "k8s.io/apimachinery/pkg/runtime"
4847
"k8s.io/apimachinery/pkg/types"
4948
"k8s.io/client-go/tools/record"
@@ -501,38 +500,6 @@ func (c *ClusterController) requestClusterDelete(clusterObj *cephv1.CephCluster)
501500
return reconcile.Result{}, nil // do not requeue the delete
502501
}
503502
}
504-
_, err := c.context.ApiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Get(c.OpManagerCtx, "networkfences.csiaddons.openshift.io", metav1.GetOptions{})
505-
if err == nil {
506-
log.NamespacedInfo(clusterObj.Namespace, logger, "removing networkFence if matching cephCluster UID found")
507-
networkFenceList := &addonsv1alpha1.NetworkFenceList{}
508-
labelSelector := labels.SelectorFromSet(map[string]string{
509-
networkFenceLabel: string(clusterObj.GetUID()),
510-
})
511-
512-
opts := []client.DeleteAllOfOption{
513-
client.MatchingLabels{
514-
networkFenceLabel: string(clusterObj.GetUID()),
515-
},
516-
client.GracePeriodSeconds(0),
517-
}
518-
err = c.client.DeleteAllOf(c.OpManagerCtx, &addonsv1alpha1.NetworkFence{}, opts...)
519-
if err != nil && !kerrors.IsNotFound(err) {
520-
return reconcile.Result{}, errors.Wrapf(err, "failed to delete networkFence with label %s", networkFenceLabel)
521-
}
522-
523-
err = c.client.List(c.OpManagerCtx, networkFenceList, &client.MatchingLabelsSelector{Selector: labelSelector})
524-
if err != nil && !kerrors.IsNotFound(err) {
525-
return reconcile.Result{}, errors.Wrap(err, "failed to list networkFence")
526-
}
527-
if len(networkFenceList.Items) > 0 {
528-
for i := range networkFenceList.Items {
529-
err = opcontroller.RemoveFinalizerWithName(c.OpManagerCtx, c.client, &networkFenceList.Items[i], "csiaddons.openshift.io/network-fence")
530-
if err != nil {
531-
return reconcile.Result{}, errors.Wrap(err, "failed to remove finalizer")
532-
}
533-
}
534-
}
535-
}
536503

537504
log.NamespacedInfo(clusterObj.Namespace, logger, "cleaning up CephCluster %q", nsName)
538505
if existingCluster != nil {

0 commit comments

Comments
 (0)