You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/cinder-csi-plugin/main.go
+40-16Lines changed: 40 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,14 @@ import (
31
31
)
32
32
33
33
var (
34
-
endpointstring
35
-
nodeIDstring
36
-
cloudConfig []string
37
-
clusterstring
38
-
httpEndpointstring
34
+
endpointstring
35
+
nodeIDstring
36
+
cloudConfig []string
37
+
clusterstring
38
+
httpEndpointstring
39
+
provideControllerServicebool
40
+
provideNodeServicebool
41
+
noClientbool
39
42
)
40
43
41
44
funcmain() {
@@ -64,7 +67,12 @@ func main() {
64
67
}
65
68
66
69
cmd.PersistentFlags().StringVar(&cluster, "cluster", "", "The identifier of the cluster that the plugin is running in.")
67
-
cmd.PersistentFlags().StringVar(&httpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled.")
70
+
cmd.PersistentFlags().StringVar(&httpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for providing metrics for diagnostics, will listen (example: `:8080`). The default is empty string, which means the server is disabled.")
71
+
72
+
cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
73
+
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")
74
+
cmd.PersistentFlags().BoolVar(&noClient, "node-service-no-os-client", false, "If set to true then the CSI driver node service will not use the OpenStack client (default: false)")
klog.Fatalf("Unable to mark flag nodeid to be required: %v", err)
111
-
}
126
+
cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "this node's ID. This value is required if the node service is provided by this CSI driver instance.")
cmd.PersistentFlags().StringVar(&clusterID, "cluster-id", "", "The identifier of the cluster that the plugin is running in.")
134
149
150
+
cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
151
+
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")
If set to true then the CSI driver does not provide the OpenStack client in the node service.
118
+
119
+
The default is to provide the OpenStack client in the node service.
120
+
</dd>
91
121
</dl>
92
122
93
123
## Driver Config
@@ -104,7 +134,7 @@ Implementation of `cinder-csi-plugin` relies on following OpenStack services.
104
134
For Driver configuration, parameters must be passed via configuration file specified in `$CLOUD_CONFIG` environment variable.
105
135
The following sections are supported in configuration file.
106
136
107
-
### Global
137
+
### Global
108
138
For Cinder CSI Plugin to authenticate with OpenStack Keystone, required parameters needs to be passed in `[Global]` section of the file. For all supported parameters, please refer [Global](../openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md#global) section.
| StorageClass `parameters`|`availability`|`nova`| String. Volume Availability Zone |
245
275
| StorageClass `parameters`|`type`| Empty String | String. Name/ID of Volume type. Corresponding volume type should exist in cinder |
246
276
| VolumeSnapshotClass `parameters`|`force-create`|`false`| Enable to support creating snapshot for a volume in in-use status |
247
-
| Inline Volume `volumeAttributes`|`capacity`|`1Gi`| volume size for creating inline volumes|
277
+
| Inline Volume `volumeAttributes`|`capacity`|`1Gi`| volume size for creating inline volumes|
248
278
| Inline Volume `VolumeAttributes`|`type`| Empty String | Name/ID of Volume type. Corresponding volume type should exist in cinder |
249
279
250
280
## Local Development
@@ -256,14 +286,14 @@ To build the plugin, run
256
286
```
257
287
$ export ARCH=amd64 # Defaults to amd64
258
288
$ make build-cmd-cinder-csi-plugin
259
-
```
289
+
```
260
290
261
291
To build cinder-csi-plugin image
262
292
263
293
```
264
294
$ export ARCH=amd64 # Defaults to amd64
265
-
$ make image-cinder-csi-plugin
266
-
```
295
+
$ make build-local-image-cinder-csi-plugin
296
+
```
267
297
268
298
### Testing
269
299
@@ -274,7 +304,7 @@ To run all unit tests:
274
304
$ make test
275
305
```
276
306
#### Sanity Tests
277
-
Sanity tests ensures the CSI spec conformance of the driver. For more info, refer [Sanity check](https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity)
307
+
Sanity tests ensures the CSI spec conformance of the driver. For more info, refer [Sanity check](https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity)
278
308
279
309
Run sanity tests for cinder CSI driver using:
280
310
@@ -288,5 +318,5 @@ Optionally, to test the driver csc tool could be used. please refer, [usage guid
288
318
289
319
Starting from Kubernetes 1.21, OpenStack Cinder CSI migration is supported as beta feature and is `ON` by default. Cinder CSI driver must be installed on clusters on OpenStack for Cinder volumes to work. If you have persistence volumes that are created with in-tree `kubernetes.io/cinder` plugin, you could migrate to use `cinder.csi.openstack.org` Container Storage Interface (CSI) Driver.
290
320
291
-
* The CSI Migration feature for Cinder, when enabled, shims all plugin operations from the existing in-tree plugin to the `cinder.csi.openstack.org` CSI Driver.
321
+
* The CSI Migration feature for Cinder, when enabled, shims all plugin operations from the existing in-tree plugin to the `cinder.csi.openstack.org` CSI Driver.
292
322
* For more info, please refer [Migrate to CCM with CSI Migration](../openstack-cloud-controller-manager/migrate-to-ccm-with-csimigration.md#migrate-from-in-tree-cloud-provider-to-openstack-cloud-controller-manager-and-enable-csimigration) guide
0 commit comments