Skip to content

Commit

Permalink
Merge commit 'd4f3bf3f2cff7b30738eef9e9e4fab844376f773' into sync_us-…
Browse files Browse the repository at this point in the history
…-master

Signed-off-by: Ceph Jenkins <[email protected]>
  • Loading branch information
Ceph Jenkins committed Sep 19, 2024
2 parents 0648854 + d4f3bf3 commit ad4ea7d
Show file tree
Hide file tree
Showing 27 changed files with 320 additions and 53 deletions.
3 changes: 3 additions & 0 deletions Documentation/CRDs/Cluster/ceph-cluster-crd.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ If this value is empty, each pod will get an ephemeral directory to store their
* `externalMgrPrometheusPort`: external prometheus manager module port. See [external cluster configuration](./external-cluster/external-cluster.md) for more details.
* `port`: The internal prometheus manager module port where the prometheus mgr module listens. The port may need to be configured when host networking is enabled.
* `interval`: The interval for the prometheus module to to scrape targets.
* `exporter`: Ceph exporter metrics config.
* `perfCountersPrioLimit`: Specifies which performance counters are exported. Corresponds to `--prio-limit` Ceph exporter flag. `0` - all counters are exported, default is `5`.
* `statsPeriodSeconds`: Time to wait before sending requests again to exporter server (seconds). Corresponds to `--stats-period` Ceph exporter flag. Default is `5`.
* `network`: For the network settings for the cluster, refer to the [network configuration settings](#network-configuration-settings)
* `mon`: contains mon related options [mon settings](#mon-settings)
For more details on the mons and when to choose a number other than `3`, see the [mon health doc](../../Storage-Configuration/Advanced/ceph-mon-health.md).
Expand Down
53 changes: 53 additions & 0 deletions Documentation/CRDs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -3686,6 +3686,45 @@ map[string]int
</tr>
</tbody>
</table>
<h3 id="ceph.rook.io/v1.CephExporterSpec">CephExporterSpec
</h3>
<p>
(<em>Appears on:</em><a href="#ceph.rook.io/v1.MonitoringSpec">MonitoringSpec</a>)
</p>
<div>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>perfCountersPrioLimit</code><br/>
<em>
int64
</em>
</td>
<td>
<p>Only performance counters greater than or equal to this option are fetched</p>
</td>
</tr>
<tr>
<td>
<code>statsPeriodSeconds</code><br/>
<em>
int64
</em>
</td>
<td>
<p>Time to wait before sending requests again to exporter server (seconds)</p>
</td>
</tr>
</tbody>
</table>
<h3 id="ceph.rook.io/v1.CephFilesystemStatus">CephFilesystemStatus
</h3>
<p>
Expand Down Expand Up @@ -8527,6 +8566,20 @@ Kubernetes meta/v1.Duration
<p>Interval determines prometheus scrape interval</p>
</td>
</tr>
<tr>
<td>
<code>exporter</code><br/>
<em>
<a href="#ceph.rook.io/v1.CephExporterSpec">
CephExporterSpec
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Ceph exporter configuration</p>
</td>
</tr>
</tbody>
</table>
<h3 id="ceph.rook.io/v1.MultiClusterServiceSpec">MultiClusterServiceSpec
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Helm-Charts/operator-chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following table lists the configurable parameters of the rook-operator chart
| `csi.clusterName` | Cluster name identifier to set as metadata on the CephFS subvolume and RBD images. This will be useful in cases like for example, when two container orchestrator clusters (Kubernetes/OCP) are using a single ceph cluster | `nil` |
| `csi.csiAddons.enabled` | Enable CSIAddons | `false` |
| `csi.csiAddons.repository` | CSIAddons sidecar image repository | `"quay.io/csiaddons/k8s-sidecar"` |
| `csi.csiAddons.tag` | CSIAddons sidecar image tag | `"v0.9.1"` |
| `csi.csiAddons.tag` | CSIAddons sidecar image tag | `"v0.10.0"` |
| `csi.csiAddonsPort` | CSI Addons server port | `9070` |
| `csi.csiCephFSPluginResource` | CEPH CSI CephFS plugin resource requirement list | see values.yaml |
| `csi.csiCephFSPluginVolume` | The volume of the CephCSI CephFS plugin DaemonSet | `nil` |
Expand Down
1 change: 1 addition & 0 deletions Documentation/Storage-Configuration/Ceph-CSI/.pages
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
nav:
- ceph-csi-drivers.md
- ceph-csi-snapshot.md
- ceph-csi-volume-group-snapshot.md
- ceph-csi-volume-clone.md
- custom-images.md
- ...
32 changes: 16 additions & 16 deletions Documentation/Storage-Configuration/Ceph-CSI/ceph-csi-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ that the controller inspects and forwards to one or more CSI-Addons sidecars for
Deploy the controller by running the following commands:
```console
kubectl create -f https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.9.1/crds.yaml
kubectl create -f https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.9.1/rbac.yaml
kubectl create -f https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.9.1/setup-controller.yaml
kubectl create -f https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.10.0/crds.yaml
kubectl create -f https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.10.0/rbac.yaml
kubectl create -f https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.10.0/setup-controller.yaml
```

This creates the required CRDs and configures permissions.
Expand Down Expand Up @@ -196,22 +196,22 @@ Execute the following to enable the CSI-Addons sidecars:
CSI-Addons supports the following operations:

* Reclaim Space
* [Creating a ReclaimSpaceJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/reclaimspace.md#reclaimspacejob)
* [Creating a ReclaimSpaceCronJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/reclaimspace.md#reclaimspacecronjob)
* [Annotating PersistentVolumeClaims](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/reclaimspace.md#annotating-perstentvolumeclaims)
* [Annotating Namespace](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/reclaimspace.md#annotating-namespace)
* [Annotating StorageClass](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/reclaimspace.md#annotating-storageclass)
* [Creating a ReclaimSpaceJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/reclaimspace.md#reclaimspacejob)
* [Creating a ReclaimSpaceCronJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/reclaimspace.md#reclaimspacecronjob)
* [Annotating PersistentVolumeClaims](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/reclaimspace.md#annotating-perstentvolumeclaims)
* [Annotating Namespace](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/reclaimspace.md#annotating-namespace)
* [Annotating StorageClass](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/reclaimspace.md#annotating-storageclass)
* Network Fencing
* [Creating a NetworkFence](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/networkfence.md)
* [Creating a NetworkFence](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/networkfence.md)
* Volume Replication
* [Creating VolumeReplicationClass](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/volumereplicationclass.md)
* [Creating VolumeReplication CR](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/volumereplication.md)
* [Creating VolumeReplicationClass](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/volumereplicationclass.md)
* [Creating VolumeReplication CR](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/volumereplication.md)
* Key Rotation Job for PV encryption
* [Creating EncryptionKeyRotationJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/encryptionkeyrotation.md#encryptionkeyrotationjob)
* [Creating EncryptionKeyRotationCronJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/encryptionkeyrotation.md#encryptionkeyrotationcronjob)
* [Annotating PersistentVolumeClaims](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/encryptionkeyrotation.md#annotating-persistentvolumeclaims)
* [Annotating Namespace](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/encryptionkeyrotation.md#annotating-namespace)
* [Annotating StorageClass](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.9.1/docs/encryptionkeyrotation.md#annotating-storageclass)
* [Creating EncryptionKeyRotationJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/encryptionkeyrotation.md#encryptionkeyrotationjob)
* [Creating EncryptionKeyRotationCronJob](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/encryptionkeyrotation.md#encryptionkeyrotationcronjob)
* [Annotating PersistentVolumeClaims](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/encryptionkeyrotation.md#annotating-persistentvolumeclaims)
* [Annotating Namespace](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/encryptionkeyrotation.md#annotating-namespace)
* [Annotating StorageClass](https://github.com/csi-addons/kubernetes-csi-addons/blob/v0.10.0/docs/encryptionkeyrotation.md#annotating-storageclass)

## Enable RBD and CephFS Encryption Support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,3 @@ kubectl delete -f deploy/examples/csi/cephfs/pvc-restore.yaml
kubectl delete -f deploy/examples/csi/cephfs/snapshot.yaml
kubectl delete -f deploy/examples/csi/cephfs/snapshotclass.yaml
```

## Limitations

- There is a limit of 400 snapshots per cephFS filesystem.
- The PVC cannot be deleted if it has snapshots. make sure all the snapshots on the PVC are deleted before you delete the PVC.
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Volume Group Snapshots
---

Ceph provides the ability to create crash-consistent snapshots of multiple volumes.
A group snapshot represents “copies” from multiple volumes that are taken at the same point in time.
A group snapshot can be used either to rehydrate new volumes (pre-populated with the snapshot data)
or to restore existing volumes to a previous state (represented by the snapshots)


## Prerequisites

- Install the [snapshot controller, volume group snapshot and snapshot CRDs](https://github.com/kubernetes-csi/external-snapshotter/tree/master#usage),
refer to VolumeGroupSnapshot documentation
[here](https://github.com/kubernetes-csi/external-snapshotter/tree/master#volume-group-snapshot-support) for more details.

- A `VolumeGroupSnapshotClass` is needed for the volume group snapshot to work. The purpose of a `VolumeGroupSnapshotClass` is
defined in [the kubernetes
documentation](https://kubernetes.io/blog/2023/05/08/kubernetes-1-27-volume-group-snapshot-alpha/).
In short, as the documentation describes it:

!!! info
Created by cluster administrators to describe how volume group snapshots
should be created. including the driver information, the deletion policy, etc.

## Volume Group Snapshots

### CephFS VolumeGroupSnapshotClass

In [VolumeGroupSnapshotClass](https://github.com/rook/rook/tree/master/deploy/examples/csi/cephfs/groupsnapshotclass.yaml),
the `csi.storage.k8s.io/group-snapshotter-secret-name` parameter should reference the
name of the secret created for the cephfs-plugin.

In the `VolumeGroupSnapshotClass`, update the value of the `clusterID` field to match the namespace
that Rook is running in. When Ceph CSI is deployed by Rook, the operator will automatically
maintain a configmap whose contents will match this key. By default this is
"rook-ceph".

```console
kubectl create -f deploy/examples/csi/cephfs/groupsnapshotclass.yaml
```

### CephFS VolumeGroupSnapshot

In [VolumeGroupSnapshot](https://github.com/rook/rook/tree/master/deploy/examples/csi/cephfs/groupsnapshot.yaml),
`volumeGroupSnapshotClassName` should be the name of the `VolumeGroupSnapshotClass`
previously created. The labels inside `matchLabels` should be present on the
PVCs that are already created by the CephFS CSI driver.

```console
kubectl create -f deploy/examples/csi/cephfs/groupsnapshot.yaml
```

### Verify CephFS GroupSnapshot Creation

```console
$ kubectl get volumegroupsnapshotclass
NAME DRIVER DELETIONPOLICY AGE
csi-cephfsplugin-groupsnapclass rook-ceph.cephfs.csi.ceph.com Delete 21m
```

```console
$ kubectl get volumegroupsnapshot
NAME READYTOUSE VOLUMEGROUPSNAPSHOTCLASS VOLUMEGROUPSNAPSHOTCONTENT CREATIONTIME AGE
cephfs-groupsnapshot true csi-cephfsplugin-groupsnapclass groupsnapcontent-d13f4d95-8822-4729-9586-4f222a3f788e 5m37s 5m39s
```

The snapshot will be ready to restore to a new PVC when `READYTOUSE` field of the
`volumegroupsnapshot` is set to true.

### Restore the CephFS volume group snapshot to a new PVC

Find the name of the snapshots created by the `VolumeGroupSnapshot` first by running:

```console
$ kubectl get volumegroupsnapshot/cephfs-groupsnapshot -o=jsonpath='{range .status.pvcVolumeSnapshotRefList[*]}PVC: {.persistentVolumeClaimRef.name}, Snapshot: {.volumeSnapshotRef.name}{"\n"}{end}'
PVC: cephfs-pvc, Snapshot: snapshot-9d21b143904c10f49ddc92664a7e8fe93c23387d0a88549c14337484ebaf1011-2024-09-12-3.49.13
```

It will list the PVC's name followed by its snapshot name.

In
[pvc-restore](https://github.com/rook/rook/tree/master/deploy/examples/csi/cephfs/pvc-restore.yaml),
`dataSource` should be one of the `Snapshot` that we just
found. The `dataSource` kind should be the `VolumeSnapshot`.

Create a new PVC from the snapshot

```console
kubectl create -f deploy/examples/csi/cephfs/pvc-restore.yaml
```

### Verify CephFS Restore PVC Creation

```console
$ kubectl get pvc
cephfs-pvc Bound pvc-9ae60bf9-4931-4f9a-9de1-7f45f31fe4da 1Gi RWO rook-cephfs <unset> 171m
cephfs-pvc-restore Bound pvc-b4b73cbb-5061-48c7-9ac8-e1202508cf97 1Gi RWO rook-cephfs <unset> 46s
```

## CephFS volume group snapshot resource Cleanup

To clean the resources created by this example, run the following:

```console
kubectl delete -f deploy/examples/csi/cephfs/pvc-restore.yaml
kubectl delete -f deploy/examples/csi/cephfs/groupsnapshot.yaml
kubectl delete -f deploy/examples/csi/cephfs/groupsnapshotclass.yaml
```
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ROOK_CSI_PROVISIONER_IMAGE: "registry.k8s.io/sig-storage/csi-provisioner:v5.0.1"
ROOK_CSI_ATTACHER_IMAGE: "registry.k8s.io/sig-storage/csi-attacher:v4.6.1"
ROOK_CSI_RESIZER_IMAGE: "registry.k8s.io/sig-storage/csi-resizer:v1.11.1"
ROOK_CSI_SNAPSHOTTER_IMAGE: "registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1"
ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.9.1"
ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.10.0"
```
### **Use private repository**
Expand Down
14 changes: 14 additions & 0 deletions deploy/charts/rook-ceph/templates/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,20 @@ spec:
Enabled determines whether to create the prometheus rules for the ceph cluster. If true, the prometheus
types must exist or the creation will fail. Default is false.
type: boolean
exporter:
description: Ceph exporter configuration
properties:
perfCountersPrioLimit:
default: 5
description: Only performance counters greater than or equal to this option are fetched
format: int64
type: integer
statsPeriodSeconds:
default: 5
description: Time to wait before sending requests again to exporter server (seconds)
format: int64
type: integer
type: object
externalMgrEndpoints:
description: ExternalMgrEndpoints points to an existing Ceph prometheus exporter endpoint
items:
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/rook-ceph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ csi:
# -- CSIAddons sidecar image repository
repository: quay.io/csiaddons/k8s-sidecar
# -- CSIAddons sidecar image tag
tag: v0.9.1
tag: v0.10.0

nfs:
# -- Enable the nfs csi driver
Expand Down
9 changes: 9 additions & 0 deletions deploy/examples/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ spec:
# Whether to disable the metrics reported by Ceph. If false, the prometheus mgr module and Ceph exporter are enabled.
# If true, the prometheus mgr module and Ceph exporter are both disabled. Default is false.
metricsDisabled: false
# Ceph exporter metrics config.
exporter:
# Specifies which performance counters are exported.
# Corresponds to --prio-limit Ceph exporter flag
# 0 - all counters are exported
perfCountersPrioLimit: 5
# Time to wait before sending requests again to exporter server (seconds)
# Corresponds to --stats-period Ceph exporter flag
statsPeriodSeconds: 5
network:
connections:
# Whether to encrypt the data in transit across the wire to prevent eavesdropping the data on the network.
Expand Down
14 changes: 14 additions & 0 deletions deploy/examples/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,20 @@ spec:
Enabled determines whether to create the prometheus rules for the ceph cluster. If true, the prometheus
types must exist or the creation will fail. Default is false.
type: boolean
exporter:
description: Ceph exporter configuration
properties:
perfCountersPrioLimit:
default: 5
description: Only performance counters greater than or equal to this option are fetched
format: int64
type: integer
statsPeriodSeconds:
default: 5
description: Time to wait before sending requests again to exporter server (seconds)
format: int64
type: integer
type: object
externalMgrEndpoints:
description: ExternalMgrEndpoints points to an existing Ceph prometheus exporter endpoint
items:
Expand Down
13 changes: 13 additions & 0 deletions deploy/examples/csi/cephfs/groupsnapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshot
metadata:
name: cephfs-groupsnapshot
spec:
source:
selector:
matchLabels:
# The PVCs require this label for them to be
# included in the VolumeGroupSnapshot
group: snapshot-test
volumeGroupSnapshotClassName: csi-cephfsplugin-groupsnapclass
15 changes: 15 additions & 0 deletions deploy/examples/csi/cephfs/groupsnapshotclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshotClass
metadata:
name: csi-cephfsplugin-groupsnapclass
driver: rook-ceph.cephfs.csi.ceph.com # csi-provisioner-name
parameters:
# Specify a string that identifies your cluster. Ceph CSI supports any
# unique string. When Ceph CSI is deployed by Rook use the Rook namespace,
# for example "rook-ceph".
clusterID: rook-ceph # namespace: cluster
fsName: myfs
csi.storage.k8s.io/group-snapshotter-secret-name: rook-csi-cephfs-provisioner
csi.storage.k8s.io/group-snapshotter-secret-namespace: rook-ceph
deletionPolicy: Delete
2 changes: 2 additions & 0 deletions deploy/examples/csi/cephfs/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cephfs-pvc
labels:
group: snapshot-test
spec:
accessModes:
- ReadWriteOnce
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/images.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
quay.io/ceph/ceph:v18.2.4
quay.io/ceph/cosi:v0.1.2
quay.io/cephcsi/cephcsi:v3.12.2
quay.io/csiaddons/k8s-sidecar:v0.9.1
quay.io/csiaddons/k8s-sidecar:v0.10.0
registry.k8s.io/sig-storage/csi-attacher:v4.6.1
registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.11.1
registry.k8s.io/sig-storage/csi-provisioner:v5.0.1
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/operator-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ data:
CSI_ENABLE_CSIADDONS: "false"
# Enable watch for faster recovery from rbd rwo node loss
ROOK_WATCH_FOR_NODE_FAILURE: "true"
# ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.9.1"
# ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.10.0"
# The GCSI RPC timeout value (in seconds). It should be >= 120. If this variable is not set or is an invalid value, it's default to 150.
CSI_GRPC_TIMEOUT_SECONDS: "150"

Expand Down
Loading

0 comments on commit ad4ea7d

Please sign in to comment.