Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,44 @@ resources:
kind: ClientProfileMapping
path: github.com/ceph/ceph-csi-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: ceph.io
group: csi
kind: CephConnection
path: github.com/ceph/ceph-csi-operator/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
domain: ceph.io
group: csi
kind: ClientProfile
path: github.com/ceph/ceph-csi-operator/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
domain: ceph.io
group: csi
kind: ClientProfileMapping
path: github.com/ceph/ceph-csi-operator/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
domain: ceph.io
group: csi
kind: OperatorConfig
path: github.com/ceph/ceph-csi-operator/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
domain: ceph.io
group: csi
kind: Driver
path: github.com/ceph/ceph-csi-operator/api/v1
version: v1
version: "3"
68 changes: 68 additions & 0 deletions api/v1/cephconnection_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
Copyright 2025.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// ReadAffinitySpec capture Ceph CSI read affinity settings
type ReadAffinitySpec struct {
//+kubebuilder:validation:Required
//+kubebuilder:validation:MinItems:=1
CrushLocationLabels []string `json:"crushLocationLabels,omitempty"`
}

// CephConnectionSpec defines the desired state of CephConnection
type CephConnectionSpec struct {
//+kubebuilder:validation:Required
//+kubebuilder:validation:MinItems:=1
Monitors []string `json:"monitors"`

//+kubebuilder:validation:Optional
ReadAffinity *ReadAffinitySpec `json:"readAffinity,omitempty"`

//+kubebuilder:validation:Optional
//+kubebuilder:validation:Minimum:=1
RbdMirrorDaemonCount int `json:"rbdMirrorDaemonCount,omitempty"`
}

// CephConnectionStatus defines the observed state of CephConnection
type CephConnectionStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:storageversion
//+kubebuilder:subresource:status

// CephConnection is the Schema for the cephconnections API
type CephConnection struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec CephConnectionSpec `json:"spec,omitempty"`
Status CephConnectionStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// CephConnectionList contains a list of CephConnections
type CephConnectionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []CephConnection `json:"items"`
}
95 changes: 95 additions & 0 deletions api/v1/clientprofile_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
Copyright 2025.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// CephFsConfigSpec defines the desired CephFs configuration
type CephFsConfigSpec struct {
//+kubebuilder:validation:Optional
SubVolumeGroup string `json:"subVolumeGroup,omitempty"`

//+kubebuilder:validation:Optional
KernelMountOptions map[string]string `json:"kernelMountOptions,omitempty"`

//+kubebuilder:validation:Optional
FuseMountOptions map[string]string `json:"fuseMountOptions,omitempty"`

//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
//+kubebuilder:validation:Optional
RadosNamespace *string `json:"radosNamespace,omitempty"`
}

// RbdConfigSpec defines the desired RBD configuration
type RbdConfigSpec struct {
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
//+kubebuilder:validation:Optional
RadosNamespace string `json:"radosNamespace,omitempty"`
}

// NfsConfigSpec cdefines the desired NFS configuration
type NfsConfigSpec struct {
}

// ClientProfileSpec defines the desired state of Ceph CSI
// configuration for volumes and snapshots configured to use
// this profile
type ClientProfileSpec struct {
//+kubebuilder:validation:Required
//+kubebuilder:validation:XValidation:rule=self.name != "",message="'.name' cannot be empty"
CephConnectionRef corev1.LocalObjectReference `json:"cephConnectionRef"`

//+kubebuilder:validation:Optional
CephFs *CephFsConfigSpec `json:"cephFs,omitempty"`

//+kubebuilder:validation:Optional
Rbd *RbdConfigSpec `json:"rbd,omitempty"`

//+kubebuilder:validation:Optional
Nfs *NfsConfigSpec `json:"nfs,omitempty"`
}

// ClientProfileStatus defines the observed state of Ceph CSI
// configuration for volumes and snapshots configured to use
// this profile
type ClientProfileStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:storageversion
//+kubebuilder:subresource:status

// ClientProfile is the Schema for the clientprofiles API
type ClientProfile struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ClientProfileSpec `json:"spec,omitempty"`
Status ClientProfileStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// ClientProfileList contains a list of ClientProfile
type ClientProfileList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClientProfile `json:"items"`
}
69 changes: 69 additions & 0 deletions api/v1/clientprofilemapping_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
Copyright 2025.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +kubebuilder:validation:MinItems:=2
// +kubebuilder:validation:MaxItems:=2
type BlockPoolIdPair []string

// MappingsSpec define a mapping between a local and remote profiles
type MappingsSpec struct {
//+kubebuilder:validation:Required
LocalClientProfile string `json:"localClientProfile,omitempty"`

//+kubebuilder:validation:Required
RemoteClientProfile string `json:"remoteClientProfile,omitempty"`

//+kubebuilder:validation:Optional
BlockPoolIdMapping []BlockPoolIdPair `json:"blockPoolIdMapping,omitempty"`
}

// ClientProfileMappingSpec defines the desired state of ClientProfileMapping
type ClientProfileMappingSpec struct {
//+kubebuilder:validation:Required
Mappings []MappingsSpec `json:"mappings,omitempty"`
}

// ClientProfileMappingStatus defines the observed state of ClientProfileMapping
type ClientProfileMappingStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:storageversion
//+kubebuilder:subresource:status

// ClientProfileMapping is the Schema for the clientprofilemappings API
type ClientProfileMapping struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ClientProfileMappingSpec `json:"spec,omitempty"`
Status ClientProfileMappingStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// ClientProfileMappingList contains a list of ClientProfileMapping
type ClientProfileMappingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClientProfileMapping `json:"items"`
}
Loading
Loading