Skip to content

Commit

Permalink
Remote volume config from examples
Browse files Browse the repository at this point in the history
For Quobyte 2.x clusters, we expect upgrade to 3.x.
Nevertheless, keeping configuration for any existing
2.x clusters out there. For Quobyte version  (csi driver
values.yaml quobyte.version config) 2 only configuration
is used. For other versions, volume config is ignored.
  • Loading branch information
venkatsc committed Sep 25, 2024
1 parent 3193d49 commit 2588726
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Quobyte requires a secret to authenticate volume create and delete requests. Cre

Create a [storage class](example/StorageClass.yaml) with the `provisioner` set to `csi.quobyte.com` along with other configuration
parameters. You could create multiple storage classes by varying `parameters` such as
`quobyteTenant`, `quobyteConfig` etc.
`quobyteTenant` etc.

```bash
kubectl create -f example/StorageClass.yaml
Expand Down
2 changes: 0 additions & 2 deletions example/Storage-class-shared-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
2 changes: 0 additions & 2 deletions example/StorageClass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ parameters:
# Mounting requires file system/mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-mount-secret"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
user: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
2 changes: 0 additions & 2 deletions kind-cluster/test-configs/test_3.x/k8s_storage_class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ parameters:
# Mount secrets
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
# Quobyte volume configuration
quobyteConfig: "BASE"
# creates quota for the volume if set to true. The size of the Quota
# is the storage requested in PVC. If false, creates volume without size limit.
createQuota: "true"
Expand Down
8 changes: 6 additions & 2 deletions src/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ func (d *QuobyteDriver) CreateVolume(ctx context.Context, req *csi.CreateVolumeR
volRequest := &quobyte.CreateVolumeRequest{}
// will be overriden if shared volume name is specified in storage class
volRequest.Name = dynamicVolumeName
volRequest.ConfigurationName = DefaultConfig
volRequest.RootUserId = DefaultUser
volRequest.RootGroupId = DefaultGroup
createQuota := DefaultCreateQuota
volRequest.AccessMode = DefaultAccessModes
if (d.QuobyteVersion == 2) {
volRequest.ConfigurationName = DefaultConfig
}
for k, v := range params {
switch strings.ToLower(k) {
case "quobytetenant":
Expand All @@ -75,7 +77,9 @@ func (d *QuobyteDriver) CreateVolume(ctx context.Context, req *csi.CreateVolumeR
case "group":
volRequest.RootGroupId = v
case "quobyteconfig":
volRequest.ConfigurationName = v
if (d.QuobyteVersion == 2) {
volRequest.ConfigurationName = v
}
case "createquota":
createQuota = strings.ToLower(v) == "true"
case "labels":
Expand Down
1 change: 0 additions & 1 deletion usage-example/shared-volume/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ parameters:
csi.storage.k8s.io/controller-expand-secret-namespace: "quobyte"
csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials"
csi.storage.k8s.io/node-publish-secret-namespace: "quobyte"
quobyteConfig: "BASE"
user: root
group: root
accessMode: "750"
Expand Down

0 comments on commit 2588726

Please sign in to comment.