Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Driver API reconciliation #24

Merged
merged 14 commits into from
Jul 26, 2024
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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 AS builder
FROM golang:1.22 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand All @@ -15,6 +15,7 @@ RUN go mod download
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY internal/controller/ internal/controller/
COPY internal/utils/ internal/utils/

# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Expand Down
30 changes: 22 additions & 8 deletions api/v1alpha1/driver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ type EncryptionSpec struct {
ConfigMapRef corev1.LocalObjectReference `json:"configMapName,omitempty"`
}

type VolumeSpec struct {
Volume corev1.Volume `json:"volume,omitempty"`
Mount corev1.VolumeMount `json:"mount,omitempty"`
}
Madhu-1 marked this conversation as resolved.
Show resolved Hide resolved

type PodCommonSpec struct {
// Service account name to be used for driver's pods
ServiceAccountName *string `json:"serviceAccountName,omitempty"`

// Pod's user defined priority class name
PrioritylClassName *string `json:"priorityClassName,omitempty"`

Expand All @@ -99,11 +107,18 @@ type PodCommonSpec struct {

// Pod's tolerations list
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// Volume and volume mount definitions to attach to the pod
Volumes []VolumeSpec `json:"volumes,omitempty"`

// To indicate the image pull policy to be applied to all the containers in the csi driver pods.
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
}

type NodePluginResourcesSpec struct {
Registrar *corev1.ResourceRequirements `json:"registrar,omitempty"`
Liveness *corev1.ResourceRequirements `json:"liveness,omitempty"`
Addons *corev1.ResourceRequirements `json:"addons,omitempty"`
LogRotator *corev1.ResourceRequirements `json:"logRotator,omitempty"`
Plugin *corev1.ResourceRequirements `json:"plugin,omitempty"`
}
Expand All @@ -119,16 +134,11 @@ type NodePluginSpec struct {
// Resource requirements for plugin's containers
Resources NodePluginResourcesSpec `json:"resources,omitempty"`

Volumes []corev1.Volume `json:"volumes,omitempty"`

// kubelet directory path, if kubelet configured to use other than /var/lib/kubelet path.
KubeletDirPath string `json:"kubeletDirPath,omitempty"`

// Control the host mount of /etc/selinux for csi plugin pods. Defaults to false
EnableSeLinuxHostMount *bool `json:"EnableSeLinuxHostMount,omitempty"`

// To indicate the image pull policy to be applied to all the containers in the csi driver pods.
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
}

type ControllerPluginResourcesSpec struct {
Expand All @@ -138,6 +148,7 @@ type ControllerPluginResourcesSpec struct {
Provisioner *corev1.ResourceRequirements `json:"provisioner,omitempty"`
OMapGenerator *corev1.ResourceRequirements `json:"omapGenerator,omitempty"`
Liveness *corev1.ResourceRequirements `json:"liveness,omitempty"`
Addons *corev1.ResourceRequirements `json:"addons,omitempty"`
LogRotator *corev1.ResourceRequirements `json:"logRotator,omitempty"`
Plugin *corev1.ResourceRequirements `json:"plugin,omitempty"`
}
Expand Down Expand Up @@ -180,8 +191,11 @@ type LeaderElectionSpec struct {
type CephFsClientType string

const (
KernelCephFsClient CephFsClientType = "kernel"
FuseCephFsClient CephFsClientType = "fuse"
AutoDetectCephFsClient CephFsClientType = "autodetect"
KernelCephFsClient CephFsClientType = "kernel"

// Ceph CSI does not allow us to force Fuse client at this point
// FuseCephFsClient CephFsClientType = "fuse"
)

// DriverSpec defines the desired state of Driver
Expand Down Expand Up @@ -258,7 +272,7 @@ type DriverSpec struct {
KernelMountOptions map[string]string `json:"kernelMountOptions,omitempty"`

// Set mount options to use when using the Fuse client
FuseMountOptionss map[string]string `json:"fuseMountOptions,omitempty"`
FuseMountOptions map[string]string `json:"fuseMountOptions,omitempty"`
}

type DriverPhaseType string
Expand Down
50 changes: 41 additions & 9 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading