Skip to content

Data cache support for K8s 1.31 #2106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: release-1.14
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6ecf0ff
Add support for data cache
Sneha-at Feb 12, 2025
27b866a
fix test suite issue
Sneha-at Feb 19, 2025
02c8534
Update flags for data cache
Sneha-at Feb 20, 2025
8b4d9e1
Add hdMachineType to e2e setup code
cemakd Jun 4, 2025
040ec58
Implementing watcher & reboot stability for data cache to master branch.
halimsam Feb 20, 2025
8f2a701
Return error for any Data Cache related code in NodeStageVolume &
halimsam Feb 22, 2025
4212f84
update RAIDing and validation steps
hungnguyen243 Feb 24, 2025
723acf5
update test setup to avoid running Datacache setup on machines not su…
hungnguyen243 Feb 25, 2025
e1d8632
update validation logic for Data Cache to distinguish user and non-us…
hungnguyen243 Feb 26, 2025
63d56ec
Update error message for end users
sunnylovestiramisu Feb 27, 2025
03d4a84
Fix chunksize bug for large cache size in data cache
Sneha-at Feb 25, 2025
bc0a5d3
skip cache clean up for non-data cache PVCs
Sneha-at Feb 25, 2025
5233508
Add unit tests
Sneha-at Feb 26, 2025
f86f20d
Only run data cache watcher if a data cache nodepool exist & adding
halimsam Feb 28, 2025
0c33c22
Fix logic bug while checking available LSSDs for RAIDing for Data Cache
hungnguyen243 Mar 14, 2025
0cb814a
fix outdated metadata error in watcher
hungnguyen243 Mar 31, 2025
9aca35b
update cache logic to calculate chunk size based on toatl cache
Sneha-at Apr 3, 2025
5b9665a
Update
halimsam Apr 8, 2025
f04f496
remove GKE Data Cache Watcher regular event logs since it's generating
halimsam Apr 30, 2025
a420e9d
Resolving some bad merges, update to e2e test setup, mod vendor update
cemakd Jun 4, 2025
3ffb6af
Fix main.go bad merge from the latest commit hash of Data cache PRs
cemakd Jun 4, 2025
f22f043
Check for volume group existing before updating vg metadata
cemakd Jun 11, 2025
daa3ff5
Disabling data cache watcher by default if node details are not avail…
cemakd Jun 30, 2025
0df87d8
Fix typo and use strings.Fields for whitespace
cemakd Jul 18, 2025
d142b88
Check nodeName empty string before feature check
cemakd Jul 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FROM gke.gcr.io/debian-base:bookworm-v1.0.4-gke.2 as debian

# Install necessary dependencies
# google_nvme_id script depends on the following packages: nvme-cli, xxd, bash
RUN clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs nvme-cli xxd bash
RUN clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs nvme-cli xxd bash kmod lvm2 mdadm

# Since we're leveraging apt to pull in dependencies, we use `gcr.io/distroless/base` because it includes glibc.
FROM gcr.io/distroless/base-debian12 as distroless-base
Expand Down Expand Up @@ -56,6 +56,35 @@ COPY --from=debian /sbin/e2fsck /sbin/e2fsck
COPY --from=debian /sbin/fsck /sbin/fsck
COPY --from=debian /sbin/fsck* /sbin/
COPY --from=debian /sbin/fsck.xfs /sbin/fsck.xfs
# Add dependencies for LVM
COPY --from=debian /etc/lvm /lvm-tmp/lvm
COPY --from=debian /lib/systemd/system/blk-availability.service /lib/systemd/system/blk-availability.service
COPY --from=debian /lib/systemd/system/lvm2-lvmpolld.service /lib/systemd/system/lvm2-lvmpolld.service
COPY --from=debian /lib/systemd/system/lvm2-lvmpolld.socket /lib/systemd/system/lvm2-lvmpolld.socket
COPY --from=debian /lib/systemd/system/lvm2-monitor.service /lib/systemd/system/lvm2-monitor.service
COPY --from=debian /lib/udev/rules.d/56-lvm.rules /lib/udev/rules.d/56-lvm.rules
COPY --from=debian /sbin/fsadm /sbin/fsadm
COPY --from=debian /sbin/lvm /sbin/lvm
COPY --from=debian /sbin/lvmdump /sbin/lvmdump
COPY --from=debian /sbin/lvmpolld /sbin/lvmpolld
COPY --from=debian /usr/lib/tmpfiles.d /usr/lib/tmpfiles.d
COPY --from=debian /usr/lib/tmpfiles.d/lvm2.conf /usr/lib/tmpfiles.d/lvm2.conf
COPY --from=debian /sbin/lv* /sbin/
COPY --from=debian /sbin/pv* /sbin/
COPY --from=debian /sbin/vg* /sbin/
COPY --from=debian /bin/lsblk /bin/lsblk
COPY --from=debian /sbin/modprobe /sbin/modprobe
COPY --from=debian /lib/udev /lib/udev
COPY --from=debian /lib/udev/rules.d /lib/udev/rules.d
COPY --from=debian /lib/udev/rules.d/55-dm.rules /lib/udev/rules.d/55-dm.rules
COPY --from=debian /lib/udev/rules.d/60-persistent-storage-dm.rules /lib/udev/rules.d/60-persistent-storage-dm.rules
COPY --from=debian /lib/udev/rules.d/95-dm-notify.rules /lib/udev/rules.d/95-dm-notify.rules
COPY --from=debian /sbin/blkdeactivate /sbin/blkdeactivate
COPY --from=debian /sbin/dmsetup /sbin/dmsetup
COPY --from=debian /sbin/dmstats /sbin/dmstats
COPY --from=debian /bin/ls /bin/ls
# End of dependencies for LVM
COPY --from=debian /sbin/mdadm /sbin/mdadm
COPY --from=debian /sbin/mke2fs /sbin/mke2fs
COPY --from=debian /sbin/mkfs* /sbin/
COPY --from=debian /sbin/resize2fs /sbin/resize2fs
Expand All @@ -71,14 +100,20 @@ COPY --from=debian /bin/date /bin/date
COPY --from=debian /bin/grep /bin/grep
COPY --from=debian /bin/sed /bin/sed
COPY --from=debian /bin/ln /bin/ln
COPY --from=debian /bin/cp /bin/cp
COPY --from=debian /bin/udevadm /bin/udevadm

# Copy shared libraries into distroless base.
COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libselinux.so.1 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libdl.so.2 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libpthread.so.0 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libtinfo.so.6 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libe2p.so.2 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libcom_err.so.2 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libdevmapper.so.1.02.1 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libm.so.6 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libc.so.6 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libdevmapper-event.so.1.02.1 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libext2fs.so.2 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libgcc_s.so.1 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/liblzma.so.5 \
Expand All @@ -99,11 +134,17 @@ COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libselinux.so.1 \
/lib/${LIB_DIR_PREFIX}-linux-gnu/libzstd.so.1 /lib/${LIB_DIR_PREFIX}-linux-gnu/

COPY --from=debian /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libblkid.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libsmartcols.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libbsd.so.0 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libinih.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libmount.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libudev.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libuuid.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libzstd.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libaio.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libgcrypt.so.20 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libsystemd.so.0 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/liblz4.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libacl.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libattr.so.1 \
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libedit.so.2 \
Expand All @@ -130,4 +171,5 @@ RUN /print-missing-deps.sh
# Final build stage, create the real Docker image with ENTRYPOINT
FROM output-image

ENTRYPOINT ["/gce-pd-csi-driver"]
COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/initialize-driver.sh /initialize-driver.sh
ENTRYPOINT ["/initialize-driver.sh"]
112 changes: 108 additions & 4 deletions cmd/gce-pd-csi-driver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (

"k8s.io/klog/v2"
"k8s.io/utils/strings/slices"

"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common"
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils"
gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute"
Expand Down Expand Up @@ -72,6 +71,8 @@ var (
formatAndMountTimeout = flag.Duration("format-and-mount-timeout", 1*time.Minute, "The maximum duration of a format and mount operation before another such operation will be started. Used only if --serialize-format-and-mount")
fallbackRequisiteZonesFlag = flag.String("fallback-requisite-zones", "", "Comma separated list of requisite zones that will be used if there are not sufficient zones present in requisite topologies when provisioning a disk")
enableStoragePoolsFlag = flag.Bool("enable-storage-pools", false, "If set to true, the CSI Driver will allow volumes to be provisioned in Storage Pools")
enableDataCacheFlag = flag.Bool("enable-data-cache", false, "If set to true, the CSI Driver will allow volumes to be provisioned with Data Cache configuration")
nodeName = flag.String("node-name", "", "The node this driver is running on")

multiZoneVolumeHandleDiskTypesFlag = flag.String("multi-zone-volume-handle-disk-types", "", "Comma separated list of allowed disk types that can use the multi-zone volumeHandle. Used only if --multi-zone-volume-handle-enable")
multiZoneVolumeHandleEnableFlag = flag.Bool("multi-zone-volume-handle-enable", false, "If set to true, the multi-zone volumeHandle feature will be enabled")
Expand Down Expand Up @@ -122,7 +123,7 @@ func handle() {
if version == "" {
klog.Fatalf("version must be set at compile time")
}
klog.V(2).Infof("Driver vendor version %v", version)
klog.V(4).Infof("Driver vendor version %v", version)

// Start tracing as soon as possible
if *enableOtelTracing {
Expand Down Expand Up @@ -209,7 +210,7 @@ func handle() {
}
initialBackoffDuration := time.Duration(*errorBackoffInitialDurationMs) * time.Millisecond
maxBackoffDuration := time.Duration(*errorBackoffMaxDurationMs) * time.Millisecond
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, multiZoneVolumeHandleConfig, listVolumesConfig)
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig)
} else if *cloudConfigFilePath != "" {
klog.Warningf("controller service is disabled but cloud config given - it has no effect")
}
Expand All @@ -227,10 +228,29 @@ func handle() {
if err != nil {
klog.Fatalf("Failed to set up metadata service: %v", err.Error())
}
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter)
isDataCacheEnabledNodePool, err := isDataCacheEnabledNodePool(ctx, *nodeName)
if err != nil {
klog.Fatalf("Failed to get node info from API server: %v", err.Error())
}
nsArgs := driver.NodeServerArgs{
EnableDataCache: *enableDataCacheFlag,
DataCacheEnabledNodePool: isDataCacheEnabledNodePool,
}
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter, nsArgs)
if *maxConcurrentFormatAndMount > 0 {
nodeServer = nodeServer.WithSerializedFormatAndMount(*formatAndMountTimeout, *maxConcurrentFormatAndMount)
}
if *enableDataCacheFlag {
if nodeName == nil || *nodeName == "" {
klog.Errorf("Data Cache enabled, but --node-name not passed")
}
if nsArgs.DataCacheEnabledNodePool {
if err := setupDataCache(ctx, *nodeName, nodeServer.MetadataService.GetName()); err != nil {
klog.Errorf("Data Cache setup failed: %v", err)
}
go driver.StartWatcher(*nodeName)
}
}
}

err = gceDriver.SetupGCEDriver(driverName, version, extraVolumeLabels, extraTags, identityServer, controllerServer, nodeServer)
Expand Down Expand Up @@ -311,3 +331,87 @@ func urlFlag(target **url.URL, name string, usage string) {
return err
})
}

func isDataCacheEnabledNodePool(ctx context.Context, nodeName string) (bool, error) {
if !*enableDataCacheFlag || nodeName == "" {
return false, nil
}
if nodeName != common.TestNode { // disregard logic below when E2E testing.
dataCacheLSSDCount, err := driver.GetDataCacheCountFromNodeLabel(ctx, nodeName)
return dataCacheLSSDCount != 0, err
} else if nodeName == common.TestNode {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwschuurman I needed to add this node name == common.TestNode section here for e2e tests to pass. Please lmk if this is not the right approach for testing purposes.

return true, nil
}
return false, nil
}

func fetchLssdsForRaiding(lssdCount int) ([]string, error) {
allLssds, err := driver.FetchAllLssds()
if err != nil {
return nil, fmt.Errorf("Error listing all LSSDs %v", err)
}

raidedLssds, err := driver.FetchRaidedLssds()
if err != nil {
return nil, fmt.Errorf("Error listing RAIDed LSSDs %v", err)
}

LSSDsWithEmptyMountPoint, err := driver.FetchLSSDsWithEmptyMountPoint()
if err != nil {
return nil, fmt.Errorf("Error listing LSSDs with empty mountpoint: %v", err)
}

// We need to ensure the disks to be used for Data Cache are both unRAIDed & not containing mountpoints for ephemeral storage already
availableLssds := slices.Filter(nil, allLssds, func(e string) bool {
return slices.Contains(LSSDsWithEmptyMountPoint, e) && !slices.Contains(raidedLssds, e)
})

if len(availableLssds) == 0 {
return nil, fmt.Errorf("No LSSDs available to set up caching")
}

if len(availableLssds) < lssdCount {
return nil, fmt.Errorf("Not enough LSSDs available to set up caching. Available LSSDs: %v, wanted LSSDs: %v", len(availableLssds), lssdCount)
}

return availableLssds[:lssdCount], nil
}

func setupDataCache(ctx context.Context, nodeName string, nodeId string) error {
isAlreadyRaided, err := driver.IsRaided()
if err != nil {
klog.V(4).Infof("Errored while scanning for available LocalSSDs err:%v; continuing Raiding", err)
} else if isAlreadyRaided {
klog.V(4).Infof("Local SSDs are already RAIDed. Skipping Data Cache setup.")
return nil
}

lssdCount := common.LocalSSDCountForDataCache
if nodeName != common.TestNode {
var err error
lssdCount, err = driver.GetDataCacheCountFromNodeLabel(ctx, nodeName)
if err != nil {
return err
}
if lssdCount == 0 {
klog.V(4).Infof("Data Cache is not enabled on node %v, so skipping caching setup", nodeName)
return nil
}
}
lssdNames, err := fetchLssdsForRaiding(lssdCount)
if err != nil {
klog.Fatalf("Failed to get sufficient SSDs for Data Cache's caching setup: %v", err)
}
klog.V(4).Infof("Raiding local ssds to setup Data Cache: %v", lssdNames)
if err := driver.RaidLocalSsds(lssdNames); err != nil {
return fmt.Errorf("Failed to Raid local SSDs, unable to setup Data Cache, got error %v", err)
}

// Initializing data cache node (VG checks w/ raided lssd)
if err := driver.InitializeDataCacheNode(nodeId); err != nil {
return err
}

klog.V(4).Infof("LSSD caching is setup for the Data Cache enabled node %s", nodeName)
return nil
}
3 changes: 3 additions & 0 deletions deploy/kubernetes/base/controller/cluster_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ rules:
verbs: ['use']
resourceNames:
- csi-gce-pd-node-psp
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list"]
---

kind: ClusterRole
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/base/controller/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ spec:
args:
- "--v=5"
- "--endpoint=unix:/csi/csi.sock"
- --enable-data-cache
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/etc/cloud-sa/cloud-sa.json"
Expand Down
13 changes: 13 additions & 0 deletions deploy/kubernetes/base/node_linux/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ spec:
- "--v=5"
- "--endpoint=unix:/csi/csi.sock"
- "--run-controller-service=false"
- "--enable-data-cache"
- "--node-name=$(KUBE_NODE_NAME)"
securityContext:
privileged: true
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: kubelet-dir
mountPath: /var/lib/kubelet
Expand All @@ -66,6 +73,8 @@ spec:
mountPath: /run/udev
- name: sys
mountPath: /sys
- name: lib-modules
mountPath: /lib/modules
volumes:
- name: registration-dir
hostPath:
Expand Down Expand Up @@ -101,6 +110,10 @@ spec:
hostPath:
path: /sys
type: Directory
- name: lib-modules
hostPath:
path: /lib/modules
type: Directory
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
# See "special case". This will tolerate everything. Node component should
# be scheduled on all nodes.
Expand Down
5 changes: 2 additions & 3 deletions deploy/kubernetes/images/stable-master/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ metadata:
name: imagetag-gcepd-driver
imageTag:
name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
# Don't change stable image without changing pdImagePlaceholder in
# test/k8s-integration/main.go
# pdImagePlaceholder in test/k8s-integration/main.go is updated automatically with the newTag
newName: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
newTag: "v1.13.2"
newTag: "v1.13.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there here just for testing, or do we want to set it back for the current stable-master?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value was set to v1.13.2 on the release 1.14 branch per: https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/blob/release-1.14/deploy/kubernetes/images/stable-master/image.yaml

One of the PRs I cherry picked most likely set this to a higher value and that's likely why it shows the diff from 1.17.2.

On this release branch I believe it should be set to the release branch's stable master version right?

---
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@ github.com/frankban/quicktest v1.8.1/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fsouza/fake-gcs-server v0.0.0-20180612165233-e85be23bdaa8/go.mod h1:1/HufuJ+eaDf4KTnYdS6HJMGvMRU8d4cYTuu/1QaBbI=
github.com/fsouza/fake-gcs-server v1.19.4/go.mod h1:I0/88nHCASqJJ5M7zVF0zKODkYTcuXFW5J5yajsNJnE=
github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
Expand Down Expand Up @@ -1071,8 +1071,8 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=
Expand Down
9 changes: 9 additions & 0 deletions initialize-driver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

/bin/cp -r /lvm-tmp/lvm /etc/
/bin/sed -i -e "s/.*allow_mixed_block_sizes = 0.*/ allow_mixed_block_sizes = 1/" /etc/lvm/lvm.conf
/bin/sed -i -e "s/.*udev_sync = 1.*/ udev_sync = 0/" /etc/lvm/lvm.conf
/bin/sed -i -e "s/.*udev_rules = 1.*/ udev_rules = 0/" /etc/lvm/lvm.conf
/bin/sed -i -e "s/.*locking_dir = .*/ locking_dir = \"\/tmp\"/" /etc/lvm/lvm.conf

/gce-pd-csi-driver "$@"
19 changes: 19 additions & 0 deletions pkg/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ const (

// Label that is set on a disk when it is used by a 'multi-zone' VolumeHandle
MultiZoneLabel = "goog-gke-multi-zone"

// Data cache mode
DataCacheModeWriteBack = "writeback"
DataCacheModeWriteThrough = "writethrough"

ContextDataCacheSize = "data-cache-size"
ContextDataCacheMode = "data-cache-mode"

// Keys in the publish context
ContexLocalSsdCacheSize = "local-ssd-cache-size"
// Node name for E2E tests
TestNode = "test-node-csi-e2e"

// Default LSSD count for datacache E2E tests
LocalSSDCountForDataCache = 2

// Node label for Data Cache (only applicable to GKE nodes)
NodeLabelPrefix = "cloud.google.com/%s"
DataCacheLssdCountLabel = "gke-data-cache-disk"
)

// doc https://cloud.google.com/compute/docs/disks/hyperdisks#max-total-disks-per-vm
Expand Down
Loading