Skip to content

Commit 0842a7a

Browse files
authored
Add SnapshotSession CRDs (#5)
* Add SnapshotSession CRDs * Add CR descriptions * Address review comments * Address review comments * Remove typo * Remove unnecessary new line
1 parent 320991b commit 0842a7a

File tree

1 file changed

+244
-5
lines changed
  • keps/sig-storage/3314-csi-changed-block-tracking

1 file changed

+244
-5
lines changed

keps/sig-storage/3314-csi-changed-block-tracking/README.md

Lines changed: 244 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -807,16 +807,255 @@ The following Kubernetes components are involved at runtime:
807807

808808
### Custom Resources
809809

810-
@TODO Prasad to provide description and definitions of the CRs
810+
The following Kubernetes Custom Resources are introduced
811+
811812
#### SnapshotSessionRequest
812813

813-
#### SnapshotServiceConfiguration
814+
`SnapshotSessionRequest` is a namespace scoped Custom Resource (CR) used to
815+
request a session for a specific list of snapshots. Once the session is
816+
created, the session parameters are set in the `status` field of the CR.
817+
These session parameters are used to establish secure connection to the
818+
snapshot session service.
819+
820+
The CR `spec` contains the following field:
821+
822+
- `snapshots`: Represents the list of VolumeSnapshot names for which the
823+
session is requested.
824+
825+
The CR `status` contains the following fields:
826+
827+
- `caCert`: Specifies (Certificate Authority) certificate used to enable
828+
TLS (Transport Layer Security) security for gRPC calls made to the snapshot
829+
session service.
830+
- `error`: Details of the errors if encountered while creating session.
831+
- `expiryTime`: Specifies the duration of validity for the session. It
832+
represents the date and time when the session will expire.
833+
- `sessionState`: Represents state of the SnapshotSessionRequest. State is
834+
defined with one of the "Ready", "Pending" and "Failed".
835+
- `sessionToken`: An opaque session token used for authentication in gRPC calls
836+
made to the snapshot session service.
837+
- `sessionURL`: Specifies the location of the snapshot session service for
838+
making gRPC calls in the format host:port, without the scheme (e.g., http or
839+
https).
840+
841+
```yaml
842+
apiVersion: apiextensions.k8s.io/v1
843+
kind: CustomResourceDefinition
844+
metadata:
845+
name: snapshotsessionrequests.cbt.storage.k8s.io
846+
spec:
847+
group: cbt.storage.k8s.io
848+
names:
849+
kind: SnapshotSessionRequest
850+
listKind: SnapshotSessionRequestList
851+
plural: snapshotsessionrequests
852+
singular: snapshotsessionrequest
853+
scope: Namespaced
854+
versions:
855+
- name: v1alpha1
856+
schema:
857+
openAPIV3Schema:
858+
description: SnapshotSessionRequest is the Schema for the snapshotsessionrequests
859+
API
860+
properties:
861+
apiVersion:
862+
description: 'APIVersion defines the versioned schema of this representation
863+
of an object. Servers should convert recognized schemas to the latest
864+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
865+
type: string
866+
kind:
867+
description: 'Kind is a string value representing the REST resource this
868+
object represents. Servers may infer this from the endpoint the client
869+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
870+
type: string
871+
metadata:
872+
type: object
873+
spec:
874+
description: SnapshotSessionRequestSpec defines the desired state of
875+
SnapshotSessionRequest
876+
properties:
877+
snapshots:
878+
description: The list of VolumeSnapshots that can be used in the session
879+
items:
880+
type: string
881+
type: array
882+
type: object
883+
required:
884+
- snapshots
885+
status:
886+
description: SnapshotSessionRequestStatus defines the observed state
887+
of SnapshotSessionRequest
888+
properties:
889+
caCert:
890+
description: CACert contains a PEM-encoded CA (Certificate Authority) bundle. This CA bundle is used to enable TLS (Transport Layer Security) security for gRPC calls made to the snapshot session service.
891+
format: byte
892+
type: string
893+
error:
894+
description: Captures any error encountered
895+
type: string
896+
expiryTime:
897+
description: ExpiryTime specifies the time for which the session is valid
898+
format: date-time
899+
type: string
900+
sessionState:
901+
description: State of the SnapshotSessionRequest. One of the "Ready",
902+
"Pending", "Failed"
903+
type: string
904+
sessionToken:
905+
description: Opaque session token used for authentication in gRPC calls made to the snapshot session service.
906+
format: byte
907+
type: string
908+
sessionURL:
909+
description: Specifies the IP address or DNS name of the snapshot session service for making TLS gRPC calls. It should be provided in the format host:port, without specifying the scheme (e.g., http or https). The SessionURL is used in conjunction with the SessionToken to query Changed Block metadata by making TLS gRPC calls to the service
910+
type: string
911+
required:
912+
- sessionState
913+
type: object
914+
type: object
915+
served: true
916+
storage: true
917+
```
814918
815-
@TODO NOT NAMESPACED
919+
#### SnapshotServiceConfiguration
816920
817-
#### SnapshotSessionData
921+
`SnapshotServiceConfiguration` is a cluster-scoped Custom Resource contains
922+
parameters used to create a session for a specific CSI driver. To associate
923+
the SnapshotServiceConfiguration with a specific CSI driver,
924+
`cbt.storage.k8s.io/driver: NAME_OF_THE_CSI_DRIVER` label is used.
925+
926+
The CR `spec` contains the following fields:
927+
928+
- `address`: Specifies the IP address or DNS name of the snapshot session
929+
service for making gRPC calls. It should be provided in the format host:port,
930+
without specifying the scheme (e.g., http or https). The SessionURL is used
931+
to query Changed Block metadata by making gRPC calls to the service.
932+
- `caCert`: Specifies the CA certificate is used to enable TLS (Transport Layer
933+
Security) security for gRPC calls made to the snapshot session service.
934+
935+
```yaml
936+
apiVersion: apiextensions.k8s.io/v1
937+
kind: CustomResourceDefinition
938+
metadata:
939+
name: snapshotservicesconfigurations.cbt.storage.k8s.io
940+
spec:
941+
group: cbt.storage.k8s.io
942+
names:
943+
kind: SnapshotServicesConfiguration
944+
listKind: SnapshotServicesConfigurationList
945+
plural: snapshotservicesconfigurations
946+
singular: snapshotsessionservice
947+
scope: Cluster
948+
versions:
949+
- name: v1alpha1
950+
schema:
951+
openAPIV3Schema:
952+
description: SnapshotServicesConfiguration is the Schema for the snapshotservicesconfigurations
953+
API
954+
properties:
955+
apiVersion:
956+
description: 'APIVersion defines the versioned schema of this representation
957+
of an object. Servers should convert recognized schemas to the latest
958+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
959+
type: string
960+
kind:
961+
description: 'Kind is a string value representing the REST resource this
962+
object represents. Servers may infer this from the endpoint the client
963+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
964+
type: string
965+
metadata:
966+
type: object
967+
spec:
968+
description: SnapshotServicesConfigurationSpec defines the desired state of
969+
SnapshotServicesConfiguration
970+
properties:
971+
address:
972+
description: Specifies the IP address or DNS name of the snapshot session service for making TLS gRPC calls. It should be provided in the format host:port, without specifying the scheme (e.g., http or https). The SessionURL is used to query Changed Block metadata by making TLS gRPC calls to the service
973+
type: string
974+
caCert:
975+
description: CACert contains a PEM-encoded CA (Certificate Authority) bundle. This CA bundle is used to enable TLS (Transport Layer Security) security for gRPC calls made to the snapshot session service.
976+
format: byte
977+
type: string
978+
type: object
979+
required:
980+
- address
981+
- caCert
982+
type: object
983+
served: true
984+
storage: true
985+
```
818986

819-
@TODO NEED TO DECIDE WHETHER TO EMBED SP IDs OR NOT
987+
#### SnapshotSessionData
988+
989+
`SnapshotSessionData` CR is a namespaced resource created within the namespace
990+
of the CSI driver. The name of the resource represents session token itself.
991+
The CR provides a structured way to manage session tokens and their
992+
associations with specific VolumeSnapshots.
993+
994+
The CR `spec` contains the following fields:
995+
996+
- `expiryTime`: Specifies the duration of validity for the session token. It
997+
represents the date and time when the session token will expire.
998+
- `snapshotNamespace`: Indicates the namespace of the VolumeSnapshots
999+
associated with the session token.
1000+
- `snapshots`: Represents a list of VolumeSnapshot names for which the session
1001+
token is valid.
1002+
1003+
```yaml
1004+
apiVersion: apiextensions.k8s.io/v1
1005+
kind: CustomResourceDefinition
1006+
metadata:
1007+
name: snapshotsessiondata.cbt.storage.k8s.io
1008+
spec:
1009+
group: cbt.storage.k8s.io
1010+
names:
1011+
kind: SnapshotSessionData
1012+
listKind: SnapshotSessionDataList
1013+
plural: snapshotsessiondata
1014+
singular: snapshotsessiondata
1015+
scope: Namespaced
1016+
versions:
1017+
- name: v1alpha1
1018+
schema:
1019+
openAPIV3Schema:
1020+
description: SnapshotSessionData is the Schema for the snapshotsessiondata
1021+
API
1022+
properties:
1023+
apiVersion:
1024+
description: 'APIVersion defines the versioned schema of this representation
1025+
of an object. Servers should convert recognized schemas to the latest
1026+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
1027+
type: string
1028+
kind:
1029+
description: 'Kind is a string value representing the REST resource this
1030+
object represents. Servers may infer this from the endpoint the client
1031+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
1032+
type: string
1033+
metadata:
1034+
type: object
1035+
spec:
1036+
description: SnapshotSessionDataSpec defines the desired state of SnapshotSessionData
1037+
properties:
1038+
expiryTime:
1039+
description: ExpiryTime specifies the time for which the session is valid
1040+
format: date-time
1041+
type: string
1042+
snapshotNamespace:
1043+
description: Namespace of the VolumeSnapshot for which the session is created
1044+
type: string
1045+
snapshots:
1046+
description: The list of VolumeSnapshot names for which the session is created
1047+
items:
1048+
type: string
1049+
type: array
1050+
required:
1051+
- expiryTime
1052+
- snapshotNamespace
1053+
- snapshots
1054+
type: object
1055+
type: object
1056+
served: true
1057+
storage: true
1058+
```
8201059

8211060
### The Snapshot Session Manager
8221061

0 commit comments

Comments
 (0)