Skip to content

Commit ac24a05

Browse files
authored
Merge pull request #2106 from cemakd/data-cache
Data cache support for K8s 1.31
2 parents ffb2b8d + 9ecd66d commit ac24a05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+6337
-2382
lines changed

Dockerfile

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ FROM gke.gcr.io/debian-base:bookworm-v1.0.4-gke.2 as debian
2727

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

3232
# Since we're leveraging apt to pull in dependencies, we use `gcr.io/distroless/base` because it includes glibc.
3333
FROM gcr.io/distroless/base-debian12 as distroless-base
@@ -56,6 +56,35 @@ COPY --from=debian /sbin/e2fsck /sbin/e2fsck
5656
COPY --from=debian /sbin/fsck /sbin/fsck
5757
COPY --from=debian /sbin/fsck* /sbin/
5858
COPY --from=debian /sbin/fsck.xfs /sbin/fsck.xfs
59+
# Add dependencies for LVM
60+
COPY --from=debian /etc/lvm /lvm-tmp/lvm
61+
COPY --from=debian /lib/systemd/system/blk-availability.service /lib/systemd/system/blk-availability.service
62+
COPY --from=debian /lib/systemd/system/lvm2-lvmpolld.service /lib/systemd/system/lvm2-lvmpolld.service
63+
COPY --from=debian /lib/systemd/system/lvm2-lvmpolld.socket /lib/systemd/system/lvm2-lvmpolld.socket
64+
COPY --from=debian /lib/systemd/system/lvm2-monitor.service /lib/systemd/system/lvm2-monitor.service
65+
COPY --from=debian /lib/udev/rules.d/56-lvm.rules /lib/udev/rules.d/56-lvm.rules
66+
COPY --from=debian /sbin/fsadm /sbin/fsadm
67+
COPY --from=debian /sbin/lvm /sbin/lvm
68+
COPY --from=debian /sbin/lvmdump /sbin/lvmdump
69+
COPY --from=debian /sbin/lvmpolld /sbin/lvmpolld
70+
COPY --from=debian /usr/lib/tmpfiles.d /usr/lib/tmpfiles.d
71+
COPY --from=debian /usr/lib/tmpfiles.d/lvm2.conf /usr/lib/tmpfiles.d/lvm2.conf
72+
COPY --from=debian /sbin/lv* /sbin/
73+
COPY --from=debian /sbin/pv* /sbin/
74+
COPY --from=debian /sbin/vg* /sbin/
75+
COPY --from=debian /bin/lsblk /bin/lsblk
76+
COPY --from=debian /sbin/modprobe /sbin/modprobe
77+
COPY --from=debian /lib/udev /lib/udev
78+
COPY --from=debian /lib/udev/rules.d /lib/udev/rules.d
79+
COPY --from=debian /lib/udev/rules.d/55-dm.rules /lib/udev/rules.d/55-dm.rules
80+
COPY --from=debian /lib/udev/rules.d/60-persistent-storage-dm.rules /lib/udev/rules.d/60-persistent-storage-dm.rules
81+
COPY --from=debian /lib/udev/rules.d/95-dm-notify.rules /lib/udev/rules.d/95-dm-notify.rules
82+
COPY --from=debian /sbin/blkdeactivate /sbin/blkdeactivate
83+
COPY --from=debian /sbin/dmsetup /sbin/dmsetup
84+
COPY --from=debian /sbin/dmstats /sbin/dmstats
85+
COPY --from=debian /bin/ls /bin/ls
86+
# End of dependencies for LVM
87+
COPY --from=debian /sbin/mdadm /sbin/mdadm
5988
COPY --from=debian /sbin/mke2fs /sbin/mke2fs
6089
COPY --from=debian /sbin/mkfs* /sbin/
6190
COPY --from=debian /sbin/resize2fs /sbin/resize2fs
@@ -71,14 +100,20 @@ COPY --from=debian /bin/date /bin/date
71100
COPY --from=debian /bin/grep /bin/grep
72101
COPY --from=debian /bin/sed /bin/sed
73102
COPY --from=debian /bin/ln /bin/ln
103+
COPY --from=debian /bin/cp /bin/cp
74104
COPY --from=debian /bin/udevadm /bin/udevadm
75105

76106
# Copy shared libraries into distroless base.
77107
COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libselinux.so.1 \
108+
/lib/${LIB_DIR_PREFIX}-linux-gnu/libdl.so.2 \
109+
/lib/${LIB_DIR_PREFIX}-linux-gnu/libpthread.so.0 \
78110
/lib/${LIB_DIR_PREFIX}-linux-gnu/libtinfo.so.6 \
79111
/lib/${LIB_DIR_PREFIX}-linux-gnu/libe2p.so.2 \
80112
/lib/${LIB_DIR_PREFIX}-linux-gnu/libcom_err.so.2 \
81113
/lib/${LIB_DIR_PREFIX}-linux-gnu/libdevmapper.so.1.02.1 \
114+
/lib/${LIB_DIR_PREFIX}-linux-gnu/libm.so.6 \
115+
/lib/${LIB_DIR_PREFIX}-linux-gnu/libc.so.6 \
116+
/lib/${LIB_DIR_PREFIX}-linux-gnu/libdevmapper-event.so.1.02.1 \
82117
/lib/${LIB_DIR_PREFIX}-linux-gnu/libext2fs.so.2 \
83118
/lib/${LIB_DIR_PREFIX}-linux-gnu/libgcc_s.so.1 \
84119
/lib/${LIB_DIR_PREFIX}-linux-gnu/liblzma.so.5 \
@@ -99,11 +134,17 @@ COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libselinux.so.1 \
99134
/lib/${LIB_DIR_PREFIX}-linux-gnu/libzstd.so.1 /lib/${LIB_DIR_PREFIX}-linux-gnu/
100135

101136
COPY --from=debian /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libblkid.so.1 \
137+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libsmartcols.so.1 \
102138
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libbsd.so.0 \
103139
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libinih.so.1 \
104140
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libmount.so.1 \
105141
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libudev.so.1 \
106142
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libuuid.so.1 \
143+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libzstd.so.1 \
144+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libaio.so.1 \
145+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libgcrypt.so.20 \
146+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libsystemd.so.0 \
147+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/liblz4.so.1 \
107148
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libacl.so.1 \
108149
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libattr.so.1 \
109150
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libedit.so.2 \
@@ -130,4 +171,5 @@ RUN /print-missing-deps.sh
130171
# Final build stage, create the real Docker image with ENTRYPOINT
131172
FROM output-image
132173

133-
ENTRYPOINT ["/gce-pd-csi-driver"]
174+
COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/initialize-driver.sh /initialize-driver.sh
175+
ENTRYPOINT ["/initialize-driver.sh"]

cmd/gce-pd-csi-driver/main.go

Lines changed: 106 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929

3030
"k8s.io/klog/v2"
3131
"k8s.io/utils/strings/slices"
32-
3332
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common"
3433
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils"
3534
gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute"
@@ -72,6 +71,8 @@ var (
7271
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")
7372
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")
7473
enableStoragePoolsFlag = flag.Bool("enable-storage-pools", false, "If set to true, the CSI Driver will allow volumes to be provisioned in Storage Pools")
74+
enableDataCacheFlag = flag.Bool("enable-data-cache", false, "If set to true, the CSI Driver will allow volumes to be provisioned with Data Cache configuration")
75+
nodeName = flag.String("node-name", "", "The node this driver is running on")
7576

7677
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")
7778
multiZoneVolumeHandleEnableFlag = flag.Bool("multi-zone-volume-handle-enable", false, "If set to true, the multi-zone volumeHandle feature will be enabled")
@@ -122,7 +123,7 @@ func handle() {
122123
if version == "" {
123124
klog.Fatalf("version must be set at compile time")
124125
}
125-
klog.V(2).Infof("Driver vendor version %v", version)
126+
klog.V(4).Infof("Driver vendor version %v", version)
126127

127128
// Start tracing as soon as possible
128129
if *enableOtelTracing {
@@ -209,7 +210,7 @@ func handle() {
209210
}
210211
initialBackoffDuration := time.Duration(*errorBackoffInitialDurationMs) * time.Millisecond
211212
maxBackoffDuration := time.Duration(*errorBackoffMaxDurationMs) * time.Millisecond
212-
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, multiZoneVolumeHandleConfig, listVolumesConfig)
213+
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig)
213214
} else if *cloudConfigFilePath != "" {
214215
klog.Warningf("controller service is disabled but cloud config given - it has no effect")
215216
}
@@ -227,10 +228,29 @@ func handle() {
227228
if err != nil {
228229
klog.Fatalf("Failed to set up metadata service: %v", err.Error())
229230
}
230-
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter)
231+
isDataCacheEnabledNodePool, err := isDataCacheEnabledNodePool(ctx, *nodeName)
232+
if err != nil {
233+
klog.Fatalf("Failed to get node info from API server: %v", err.Error())
234+
}
235+
nsArgs := driver.NodeServerArgs{
236+
EnableDataCache: *enableDataCacheFlag,
237+
DataCacheEnabledNodePool: isDataCacheEnabledNodePool,
238+
}
239+
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter, nsArgs)
231240
if *maxConcurrentFormatAndMount > 0 {
232241
nodeServer = nodeServer.WithSerializedFormatAndMount(*formatAndMountTimeout, *maxConcurrentFormatAndMount)
233242
}
243+
if *enableDataCacheFlag {
244+
if nodeName == nil || *nodeName == "" {
245+
klog.Errorf("Data Cache enabled, but --node-name not passed")
246+
}
247+
if nsArgs.DataCacheEnabledNodePool {
248+
if err := setupDataCache(ctx, *nodeName, nodeServer.MetadataService.GetName()); err != nil {
249+
klog.Errorf("Data Cache setup failed: %v", err)
250+
}
251+
go driver.StartWatcher(*nodeName)
252+
}
253+
}
234254
}
235255

236256
err = gceDriver.SetupGCEDriver(driverName, version, extraVolumeLabels, extraTags, identityServer, controllerServer, nodeServer)
@@ -311,3 +331,85 @@ func urlFlag(target **url.URL, name string, usage string) {
311331
return err
312332
})
313333
}
334+
335+
func isDataCacheEnabledNodePool(ctx context.Context, nodeName string) (bool, error) {
336+
if !*enableDataCacheFlag {
337+
return false, nil
338+
}
339+
if len(nodeName) > 0 && nodeName != common.TestNode { // disregard logic below when E2E testing.
340+
dataCacheLSSDCount, err := driver.GetDataCacheCountFromNodeLabel(ctx, nodeName)
341+
return dataCacheLSSDCount != 0, err
342+
}
343+
return true, nil
344+
}
345+
346+
func fetchLssdsForRaiding(lssdCount int) ([]string, error) {
347+
allLssds, err := driver.FetchAllLssds()
348+
if err != nil {
349+
return nil, fmt.Errorf("Error listing all LSSDs %v", err)
350+
}
351+
352+
raidedLssds, err := driver.FetchRaidedLssds()
353+
if err != nil {
354+
return nil, fmt.Errorf("Error listing RAIDed LSSDs %v", err)
355+
}
356+
357+
LSSDsWithEmptyMountPoint, err := driver.FetchLSSDsWithEmptyMountPoint()
358+
if err != nil {
359+
return nil, fmt.Errorf("Error listing LSSDs with empty mountpoint: %v", err)
360+
}
361+
362+
// We need to ensure the disks to be used for Data Cache are both unRAIDed & not containing mountpoints for ephemeral storage already
363+
availableLssds := slices.Filter(nil, allLssds, func(e string) bool {
364+
return slices.Contains(LSSDsWithEmptyMountPoint, e) && !slices.Contains(raidedLssds, e)
365+
})
366+
367+
if len(availableLssds) == 0 {
368+
return nil, fmt.Errorf("No LSSDs available to set up caching")
369+
}
370+
371+
if len(availableLssds) < lssdCount {
372+
return nil, fmt.Errorf("Not enough LSSDs available to set up caching. Available LSSDs: %v, wanted LSSDs: %v", len(availableLssds), lssdCount)
373+
}
374+
375+
return availableLssds[:lssdCount], nil
376+
}
377+
378+
func setupDataCache(ctx context.Context, nodeName string, nodeId string) error {
379+
isAlreadyRaided, err := driver.IsRaided()
380+
if err != nil {
381+
klog.V(4).Infof("Errored while scanning for available LocalSSDs err:%v; continuing Raiding", err)
382+
} else if isAlreadyRaided {
383+
klog.V(4).Infof("Local SSDs are already RAIDed. Skipping Data Cache setup.")
384+
return nil
385+
}
386+
387+
lssdCount := common.LocalSSDCountForDataCache
388+
if nodeName != common.TestNode {
389+
var err error
390+
lssdCount, err = driver.GetDataCacheCountFromNodeLabel(ctx, nodeName)
391+
if err != nil {
392+
return err
393+
}
394+
if lssdCount == 0 {
395+
klog.V(4).Infof("Data Cache is not enabled on node %v, so skipping caching setup", nodeName)
396+
return nil
397+
}
398+
}
399+
lssdNames, err := fetchLssdsForRaiding(lssdCount)
400+
if err != nil {
401+
klog.Fatalf("Failed to get sufficient SSDs for Data Cache's caching setup: %v", err)
402+
}
403+
klog.V(4).Infof("Raiding local ssds to setup Data Cache: %v", lssdNames)
404+
if err := driver.RaidLocalSsds(lssdNames); err != nil {
405+
return fmt.Errorf("Failed to Raid local SSDs, unable to setup Data Cache, got error %v", err)
406+
}
407+
408+
// Initializing data cache node (VG checks w/ raided lssd)
409+
if err := driver.InitializeDataCacheNode(nodeId); err != nil {
410+
return err
411+
}
412+
413+
klog.V(4).Infof("LSSD caching is setup for the Data Cache enabled node %s", nodeName)
414+
return nil
415+
}

deploy/kubernetes/base/controller/cluster_setup.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ rules:
199199
verbs: ['use']
200200
resourceNames:
201201
- csi-gce-pd-node-psp
202+
- apiGroups: [""]
203+
resources: ["nodes"]
204+
verbs: ["get", "list"]
202205
---
203206

204207
kind: ClusterRole

deploy/kubernetes/base/controller/controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ spec:
140140
args:
141141
- "--v=5"
142142
- "--endpoint=unix:/csi/csi.sock"
143+
- --enable-data-cache
143144
env:
144145
- name: GOOGLE_APPLICATION_CREDENTIALS
145146
value: "/etc/cloud-sa/cloud-sa.json"

deploy/kubernetes/base/node_linux/node.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ spec:
4646
- "--v=5"
4747
- "--endpoint=unix:/csi/csi.sock"
4848
- "--run-controller-service=false"
49+
- "--enable-data-cache"
50+
- "--node-name=$(KUBE_NODE_NAME)"
4951
securityContext:
5052
privileged: true
53+
env:
54+
- name: KUBE_NODE_NAME
55+
valueFrom:
56+
fieldRef:
57+
fieldPath: spec.nodeName
5158
volumeMounts:
5259
- name: kubelet-dir
5360
mountPath: /var/lib/kubelet
@@ -66,6 +73,8 @@ spec:
6673
mountPath: /run/udev
6774
- name: sys
6875
mountPath: /sys
76+
- name: lib-modules
77+
mountPath: /lib/modules
6978
volumes:
7079
- name: registration-dir
7180
hostPath:
@@ -101,6 +110,10 @@ spec:
101110
hostPath:
102111
path: /sys
103112
type: Directory
113+
- name: lib-modules
114+
hostPath:
115+
path: /lib/modules
116+
type: Directory
104117
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
105118
# See "special case". This will tolerate everything. Node component should
106119
# be scheduled on all nodes.

deploy/kubernetes/images/stable-master/image.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ metadata:
4949
name: imagetag-gcepd-driver
5050
imageTag:
5151
name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
52-
# Don't change stable image without changing pdImagePlaceholder in
53-
# test/k8s-integration/main.go
52+
# pdImagePlaceholder in test/k8s-integration/main.go is updated automatically with the newTag
5453
newName: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
55-
newTag: "v1.13.2"
54+
newTag: "v1.13.3"
5655
---

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ require (
5757
github.com/davecgh/go-spew v1.1.1 // indirect
5858
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
5959
github.com/felixge/httpsnoop v1.0.4 // indirect
60-
github.com/fsnotify/fsnotify v1.5.4 // indirect
61-
github.com/go-logr/logr v1.4.1 // indirect
60+
github.com/fsnotify/fsnotify v1.8.0 // indirect
61+
github.com/go-logr/logr v1.4.2 // indirect
6262
github.com/go-logr/stdr v1.2.2 // indirect
6363
github.com/go-openapi/jsonpointer v0.20.0 // indirect
6464
github.com/go-openapi/jsonreference v0.19.6 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,8 @@ github.com/frankban/quicktest v1.8.1/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9
10291029
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
10301030
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
10311031
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
1032-
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
1033-
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
1032+
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
1033+
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
10341034
github.com/fsouza/fake-gcs-server v0.0.0-20180612165233-e85be23bdaa8/go.mod h1:1/HufuJ+eaDf4KTnYdS6HJMGvMRU8d4cYTuu/1QaBbI=
10351035
github.com/fsouza/fake-gcs-server v1.19.4/go.mod h1:I0/88nHCASqJJ5M7zVF0zKODkYTcuXFW5J5yajsNJnE=
10361036
github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
@@ -1071,8 +1071,8 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg
10711071
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
10721072
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
10731073
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
1074-
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
1075-
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
1074+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
1075+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
10761076
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
10771077
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
10781078
github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=

initialize-driver.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
/bin/cp -r /lvm-tmp/lvm /etc/
4+
/bin/sed -i -e "s/.*allow_mixed_block_sizes = 0.*/ allow_mixed_block_sizes = 1/" /etc/lvm/lvm.conf
5+
/bin/sed -i -e "s/.*udev_sync = 1.*/ udev_sync = 0/" /etc/lvm/lvm.conf
6+
/bin/sed -i -e "s/.*udev_rules = 1.*/ udev_rules = 0/" /etc/lvm/lvm.conf
7+
/bin/sed -i -e "s/.*locking_dir = .*/ locking_dir = \"\/tmp\"/" /etc/lvm/lvm.conf
8+
9+
/gce-pd-csi-driver "$@"

pkg/common/constants.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@ const (
3232

3333
// Label that is set on a disk when it is used by a 'multi-zone' VolumeHandle
3434
MultiZoneLabel = "goog-gke-multi-zone"
35+
36+
// Data cache mode
37+
DataCacheModeWriteBack = "writeback"
38+
DataCacheModeWriteThrough = "writethrough"
39+
40+
ContextDataCacheSize = "data-cache-size"
41+
ContextDataCacheMode = "data-cache-mode"
42+
43+
// Keys in the publish context
44+
ContexLocalSsdCacheSize = "local-ssd-cache-size"
45+
// Node name for E2E tests
46+
TestNode = "test-node-csi-e2e"
47+
48+
// Default LSSD count for datacache E2E tests
49+
LocalSSDCountForDataCache = 2
50+
51+
// Node label for Data Cache (only applicable to GKE nodes)
52+
NodeLabelPrefix = "cloud.google.com/%s"
53+
DataCacheLssdCountLabel = "gke-data-cache-disk"
3554
)
3655

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

0 commit comments

Comments
 (0)