Skip to content

Commit

Permalink
Add VolumeGroupReplication support.
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <[email protected]>
  • Loading branch information
ELENAGER committed Nov 14, 2024
1 parent 3a5254a commit b8b94ca
Show file tree
Hide file tree
Showing 8 changed files with 1,357 additions and 109 deletions.
20 changes: 20 additions & 0 deletions config/dr-cluster/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,26 @@ rules:
- get
- list
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplicationclasses
verbs:
- get
- list
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplications
verbs:
- create
- update
- delete
- get
- list
- watch
- patch
- apiGroups:
- storage.k8s.io
resources:
Expand Down
20 changes: 20 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,26 @@ rules:
- get
- patch
- update
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplicationclasses
verbs:
- get
- list
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplications
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- replication.storage.openshift.io
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
name: volumegroupreplicationclasses.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
names:
kind: VolumeGroupReplicationClass
listKind: VolumeGroupReplicationClassList
plural: volumegroupreplicationclasses
singular: volumegroupreplicationclass
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: VolumeGroupReplicationClass is the Schema for the volumegroupreplicationclasses
API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: |-
VolumeGroupReplicationClassSpec specifies parameters that an underlying storage system uses
when creating a volumegroup replica. A specific VolumeGroupReplicationClass is used by specifying
its name in a VolumeGroupReplication object.
properties:
parameters:
additionalProperties:
type: string
description: |-
Parameters is a key-value map with storage provisioner specific configurations for
creating volume group replicas
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: self == oldSelf
provisioner:
description: Provisioner is the name of storage provisioner
type: string
x-kubernetes-validations:
- message: provisioner is immutable
rule: self == oldSelf
required:
- provisioner
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: has(self.parameters) == has(oldSelf.parameters)
status:
description: VolumeGroupReplicationClassStatus defines the observed state
of VolumeGroupReplicationClass
type: object
type: object
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
name: volumegroupreplicationcontents.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
names:
kind: VolumeGroupReplicationContent
listKind: VolumeGroupReplicationContentList
plural: volumegroupreplicationcontents
singular: volumegroupreplicationcontent
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: VolumeGroupReplicationContent is the Schema for the volumegroupreplicationcontents
API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: VolumeGroupReplicationContentSpec defines the desired state
of VolumeGroupReplicationContent
properties:
provisioner:
description: |-
provisioner is the name of the CSI driver used to create the physical
volume group on
the underlying storage system.
This MUST be the same as the name returned by the CSI GetPluginName() call for
that driver.
Required.
type: string
source:
description: |-
Source specifies whether the snapshot is (or should be) dynamically provisioned
or already exists, and just requires a Kubernetes object representation.
This field is immutable after creation.
Required.
properties:
volumeHandles:
description: |-
VolumeHandles is a list of volume handles on the backend to be grouped
and replicated.
items:
type: string
type: array
required:
- volumeHandles
type: object
volumeGroupReplicationClassName:
description: |-
VolumeGroupReplicationClassName is the name of the VolumeGroupReplicationClass from
which this group replication was (or will be) created.
type: string
volumeGroupReplicationHandle:
description: |-
VolumeGroupReplicationHandle is a unique id returned by the CSI driver
to identify the VolumeGroupReplication on the storage system.
type: string
volumeGroupReplicationRef:
description: |-
VolumeGroupreplicationRef specifies the VolumeGroupReplication object to which this
VolumeGroupReplicationContent object is bound.
VolumeGroupReplication.Spec.VolumeGroupReplicationContentName field must reference to
this VolumeGroupReplicationContent's name for the bidirectional binding to be valid.
For a pre-existing VolumeGroupReplicationContent object, name and namespace of the
VolumeGroupReplication object MUST be provided for binding to happen.
This field is immutable after creation.
Required.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: |-
If referring to a piece of an object instead of an entire object, this string
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within a pod, this would take on a value like:
"spec.containers{name}" (where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Kind of the referent.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
namespace:
description: |-
Namespace of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
type: string
resourceVersion:
description: |-
Specific resourceVersion to which this reference is made, if any.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
type: string
uid:
description: |-
UID of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
type: string
type: object
x-kubernetes-map-type: atomic
x-kubernetes-validations:
- message: both volumeGroupReplicationRef.name and volumeGroupReplicationRef.namespace
must be set
rule: has(self.name) && has(self.__namespace__)
- message: volumeGroupReplicationRef is immutable
rule: self == oldSelf
required:
- provisioner
- source
- volumeGroupReplicationHandle
- volumeGroupReplicationRef
type: object
status:
description: VolumeGroupReplicationContentStatus defines the status of
VolumeGroupReplicationContent
properties:
persistentVolumeRefList:
description: |-
PersistentVolumeRefList is the list of of PV for the group replication
The maximum number of allowed PV in the group is 100.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
Loading

0 comments on commit b8b94ca

Please sign in to comment.