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

Syncing latest changes from upstream main for ceph-csi-operator #8

Merged
merged 67 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
30fb812
logrotate: add design and api for logrotate
parth-gr Jul 16, 2024
d8db354
Merge pull request #37 from parth-gr/logrotate-design
Madhu-1 Jul 19, 2024
fc96988
Driver API: Align type code to established order and rename LogRotati…
nb-ohad Jul 21, 2024
f2b3eff
Merge pull request #47 from nb-ohad/driver-api
Madhu-1 Jul 22, 2024
e4e9d91
Driver Controller: Validate, load and parse driver resource
nb-ohad Jun 26, 2024
2ed066b
Driver Controller: Load driver defaults (from operator config) and me…
nb-ohad Jun 26, 2024
bfb1896
Driver Controller: Handle image set loading and merging
nb-ohad Jun 26, 2024
0229843
Driver Controller: Scaffolding for concurrent reconcile
nb-ohad Jun 26, 2024
b535f85
Driver Controller: Reconcile k8s CSIDriver resource
nb-ohad Jun 27, 2024
feb5e28
Driver Controller: Reconcile Controller Plugin k8s Deployment
nb-ohad Jul 8, 2024
4e2ef89
Driver Controller: Reconcile Node Plugin k8s DaemonSet
nb-ohad Jul 11, 2024
89e1fd0
Driver Controller: Reconcile liveness service
nb-ohad Jul 14, 2024
a05ac60
Driver Controller: CSI Service Account and RBAC
nb-ohad Jul 14, 2024
19d1942
Driver Controller: Inline function invocation readability enhancements
nb-ohad Jul 14, 2024
e0fb6d7
Driver Controller: Align with standard library utilities
nb-ohad Jul 17, 2024
1cc4862
Driver Controller: remove unused reutrn value to solve a lint issue
nb-ohad Jul 17, 2024
ace4d8b
Docker File: Bump golang, and missing packages
nb-ohad Jul 18, 2024
badf2d6
Operator Configuration: Personalize operator's pod selector
nb-ohad Jul 18, 2024
788f7c2
Merge pull request #24 from nb-ohad/driver-reconcile
Madhu-1 Jul 26, 2024
374a3a5
build(deps): bump the k8s-dependencies group with 4 updates
dependabot[bot] Jul 26, 2024
6b77fdf
Merge pull request #49 from ceph/dependabot/go_modules/k8s-dependenci…
Madhu-1 Jul 26, 2024
bcc0f5a
ci: update action to check git diff
Madhu-1 Jul 26, 2024
f3e4d6f
push uncommitted files
Madhu-1 Jul 26, 2024
8727222
build(deps): bump the github-dependencies group with 3 updates
dependabot[bot] Jul 29, 2024
04a707a
Merge pull request #63 from ceph/dependabot/go_modules/github-depende…
Madhu-1 Jul 29, 2024
999bbf2
Merge pull request #59 from Madhu-1/add-checks
nb-ohad Jul 29, 2024
93b1439
fix bugs found in controller
Madhu-1 Jul 26, 2024
47babfb
Merge pull request #60 from Madhu-1/fix-bugs
nb-ohad Jul 29, 2024
f474e77
Rename configs.csi.ceph.io API to clientprofiles.csi.ceph.io
nb-ohad Jul 28, 2024
ef334af
Rename cephclusters.csi.ceph.io API to cephconnections.csi.ceph.io
nb-ohad Jul 28, 2024
9727975
Add kubebuilder validatoin rules to drivers.csi.ceph.io API
nb-ohad Jul 28, 2024
57430d8
Add kubebuilder validation rules for operatorconfigs.csi.ceph.com
nb-ohad Jul 28, 2024
69af8e6
Update operator design doc to align with current changes and renames
nb-ohad Jul 28, 2024
62edf5c
Utils: fix serialization cases in MapToString util
nb-ohad Jul 29, 2024
cd73054
Merge pull request #65 from nb-ohad/driver-reconcile
Madhu-1 Jul 30, 2024
60794b7
Merge pull request #62 from nb-ohad/api-renames-and-rules
Madhu-1 Jul 30, 2024
d741247
ClientProfile API: Add support for kernel and fuse mount options
nb-ohad Jul 29, 2024
55f7513
Merge pull request #64 from nb-ohad/clientprofile-enhancements
Madhu-1 Jul 30, 2024
d81482f
ClientProfileMapping API: Create API definition and type for ClientPr…
nb-ohad Jul 30, 2024
5e7f3b3
Driver API: Fix item separator in validation marker
nb-ohad Jul 30, 2024
1dda586
Merge pull request #67 from nb-ohad/small-fixes
Madhu-1 Jul 30, 2024
47aa836
Driver Controller: Fix support for SnapshotPolicy settings
nb-ohad Jul 30, 2024
09b365b
APIs: Rename "LogLevel" to "Verbosity"
nb-ohad Jul 30, 2024
9f8dcd8
Merge pull request #70 from nb-ohad/api-renames-and-rules
Madhu-1 Jul 31, 2024
2650a76
Merge pull request #66 from nb-ohad/clientprofilemapping-api
Madhu-1 Jul 31, 2024
d782a24
Merge pull request #69 from nb-ohad/small-fixes
Madhu-1 Jul 31, 2024
173ec5e
Configuration: Add CSI operand RBAC kustomization file
nb-ohad Jul 31, 2024
a894e84
add dist to gitignore
Madhu-1 Jul 31, 2024
c4c632a
Merge pull request #71 from nb-ohad/fix-missing-rbac
Madhu-1 Jul 31, 2024
4151a0e
ci: add shell check to the repo
Madhu-1 Aug 1, 2024
3246d10
ci: update ci job to test operator
Madhu-1 Aug 1, 2024
97f4625
use list of BlockPoolMapping
sp98 Aug 1, 2024
e08591b
Merge pull request #72 from sp98/fix-clientProfileMapping-API
nb-ohad Aug 1, 2024
40743dc
APIs: Additional validations
nb-ohad Aug 1, 2024
ef8806e
Merge pull request #73 from Madhu-1/update-ci-test
nb-ohad Aug 2, 2024
10ebede
ClientProfile Controller: Rename controller to match with new naming …
nb-ohad Jul 29, 2024
8cafb64
ClientProfile Controller: Load and validate client profile object and…
nb-ohad Jul 18, 2024
2a25c9d
ClientProfile Contoller: Create/Update a Ceph CSI config entry for Cl…
nb-ohad Jul 18, 2024
85dda60
ClientProfile Controller: Add ClientProfile deletion and cleanup logic
nb-ohad Jul 21, 2024
233fc9f
Merge pull request #76 from nb-ohad/small-fixes
Madhu-1 Aug 2, 2024
70e00b8
Merge pull request #48 from nb-ohad/config-reconcile
Madhu-1 Aug 2, 2024
8230041
controllers: fix issues found in recent testing
leelavg Aug 2, 2024
2f5495d
Merge pull request #82 from leelavg/test-latest
Madhu-1 Aug 2, 2024
d702c45
Driver Controller: Use CreateOrUpdate for k8s CSIDriver reconciliation
nb-ohad Aug 4, 2024
55e60e9
build(deps): bump github.com/onsi/gomega
dependabot[bot] Aug 5, 2024
23403d8
Merge pull request #84 from nb-ohad/csidriver-reconcile-changes
Madhu-1 Aug 5, 2024
204ddfa
Merge pull request #85 from ceph/dependabot/go_modules/github-depende…
Madhu-1 Aug 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ jobs:
go-version-file: go.mod
- name: run make build
run: make build
- name: Check for uncommitted changes
run: make check-all-committed
- name: Show the uncommitted "git diff"
if: ${{ failure() }}
run: git diff ; false
14 changes: 14 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,17 @@ jobs:
check-latest: true
- name: govulncheck
uses: golang/govulncheck-action@v1

shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: warning
check_together: 'yes'
ignore_paths: 'vendor'
disable_matcher: false
format: gcc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: setup-ceph-cluster
name: test-ceph-csi-operator
on:
pull_request:
branches:
Expand All @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

jobs:
ceph-cluster:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand Down Expand Up @@ -50,3 +50,6 @@ jobs:

- name: create ceph cluster
run: test/scripts/github-action-helper.sh deploy_rook

- name: test ceph-csi-operator
run: test/scripts/test-ceph-csi-operator.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ go.work.sum
*.orig
*.patch
*.rej

# Locally generated install files
dist/
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
$(ENVTEST): $(LOCALBIN)
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))

.PHONY: check-all-committed
check-all-committed: ## Fail in case there are uncommitted changes
test -z "$(shell git status --short)" || (echo "files were modified: " ; git status --short ; false)

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
Expand Down
15 changes: 12 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,27 @@ resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: ceph.io
group: csi
kind: CephCluster
controller: true
kind: CephConnection
path: github.com/ceph/ceph-csi-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: ceph.io
group: csi
kind: ClientProfile
path: github.com/ceph/ceph-csi-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: ceph.io
group: csi
kind: Config
kind: ClientProfileMapping
path: github.com/ceph/ceph-csi-operator/api/v1alpha1
version: v1alpha1
version: "3"
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,50 @@ import (

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

// CephClusterSpec defines the desired state of CephCluster
type CephClusterSpec struct {
Monitors []string `json:"monitors"`
ReadAffinity ReadAffinitySpec `json:"readAffinity,omitempty"`
RbdMirrorDaemonCount int `json:"rbdMirrorDaemonCount,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"`
}

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

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

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

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

//+kubebuilder:object:root=true

// CephClusterList contains a list of CephCluster
type CephClusterList struct {
// CephConnectionList contains a list of CephConnections
type CephConnectionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []CephCluster `json:"items"`
Items []CephConnection `json:"items"`
}

func init() {
SchemeBuilder.Register(&CephCluster{}, &CephClusterList{})
SchemeBuilder.Register(&CephConnection{}, &CephConnectionList{})
}
93 changes: 93 additions & 0 deletions api/v1alpha1/clientprofile_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
Copyright 2024.

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 v1alpha1

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"`
}

// RbdConfigSpec defines the desired RBD configuration
type RbdConfigSpec struct {
//+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: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"`
}

func init() {
SchemeBuilder.Register(&ClientProfile{}, &ClientProfileList{})
}
75 changes: 75 additions & 0 deletions api/v1alpha1/clientprofilemapping_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
Copyright 2024.

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 v1alpha1

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

// BlockPoolRefSpec identify a blockpool - client profile pair
type BlockPoolRefSpec struct {
//+kubebuilder:validation:Required
ClientProfileName string `json:"clientProfileName,omitempty"`

//+kubebuilder:validation:Required
//+kubebuilder:validation:Minimum:=0
PoolId int `json:"poolId,omitempty"`
}

// BlockPoolMappingSpec define a mapiing between a local and remote block pools
type BlockPoolMappingSpec struct {
//+kubebuilder:validation:Required
Local BlockPoolRefSpec `json:"local,omitempty"`

//+kubebuilder:validation:Required
Remote BlockPoolRefSpec `json:"remote,omitempty"`
}

// ClientProfileMappingSpec defines the desired state of ClientProfileMapping
type ClientProfileMappingSpec struct {
//+kubebuilder:validation:Optional
BlockPoolMapping []BlockPoolMappingSpec `json:"blockPoolMapping,omitempty"`
}

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

//+kubebuilder:object:root=true
//+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"`
}

func init() {
SchemeBuilder.Register(&ClientProfileMapping{}, &ClientProfileMappingList{})
}
Loading
Loading