|
| 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 | +This 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 their authorized ServiceAccount objects, |
| 30 | +directly communicate with the sidecar using the |
| 31 | +[Kubernetes SnapshotMetadata gRPC Service](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#the-kubernetes-snapshotmetadata-service-api). |
| 32 | +The authorization needed is described in the |
| 33 | +["Risks and Mitigations"](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#risks-and-mitigations) |
| 34 | +section of the CSI Changed Block Tracking KEP. |
| 35 | +In particular, this requires the ability to use the Kubernetes |
| 36 | +[TokenRequest](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/) |
| 37 | +API and to access the objects required to use the service. |
| 38 | + |
| 39 | +The existence of this optional service is advertised by the presence of a |
| 40 | +[Snapshot Metadata Service CR](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#snapshot-metadata-service-custom-resource), |
| 41 | +named for the CSI driver that provisions the PersistentVolume and VolumeSnapshot objects involved. |
| 42 | +The CR contains the service endpoint and CA certificate, and an audience string for authentication. |
| 43 | +The backup application must use the Kubernetes |
| 44 | +[TokenRequest](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/) |
| 45 | +API with the audience string to obtain a Kubernetes authentication token for use in the |
| 46 | +Kubernetes SnapshotMetadata gRPC Service call. |
| 47 | +The backup application should establish trust for the CA certificate before making the gRPC call |
| 48 | +to the service endpoint. |
| 49 | +VolumeSnapshot metadata can be lengthy, and the Kubernetes SnapshotMetadata gRPC Service supports |
| 50 | +restarting an interrupted metadata request from an intermediate point in case of failure. |
| 51 | + |
| 52 | +The sidecar repository contains a |
| 53 | +[snapshot-metadata-lister](https://github.com/kubernetes-csi/external-snapshot-metadata/tree/master/examples/snapshot-metadata-lister) |
| 54 | +example command that illustrates the use of the Kubernetes SnapshotMetadata gRPC Service in a Go application. |
| 55 | +It uses the |
| 56 | +[pkg/iterator](https://github.com/kubernetes-csi/external-snapshot-metadata/tree/master/pkg/iterator) |
| 57 | +utility package, which may be used by backup applications if desired. |
| 58 | + |
| 59 | +### Deployment |
| 60 | +The CSI `external-snapshot-metadata` sidecar should be deployed by |
| 61 | +CSI drivers that support the |
| 62 | +[Changed Block Tracking](./changed-block-tracking.md) feature. |
| 63 | +The sidecar must be deployed in the same pod as the CSI driver and |
| 64 | +will communicate with its CSI [SnapshotMetadata](https://github.com/container-storage-interface/spec/blob/master/spec.md#snapshot-metadata-service-rpcs) |
| 65 | +and [Identity](https://github.com/container-storage-interface/spec/blob/master/spec.md#identity-service-rpc) gRPC services |
| 66 | +over a UNIX domain socket. |
| 67 | + |
| 68 | +The sidecar should be configured to run under the authority of its |
| 69 | +CSI driver ServiceAccount, which must be authorized as described in the |
| 70 | +["Risks and Mitigations"](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3314-csi-changed-block-tracking#risks-and-mitigations) |
| 71 | +section of the CSI Changed Block Tracking KEP. |
| 72 | +In particular, this requires the ability to 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 | + |
| 88 | +See the sample [Hostpath CSI driver](example.md) for an illustration on how to deploy a CSI driver |
| 89 | +that supports this feature. |
0 commit comments