Skip to content

Commit bee8787

Browse files
iPraveenPariharnb-ohad
authored andcommitted
csi: add enable-fencing flag to csi containers
Ceph-CSI added 'enable-fencing' flag in ceph/ceph-csi@e77ce04 Introduced a new flag 'enable-fencing' disabled-by-default. When enabled driver can set the client address per node in the volume metadata during NodeStageVolume operation and fence the node in ControllerUnpublishVolume and unfence the node in ControllerPublishVolume using the address stored in the volume metadata. Signed-off-by: Praveen M <m.praveen@ibm.com>
1 parent 9ead65a commit bee8787

File tree

12 files changed

+65
-0
lines changed

12 files changed

+65
-0
lines changed

api/v1/driver_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ type DriverSpec struct {
297297
//+kubebuilder:validation:Optional
298298
EnableMetadata *bool `json:"enableMetadata,omitempty"`
299299

300+
// Set to true to enable fencing for the driver.
301+
// Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
302+
//+kubebuilder:validation:Optional
303+
EnableFencing *bool `json:"enableFencing,omitempty"`
304+
300305
// Set the gRPC timeout for gRPC call issued by the driver components
301306
//+kubebuilder:validation:Optional
302307
//+kubebuilder:validation:Minimum:=0

api/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/csi.ceph.io_drivers.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3527,6 +3527,11 @@ spec:
35273527
deployCsiAddons:
35283528
description: a list of additional sidecars?
35293529
type: boolean
3530+
enableFencing:
3531+
description: |-
3532+
Set to true to enable fencing for the driver.
3533+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
3534+
type: boolean
35303535
enableMetadata:
35313536
description: |-
35323537
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.

config/crd/bases/csi.ceph.io_operatorconfigs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,6 +3565,11 @@ spec:
35653565
deployCsiAddons:
35663566
description: a list of additional sidecars?
35673567
type: boolean
3568+
enableFencing:
3569+
description: |-
3570+
Set to true to enable fencing for the driver.
3571+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
3572+
type: boolean
35683573
enableMetadata:
35693574
description: |-
35703575
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.

deploy/all-in-one/install.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,6 +4003,11 @@ spec:
40034003
deployCsiAddons:
40044004
description: a list of additional sidecars?
40054005
type: boolean
4006+
enableFencing:
4007+
description: |-
4008+
Set to true to enable fencing for the driver.
4009+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
4010+
type: boolean
40064011
enableMetadata:
40074012
description: |-
40084013
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.
@@ -17911,6 +17916,11 @@ spec:
1791117916
deployCsiAddons:
1791217917
description: a list of additional sidecars?
1791317918
type: boolean
17919+
enableFencing:
17920+
description: |-
17921+
Set to true to enable fencing for the driver.
17922+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
17923+
type: boolean
1791417924
enableMetadata:
1791517925
description: |-
1791617926
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.

deploy/charts/ceph-csi-operator/templates/driver-crd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3524,6 +3524,11 @@ spec:
35243524
deployCsiAddons:
35253525
description: a list of additional sidecars?
35263526
type: boolean
3527+
enableFencing:
3528+
description: |-
3529+
Set to true to enable fencing for the driver.
3530+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
3531+
type: boolean
35273532
enableMetadata:
35283533
description: |-
35293534
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.

deploy/charts/ceph-csi-operator/templates/operatorconfig-crd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,6 +3554,11 @@ spec:
35543554
deployCsiAddons:
35553555
description: a list of additional sidecars?
35563556
type: boolean
3557+
enableFencing:
3558+
description: |-
3559+
Set to true to enable fencing for the driver.
3560+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
3561+
type: boolean
35573562
enableMetadata:
35583563
description: |-
35593564
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.

deploy/multifile/crd.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,6 +3994,11 @@ spec:
39943994
deployCsiAddons:
39953995
description: a list of additional sidecars?
39963996
type: boolean
3997+
enableFencing:
3998+
description: |-
3999+
Set to true to enable fencing for the driver.
4000+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
4001+
type: boolean
39974002
enableMetadata:
39984003
description: |-
39994004
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.
@@ -17902,6 +17907,11 @@ spec:
1790217907
deployCsiAddons:
1790317908
description: a list of additional sidecars?
1790417909
type: boolean
17910+
enableFencing:
17911+
description: |-
17912+
Set to true to enable fencing for the driver.
17913+
Fencing is a feature that allows the driver to fence a node when it is tainted with node.kubernetes.io/out-of-service.
17914+
type: boolean
1790517915
enableMetadata:
1790617916
description: |-
1790717917
Set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.

internal/controller/driver_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ func (r *driverReconcile) reconcileControllerPluginDeployment() error {
602602
utils.DriverNameContainerArg(r.driver.Name),
603603
utils.PidlimitContainerArg,
604604
utils.SetMetadataContainerArg(ptr.Deref(r.driver.Spec.EnableMetadata, false)),
605+
utils.SetFencingContainerArg(ptr.Deref(r.driver.Spec.EnableFencing, false)),
605606
utils.ClusterNameContainerArg(ptr.Deref(r.driver.Spec.ClusterName, "")),
606607
utils.If(forceKernelClient, utils.ForceCephKernelClientContainerArg, ""),
607608
utils.If(
@@ -1263,6 +1264,7 @@ func (r *driverReconcile) reconcileNodePluginDeamonSet() error {
12631264
utils.NodeServerContainerArg,
12641265
utils.NodeIdContainerArg,
12651266
utils.DriverNameContainerArg(r.driver.Name),
1267+
utils.SetFencingContainerArg(ptr.Deref(r.driver.Spec.EnableFencing, false)),
12661268
utils.EndpointContainerArg,
12671269
utils.PidlimitContainerArg,
12681270
utils.If(forceKernelClient, utils.ForceCephKernelClientContainerArg, ""),

internal/utils/csi.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ func TypeContainerArg(t string) string {
419419
func SetMetadataContainerArg(on bool) string {
420420
return If(on, "--setmetadata=true", "")
421421
}
422+
func SetFencingContainerArg(on bool) string {
423+
return If(on, "--enable-fencing=true", "")
424+
}
422425
func TimeoutContainerArg(timeout int) string {
423426
return fmt.Sprintf("--timeout=%ds", timeout)
424427
}

0 commit comments

Comments
 (0)