Skip to content

Commit 8c9996b

Browse files
committed
Documentation on the external-snaphot-metadata sidecar (alpha).
1 parent 1360f37 commit 8c9996b

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

book/src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [cluster-driver-registrar](cluster-driver-registrar.md) (deprecated)
1919
- [external-health-monitor-controller](external-health-monitor-controller.md)
2020
- [external-health-monitor-agent](external-health-monitor-agent.md)
21+
- [external-snapshot-metadata](external-snapshot-metadata.md)
2122
- [CSI objects](csi-objects.md)
2223
- [CSIDriver Object](csi-driver-object.md)
2324
- [CSINode Object](csi-node-object.md)
@@ -43,6 +44,7 @@
4344
- [CSI Windows](csi-windows.md)
4445
- [Volume Mode Conversion](prevent-volume-mode-conversion.md)
4546
- [Cross-Namespace Data Sources](cross-namespace-data-sources.md)
47+
- [Changed Block Tracking](changed-block-tracking.md)
4648
- [Deploying a CSI Driver on Kubernetes](deploying.md)
4749
- [Example](example.md)
4850
- [Driver Testing](testing-drivers.md)

book/src/changed-block-tracking.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changed Block Tracking
2+
3+
## Status
4+
5+
Status | Min K8s Version | Max K8s Version | external-snapshot-metadata Version
6+
-------|-----------------|-----------------|-----------------------------------
7+
Alpha | 1.32 | - | v0.1.0
8+
9+
10+
## Overview
11+
12+
This optional feature provides a secure mechanism to obtain metadata
13+
on the allocated blocks of a CSI VolumeSnapshot, or the changed blocks between two arbitrary pairs of CSI VolumeSnapshot objects of the same PersistentVolume.
14+
15+
Snapshot metadata must be fetched directly with the
16+
[Kuberenets SnapshotMetadata gRPC service](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#the-kubernetes-snapshotmetadata-service-api)
17+
from an [external-snapshot-metadata](./external-snapshot-metadata.md)
18+
sidecar configured by the CSI driver.
19+
This bypasses the Kubernetes API server for the most part: the API
20+
server is only used to fetch the Kubernetes objects needed for secure, authorized and mutually authenticated communication.
21+
22+
> See [Kubernetes Enhancement Proposal 3314](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking)
23+
> for details of the Changed Block Tracking feature.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# CSI external-snapshot-metadata
2+
3+
## Status and Releases
4+
5+
**Git Repository:** [https://github.com/kubernetes-csi/external-snapshot-metadata](https://github.com/kubernetes-csi/external-snapshot-metadata)
6+
7+
### Supported Versions
8+
9+
Latest stable release | Branch | Min CSI Version | Max CSI Version | Container Image | [Min K8s Version](project-policies.md#minimum-version) | [Max K8s Version](project-policies.md#maximum-version) | [Recommended K8s Version](project-policies.md#recommended-version) |
10+
--|--|--|--|--|--|--|--
11+
v0.1.0 | [v0.1.0](https://github.com/kubernetes-csi/external-snapshot-metadata/releases/tag/v0.1.0) | [v1.10.0](https://github.com/container-storage-interface/spec/releases/tag/v1.10.0) | - | gcr.io/k8s-staging-sig-storage/csi-snapshot-metadata:v0.1.0 | v1.32 | - | v1.32
12+
13+
14+
## Alpha
15+
16+
### Description
17+
The sidecar securely serves snapshot metadata to Kubernetes clients through the
18+
[Kubernetes SnapshotMetadata gRPC Service](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#the-kubernetes-snapshotmetadata-service-api).
19+
20+
The sidecar authenticates and authorizes each Kubernetes backup application request made through the
21+
Kubernetes SnapshotMetadata gRPC Service API.
22+
It then acts as a proxy as it fetches the desired metadata from the CSI driver and
23+
streams it directly to the requesting application with no load on the Kubernetes API server.
24+
25+
See ["The External Snapshot Metadata Sidecar"](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#the-external-snapshot-metadata-sidecar)
26+
section in the CSI Changed Block Tracking KEP for additional details on the sidecar.
27+
28+
### Usage
29+
Backup applications, identified by authorized ServiceAccount objects, directly communicate with the sidecar using the
30+
[Kubernetes SnapshotMetadata gRPC Service](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#the-kubernetes-snapshotmetadata-service-api).
31+
The authorization needed is described in the
32+
["Risks and Mitigations"](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#risks-and-mitigations)
33+
section of the CSI Changed Block Tracking KEP.
34+
35+
The existence of this optional service is advertised by the presence of a
36+
[Snapshot Metadata Service CR](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#snapshot-metadata-service-custom-resource),
37+
named for the CSI driver that provisions the PersistentVolume and VolumeSnapshot objects involved.
38+
The CR contains the sidecar's address, CA certificate and audience string.
39+
The backup application must use the Kubernetes
40+
[TokenRequest](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/)
41+
API with the sidecar's audience string to obtain a Kubernetes authentication token for use in the
42+
Kubernetes SnapshotMetadata gRPC Service API call.
43+
The backup application should establish trust for the sidecar CA certificate before making the API call
44+
to the specified address.
45+
46+
The sidecar repository contains a
47+
[snapshot-metadata-lister](https://github.com/kubernetes-csi/external-snapshot-metadata/tree/master/examples/snapshot-metadata-lister)
48+
example command to illustrate how a Kubernetes backup application can fetch snapshot metadata
49+
through the Kubernetes SnapshotMetadata gRPC Service API.
50+
It utilizes the services provided by the
51+
[pkg/iterator](https://github.com/kubernetes-csi/external-snapshot-metadata/tree/master/pkg/iterator)
52+
Go package, which can be used by the backup application if desired.
53+
54+
VolumeSnapshot metadata can be lengthy, and the Kubernetes SnapshotMetadata gRPC Service supports
55+
restarting an interrupted metadata request from an intermediate point in case of failure.
56+
57+
### Deployment
58+
The CSI `external-snapshot-metadata` sidecar should be deployed by
59+
CSI drivers that support the
60+
[Changed Block Tracking](./changed-block-tracking.md) feature.
61+
The sidecar must be deployed in the same pod as the CSI driver and
62+
will communicate with its CSI [SnapshotMetadata](https://github.com/container-storage-interface/spec/blob/master/spec.md#snapshot-metadata-service-rpcs)
63+
and [Identity](https://github.com/container-storage-interface/spec/blob/master/spec.md#identity-service-rpc) gRPC services
64+
over a UNIX domain socket.
65+
66+
The sidecar should be configured to run under the authority of its
67+
CSI driver ServiceAccount, which must be authorized as described
68+
in the
69+
["Risks and Mitigations"](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#risks-and-mitigations)
70+
section of the CSI Changed Block Tracking KEP.
71+
In particular, this requires the ability to
72+
use the Kubernetes
73+
[TokenReview](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-review-v1/)
74+
and
75+
[SubjectAccessReview](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/subject-access-review-v1/)
76+
APIs.
77+
78+
A Service object must be created for the TCP based [Kubernetes SnapshotMetadata](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#the-kubernetes-snapshotmetadata-service-api)
79+
gRPC service implemented by the sidecar.
80+
81+
A [SnapshotMetadataService CR](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#snapshot-metadata-service-custom-resource),
82+
named for the CSI driver, must be created to advertise the
83+
availability of this optional feature.
84+
The CR contains the CA certificate and Service endpoint address
85+
of the sidecar and the audience string needed for the client
86+
authentication token.
87+

0 commit comments

Comments
 (0)