From 892bad1b7ba4e316f20903e7052c4710017301fe Mon Sep 17 00:00:00 2001 From: Praveen M Date: Wed, 21 Aug 2024 15:47:17 +0530 Subject: [PATCH] lint: update markdown files with prettier --write Signed-off-by: Praveen M --- CONTRIBUTING.md | 4 ++-- cmd/csi-addons/README.md | 2 +- docs/csi-addons-config.md | 10 +++++----- docs/csiaddonsnode.md | 17 ++++++++-------- docs/deploy-controller.md | 36 +++++++++++++++++----------------- docs/encryptionkeyrotation.md | 35 ++++++++++++++++----------------- docs/networkfence.md | 12 ++++++------ docs/reclaimspace.md | 35 ++++++++++++++++----------------- docs/volumereplication.md | 15 +++++++------- docs/volumereplicationclass.md | 6 +++--- 10 files changed, 85 insertions(+), 87 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f598f13b8..bc49a2ab0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,9 +20,9 @@ regularly participate in the project. There are two GitHub teams that contain members who can approve changes: - @csi-addons/kubernetes-csi-addons-contributors: regular contributors, - sending Pull-Requests, designing new features + sending Pull-Requests, designing new features - @csi-addons/kubernetes-csi-addons-reviewers: contributors to the general - CSI-Addons project, sharing expertise and domain knowledge + CSI-Addons project, sharing expertise and domain knowledge For changes that are related to the integration with other components or affect the user interface (Pull-Requests with the `api` label), an approval from diff --git a/cmd/csi-addons/README.md b/cmd/csi-addons/README.md index bec4e1416..fb4447a20 100644 --- a/cmd/csi-addons/README.md +++ b/cmd/csi-addons/README.md @@ -48,4 +48,4 @@ The following operations are supported: The above command assumes the running `csi-backend-nodeplugin` Pod has the `quay.io/csiaddons/k8s-sidecar` as a container named `csi-addons`. Executing -the `csi-addons -h` command then shows the help text. \ No newline at end of file +the `csi-addons -h` command then shows the help text. diff --git a/docs/csi-addons-config.md b/docs/csi-addons-config.md index 1a1ab7a47..4111c140c 100644 --- a/docs/csi-addons-config.md +++ b/docs/csi-addons-config.md @@ -4,11 +4,11 @@ CSI-Addons Operator can consume configuration from a ConfigMap named `csi-addons in the same namespace as the operator. This enables configuration of the operator to persist across upgrades. The ConfigMap can support the following configuration options: -| Option | Default value | Description | -| ----------------------------- | --------------- | --------------------------------------------- | -| `reclaim-space-timeout` | `"3m"` | Timeout for reclaimspace operation | -| `max-concurrent-reconciles` | `"100"` | Maximum number of concurrent reconciles | +| Option | Default value | Description | +| --------------------------- | ------------- | --------------------------------------- | +| `reclaim-space-timeout` | `"3m"` | Timeout for reclaimspace operation | +| `max-concurrent-reconciles` | `"100"` | Maximum number of concurrent reconciles | [`csi-addons-config` ConfigMap](../deploy/controller/csi-addons-config.yaml) is provided as an example. -> Note: The operator pod needs to be restarted for any change in configuration to take effect. \ No newline at end of file +> Note: The operator pod needs to be restarted for any change in configuration to take effect. diff --git a/docs/csiaddonsnode.md b/docs/csiaddonsnode.md index c2e638c8b..cb6076955 100644 --- a/docs/csiaddonsnode.md +++ b/docs/csiaddonsnode.md @@ -8,12 +8,13 @@ kind: CSIAddonsNode metadata: name: csiaddonsnode-sample spec: - driver: - name: driver.csi.example.io - endpoint: pod://csiaddonsnode-sample.csi-addons-system:9070 - nodeID: node-1 + driver: + name: driver.csi.example.io + endpoint: pod://csiaddonsnode-sample.csi-addons-system:9070 + nodeID: node-1 ``` -+ `driver` contains the required information about the CSI driver. - + `name` contains the name of the driver. The name of the driver is in the format: `driver.csi.example.io` - + `endpoint` contains the URL that contains the name of the Pod and its Namespace that can be used by the controller to connect to. - + `nodeID` contains the ID of node to identify on which node the side-car is running. + +- `driver` contains the required information about the CSI driver. + - `name` contains the name of the driver. The name of the driver is in the format: `driver.csi.example.io` + - `endpoint` contains the URL that contains the name of the Pod and its Namespace that can be used by the controller to connect to. + - `nodeID` contains the ID of node to identify on which node the side-car is running. diff --git a/docs/deploy-controller.md b/docs/deploy-controller.md index dc4bbbddf..8d8bd1ad9 100644 --- a/docs/deploy-controller.md +++ b/docs/deploy-controller.md @@ -6,13 +6,13 @@ The CSI-Addons Controller can be deployed by different ways: **Available command-line arguments:** -| Option | Default value | Description | -| ----------------------------- | --------------- | --------------------------------------------- | -| `--metrics-bind-address` | `:8080` | The address the metric endpoint binds to. | -| `--health-probe-bind-address` | `:8081` | The address the probe endpoint binds to. | -| `--leader-elect` | `false` | Enable leader election for controller manager.| -| `--reclaim-space-timeout` | `3m` | Timeout for reclaimspace operation | -| `--max-concurrent-reconciles` | 100 | Maximum number of concurrent reconciles | +| Option | Default value | Description | +| ----------------------------- | ------------- | ---------------------------------------------- | +| `--metrics-bind-address` | `:8080` | The address the metric endpoint binds to. | +| `--health-probe-bind-address` | `:8081` | The address the probe endpoint binds to. | +| `--leader-elect` | `false` | Enable leader election for controller manager. | +| `--reclaim-space-timeout` | `3m` | Timeout for reclaimspace operation | +| `--max-concurrent-reconciles` | 100 | Maximum number of concurrent reconciles | > Note: Some of the above configuration options can also be configured using [`"csi-addons-config"` configmap](./csi-addons-config.md). @@ -24,7 +24,7 @@ The latest CSI-Addons Controller can be installed using the YAML files in `deplo The versioned deployment of the CSI-Addons Controller can be installed using the specific version's YAML files as shown below: ->Note: set the `RELEASE` variable to the required version. +> Note: set the `RELEASE` variable to the required version. ```console $ export RELEASE="v0.8.0" @@ -56,11 +56,11 @@ deployment.apps/csi-addons-controller-manager created This is the recommended and easiest way to deploy the controller. -* The "crds.yaml" create the required crds for csi-addons operations. +- The "crds.yaml" create the required crds for csi-addons operations. -* The "rbac.yaml" creates the required rbac. +- The "rbac.yaml" creates the required rbac. -* The "setup-controller.yaml" creates the csi-addons-controller-manager. +- The "setup-controller.yaml" creates the csi-addons-controller-manager. ## Installation by operator-sdk @@ -126,11 +126,11 @@ requirements of the cluster after observation. The default resource requirements for the CSI-Addons Controller are as follows: ```yaml - resources: - limits: - cpu: 1000m - memory: 512Mi - requests: - cpu: 10m - memory: 64Mi +resources: + limits: + cpu: 1000m + memory: 512Mi + requests: + cpu: 10m + memory: 64Mi ``` diff --git a/docs/encryptionkeyrotation.md b/docs/encryptionkeyrotation.md index 93f8e2b32..bdae4c33c 100644 --- a/docs/encryptionkeyrotation.md +++ b/docs/encryptionkeyrotation.md @@ -15,11 +15,11 @@ spec: timeout: 600 ``` -+ `target` represents volume target on which the operation will be performed. - + `persistentVolumeClaim` contains a string indicating the name of `PersistentVolumeClaim`. -+ `backOfflimit` specifies the number of retries before marking key rotation operation as failed. If not specified, defaults to 6. Maximum allowed value is 60 and minimum allowed value is 0. -+ `retryDeadlineSeconds` specifies the duration in seconds relative to the start time that the operation may be retried; value must be positive integer. If not specified, defaults to 600 seconds. Maximum allowed value is 1800. -+ `timeout` specifies the timeout in seconds for the grpc request sent to the CSI driver. If not specified, defaults to global timeout of 3 minutes. Minimum allowed value is 60. +- `target` represents volume target on which the operation will be performed. + - `persistentVolumeClaim` contains a string indicating the name of `PersistentVolumeClaim`. +- `backOfflimit` specifies the number of retries before marking key rotation operation as failed. If not specified, defaults to 6. Maximum allowed value is 60 and minimum allowed value is 0. +- `retryDeadlineSeconds` specifies the duration in seconds relative to the start time that the operation may be retried; value must be positive integer. If not specified, defaults to 600 seconds. Maximum allowed value is 1800. +- `timeout` specifies the timeout in seconds for the grpc request sent to the CSI driver. If not specified, defaults to global timeout of 3 minutes. Minimum allowed value is 60. ## EncryptionKeyRotationCronJob @@ -44,22 +44,22 @@ spec: retryDeadlineSeconds: 600 target: persistentVolumeClaim: data-pvc - schedule: '@weekly' + schedule: "@weekly" successfulJobsHistoryLimit: 3 ``` -+ `concurrencyPolicy` describes what happens when a new `EncryptionKeyRotationJob` is +- `concurrencyPolicy` describes what happens when a new `EncryptionKeyRotationJob` is scheduled by the `EncryptionKeyRotationCronJob`, while a previous `EncryptionKeyRotationJob` is still running. The default `Forbid` prevents starting new job, whereas `Replace` can be used to delete the running job (potentially in a failure state) and create a new one. -+ `failedJobsHistoryLimit` keeps at most the number of failed +- `failedJobsHistoryLimit` keeps at most the number of failed `EncryptionKeyRotationJobs` around for troubleshooting -+ `jobTemplate` contains the `EncryptionKeyRotationJob.spec` structure, which describes +- `jobTemplate` contains the `EncryptionKeyRotationJob.spec` structure, which describes the details of the requested `EncryptionKeyRotationJob` operation. -+ `schedule` is in the same [format as Kubernetes CronJobs][batch_cronjob] that +- `schedule` is in the same [format as Kubernetes CronJobs][batch_cronjob] that sets the and/or interval of the recurring operation request. -+ `successfulJobsHistoryLimit` can be used to keep at most number of successful +- `successfulJobsHistoryLimit` can be used to keep at most number of successful `EncryptionKeyRotationJob` operations. ## Annotating PersistentVolumeClaims @@ -88,18 +88,17 @@ NAME SCHEDULE SUSPEND ACTIVE LASTSCHEDULE AGE data-pvc-1642664617 */1 * * * * 3s ``` -+ Upon adding annotation as shown above, a `EncryptionKeyRotationCronJob` with name +- Upon adding annotation as shown above, a `EncryptionKeyRotationCronJob` with name `"-xxxxxxx"` is created (pvc name suffixed with current time hash when the job was created). -+ `schedule` value is in the same [format as Kubernetes CronJobs][batch_cronjob] +- `schedule` value is in the same [format as Kubernetes CronJobs][batch_cronjob] that sets the and/or interval of the recurring operation request. -+ Default schedule value `"@weekly"` is used if `schedule` value is empty or in invalid format. -+ `EncryptionKeyRotationCronJob` is recreated when `schedule` is modified and deleted when +- Default schedule value `"@weekly"` is used if `schedule` value is empty or in invalid format. +- `EncryptionKeyRotationCronJob` is recreated when `schedule` is modified and deleted when the annotation is removed. [batch_cronjob]: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ -[go_cron]: - https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format +[go_cron]: https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format ## Annotating Namespace @@ -147,4 +146,4 @@ storageclass.storage.k8s.io/rbd-sc annotated over StorageClass annotation. The kubernetes-csi-addons only generate a `EncryptionKeyRotationCronJob` if the annotation exists on the StorageClass. If an admin needs to modify or delete the annotation on the StorageClass, they must perform the same action on all the PersistentVolumeClaims -created from this StorageClass. \ No newline at end of file +created from this StorageClass. diff --git a/docs/networkfence.md b/docs/networkfence.md index a666d1386..f75784b22 100644 --- a/docs/networkfence.md +++ b/docs/networkfence.md @@ -26,9 +26,9 @@ spec: > **Note**: Creation of a NetworkFence CR blocks access to the corresponding CIDR block; which is then unblocked the CR deletion. -+ `provisioner`: specifies the name of storage provisioner. -+ `cidrs`: refers to the CIDR blocks on which the mentioned fence/unfence operation is to be performed. -+ `secret`: refers to the kubernetes secret required for network fencing operation. - + `name`: specifies the name of the secret - + `namespace`: specifies the namespace in which the secret is located. -+ `parameters`: specifies storage provider specific parameters. +- `provisioner`: specifies the name of storage provisioner. +- `cidrs`: refers to the CIDR blocks on which the mentioned fence/unfence operation is to be performed. +- `secret`: refers to the kubernetes secret required for network fencing operation. + - `name`: specifies the name of the secret + - `namespace`: specifies the namespace in which the secret is located. +- `parameters`: specifies storage provider specific parameters. diff --git a/docs/reclaimspace.md b/docs/reclaimspace.md index a9adee228..a9f931a80 100644 --- a/docs/reclaimspace.md +++ b/docs/reclaimspace.md @@ -15,11 +15,11 @@ spec: timeout: 600 ``` -+ `target` represents volume target on which the operation will be performed. - + `persistentVolumeClaim` contains a string indicating the name of `PersistentVolumeClaim`. -+ `backOfflimit` specifies the number of retries before marking reclaim space operation as failed. If not specified, defaults to 6. Maximum allowed value is 60 and minimum allowed value is 0. -+ `retryDeadlineSeconds` specifies the duration in seconds relative to the start time that the operation may be retried; value must be positive integer. If not specified, defaults to 600 seconds. Maximum allowed value is 1800. -+ `timeout` specifies the timeout in seconds for the grpc request sent to the CSI driver. If not specified, defaults to global reclaimspace timeout. Minimum allowed value is 60. +- `target` represents volume target on which the operation will be performed. + - `persistentVolumeClaim` contains a string indicating the name of `PersistentVolumeClaim`. +- `backOfflimit` specifies the number of retries before marking reclaim space operation as failed. If not specified, defaults to 6. Maximum allowed value is 60 and minimum allowed value is 0. +- `retryDeadlineSeconds` specifies the duration in seconds relative to the start time that the operation may be retried; value must be positive integer. If not specified, defaults to 600 seconds. Maximum allowed value is 1800. +- `timeout` specifies the timeout in seconds for the grpc request sent to the CSI driver. If not specified, defaults to global reclaimspace timeout. Minimum allowed value is 60. ## ReclaimSpaceCronJob @@ -44,22 +44,22 @@ spec: retryDeadlineSeconds: 600 target: persistentVolumeClaim: data-pvc - schedule: '@weekly' + schedule: "@weekly" successfulJobsHistoryLimit: 3 ``` -+ `concurrencyPolicy` describes what happens when a new `ReclaimSpaceJob` is +- `concurrencyPolicy` describes what happens when a new `ReclaimSpaceJob` is scheduled by the `ReclaimSpaceCronJob`, while a previous `ReclaimSpaceJob` is still running. The default `Forbid` prevents starting new job, whereas `Replace` can be used to delete the running job (potentially in a failure state) and create a new one. -+ `failedJobsHistoryLimit` keeps at most the number of failed +- `failedJobsHistoryLimit` keeps at most the number of failed `ReclaimSpaceJobs` around for troubleshooting -+ `jobTemplate` contains the `ReclaimSpaceJob.spec` structure, which describes +- `jobTemplate` contains the `ReclaimSpaceJob.spec` structure, which describes the details of the requested `ReclaimSpaceJob` operation. -+ `schedule` is in the same [format as Kubernetes CronJobs][batch_cronjob] that +- `schedule` is in the same [format as Kubernetes CronJobs][batch_cronjob] that sets the and/or interval of the recurring operation request. -+ `successfulJobsHistoryLimit` can be used to keep at most number of successful +- `successfulJobsHistoryLimit` can be used to keep at most number of successful `ReclaimSpaceJob` operations. ## Annotating PerstentVolumeClaims @@ -88,18 +88,17 @@ NAME SCHEDULE SUSPEND ACTIVE LASTSCHEDULE AGE data-pvc-1642664617 */1 * * * * 3s ``` -+ Upon adding annotation as shown above, a `ReclaimSpaceCronJob` with name +- Upon adding annotation as shown above, a `ReclaimSpaceCronJob` with name `"-xxxxxxx"` is created (pvc name suffixed with current time hash when the job was created). -+ `schedule` value is in the same [format as Kubernetes CronJobs][batch_cronjob] +- `schedule` value is in the same [format as Kubernetes CronJobs][batch_cronjob] that sets the and/or interval of the recurring operation request. -+ Default schedule value `"@weekly"` is used if `schedule` value is empty or in invalid format. -+ `ReclaimSpaceCronJob` is recreated when `schedule` is modified and deleted when +- Default schedule value `"@weekly"` is used if `schedule` value is empty or in invalid format. +- `ReclaimSpaceCronJob` is recreated when `schedule` is modified and deleted when the annotation is removed. [batch_cronjob]: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ -[go_cron]: - https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format +[go_cron]: https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format ## Annotating Namespace @@ -144,4 +143,4 @@ storageclass.storage.k8s.io/rbd-sc annotated over StorageClass annotation. The kubernetes-csi-addons only generate a `ReclaimSpaceCronJob` if the annotation exists on the StorageClass. If an admin needs to modify or delete the annotation on the StorageClass, they must perform the same action on all the PersistentVolumeClaims -created from this StorageClass. \ No newline at end of file +created from this StorageClass. diff --git a/docs/volumereplication.md b/docs/volumereplication.md index 8f9b0cd34..8ce1cb2c5 100644 --- a/docs/volumereplication.md +++ b/docs/volumereplication.md @@ -6,20 +6,19 @@ VolumeReplication is a namespaced resource that contains references to storage o `replicationState` is the state of the volume being referenced. Possible values are `primary`, `secondary` and `resync`. -+ `primary` denotes that the volume is primary -+ `secondary` denotes that the volume is secondary -+ `resync` denotes that the volume needs to be resynced +- `primary` denotes that the volume is primary +- `secondary` denotes that the volume is secondary +- `resync` denotes that the volume needs to be resynced `dataSource` contains typed reference to the source being replicated. -+ `apiGroup` is the group for the resource being referenced. If apiGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, apiGroup is required. -+ `kind` is the kind of resource being replicated. For eg. PersistentVolumeClaim -+ `name` is the name of the resource +- `apiGroup` is the group for the resource being referenced. If apiGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, apiGroup is required. +- `kind` is the kind of resource being replicated. For eg. PersistentVolumeClaim +- `name` is the name of the resource `replicationHandle` (optional) is an existing (but new) replication ID. - -``` yaml +```yaml apiVersion: replication.storage.openshift.io/v1alpha1 kind: VolumeReplication metadata: diff --git a/docs/volumereplicationclass.md b/docs/volumereplicationclass.md index 670439652..10da62803 100644 --- a/docs/volumereplicationclass.md +++ b/docs/volumereplicationclass.md @@ -8,10 +8,10 @@ ## Reserved parameter keys -+ `replication.storage.openshift.io/replication-secret-name` -+ `replication.storage.openshift.io/replication-secret-namespace` +- `replication.storage.openshift.io/replication-secret-name` +- `replication.storage.openshift.io/replication-secret-namespace` -``` yaml +```yaml apiVersion: replication.storage.openshift.io/v1alpha1 kind: VolumeReplicationClass metadata: