Skip to content

Commit

Permalink
Merge pull request #758 from red-hat-storage/sync_us--master
Browse files Browse the repository at this point in the history
Syncing latest changes from upstream master for rook
  • Loading branch information
subhamkrai authored Oct 21, 2024
2 parents ae7ca5b + 1c91774 commit 70b1cc2
Show file tree
Hide file tree
Showing 36 changed files with 262 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:

jobs:
macos-build:
runs-on: macos-12
runs-on: macos-latest
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
steps:
- name: checkout
Expand Down
78 changes: 37 additions & 41 deletions .github/workflows/canary-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: validate-yaml
run: tests/scripts/github-action-helper.sh validate_yaml
Expand Down Expand Up @@ -424,7 +424,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: validate-yaml
run: tests/scripts/github-action-helper.sh validate_yaml
Expand Down Expand Up @@ -525,7 +525,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: validate-yaml
run: tests/scripts/github-action-helper.sh validate_yaml
Expand Down Expand Up @@ -583,7 +583,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: validate-yaml
run: tests/scripts/github-action-helper.sh validate_yaml
Expand Down Expand Up @@ -635,7 +635,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: validate-yaml
run: tests/scripts/github-action-helper.sh validate_yaml
Expand Down Expand Up @@ -692,7 +692,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk and create partitions for osds
run: |
Expand Down Expand Up @@ -768,7 +768,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk
run: tests/scripts/github-action-helper.sh use_local_disk
Expand Down Expand Up @@ -820,7 +820,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk
run: tests/scripts/github-action-helper.sh use_local_disk
Expand Down Expand Up @@ -875,7 +875,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk and create partitions for osds
run: |
Expand Down Expand Up @@ -943,7 +943,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk
run: tests/scripts/github-action-helper.sh use_local_disk
Expand Down Expand Up @@ -997,7 +997,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk
run: tests/scripts/github-action-helper.sh use_local_disk
Expand Down Expand Up @@ -1061,7 +1061,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk and create partitions for osds
run: |
Expand Down Expand Up @@ -1147,7 +1147,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: use local disk and create partitions for osds
run: |
Expand Down Expand Up @@ -1213,7 +1213,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "tests/manifests/test-cluster-on-pvc-encrypted.yaml" "${{ matrix.ceph-image }}"

- name: create cluster prerequisites
run: tests/scripts/github-action-helper.sh create_cluster_prerequisites
Expand Down Expand Up @@ -1270,7 +1270,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: use local disk into two partitions
run: |
Expand Down Expand Up @@ -1525,12 +1525,12 @@ jobs:
with:
use-tmate: ${{ secrets.USE_TMATE }}

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"

- name: setup cluster resources
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: install additional deps for object testing
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
Expand Down Expand Up @@ -1658,19 +1658,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"

- name: install deps
shell: bash --noprofile --norc -eo pipefail -x {0}
run: tests/scripts/github-action-helper.sh install_deps

- name: print k8s cluster status
shell: bash --noprofile --norc -eo pipefail -x {0}
run: tests/scripts/github-action-helper.sh print_k8s_cluster_status

- name: build rook
shell: bash --noprofile --norc -eo pipefail -x {0}
run: tests/scripts/github-action-helper.sh build_rook
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: allow holder pod deployment
run: sed -i "s|CSI_DISABLE_HOLDER_PODS|# CSI_DISABLE_HOLDER_PODS|g" "deploy/examples/operator.yaml"
Expand Down Expand Up @@ -1744,7 +1732,7 @@ jobs:
run: sed -i "s|CSI_DISABLE_HOLDER_PODS|# CSI_DISABLE_HOLDER_PODS|g" "deploy/examples/operator.yaml"

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: use local disk and create partitions for osds
run: |
Expand Down Expand Up @@ -1778,7 +1766,7 @@ jobs:
with:
name: ${{ github.job }}-${{ matrix.ceph-image }}

object-with-cephblockpools:
two-object-one-zone:
runs-on: ubuntu-22.04
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
strategy:
Expand All @@ -1799,7 +1787,7 @@ jobs:
uses: ./.github/workflows/canary-test-config

- name: set Ceph version in CephCluster manifest
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}"
run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}"

- name: validate-yaml
run: tests/scripts/github-action-helper.sh validate_yaml
Expand All @@ -1810,17 +1798,25 @@ jobs:
tests/scripts/github-action-helper.sh create_partitions_for_osds
- name: deploy cluster
run: tests/scripts/github-action-helper.sh deploy_cluster
run: |
tests/scripts/github-action-helper.sh deploy_cluster
tests/scripts/github-action-helper.sh wait_for cephcluster my-cluster rook-ceph
- name: create CephBlockPool(s) and CephObjectStore
- name: create CephBlockPool(s), CephObjectZone, and CephObjectStore(s)
shell: bash --noprofile --norc -eo pipefail -x {0}
run: kubectl create -f deploy/examples/object-with-cephblockpools-test.yaml

- name: wait for CephObjectStore to be ready
run: tests/scripts/validate_cluster.sh rgw object-with-cephblockpools
run: |
kubectl create -f deploy/examples/object-separate-pools-test.yaml
kubectl create -f deploy/examples/two-object-one-zone-test.yaml
tests/scripts/github-action-helper.sh wait_for cephobjectzone object-separate-pools rook-ceph 600
tests/scripts/github-action-helper.sh wait_for cephobjectstore two-object-one-zone-alpha rook-ceph 600
tests/scripts/github-action-helper.sh wait_for cephobjectstore two-object-one-zone-beta rook-ceph 600
- name: check for pools created by RGW that are unexpected
run: tests/scripts/github-action-helper.sh test_object_with_cephblockpools_extra_pools
run: tests/scripts/github-action-helper.sh test_object_separate_pools

- name: verify that only one zone exists
run: |
[[ $(tests/scripts/github-action-helper.sh radosgw-admin zone list | jq '.zones | length') == "1" ]]
- name: collect common logs
if: always()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
##########################################################
# Create an object store using pre-created pools
# kubectl create -f object-with-cephblockpools-test.yaml
##########################################################
---
apiVersion: ceph.rook.io/v1
kind: CephObjectStore
metadata:
name: object-with-cephblockpools
namespace: rook-ceph # namespace:cluster
spec:
gateway:
port: 80
instances: 1
##########################################################################
# Pre-create the pools for the an object store with custom configuration.
# kubectl create -f object-separate-pools-test.yaml
##########################################################################
---
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
Expand All @@ -32,7 +22,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.control
name: object-separate-pools.rgw.control
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand All @@ -47,7 +37,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.meta
name: object-separate-pools.rgw.meta
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand All @@ -62,7 +52,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.log
name: object-separate-pools.rgw.log
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand All @@ -77,7 +67,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.buckets.index
name: object-separate-pools.rgw.buckets.index
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand All @@ -92,7 +82,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.buckets.non-ec
name: object-separate-pools.rgw.buckets.non-ec
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand All @@ -107,7 +97,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.otp
name: object-separate-pools.rgw.otp
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand All @@ -122,7 +112,7 @@ spec:
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: object-with-cephblockpools.rgw.buckets.data
name: object-separate-pools.rgw.buckets.data
namespace: rook-ceph # namespace:cluster
spec:
application: rgw
Expand Down
50 changes: 50 additions & 0 deletions deploy/examples/two-object-one-zone-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#####################################################################
# Create an two object stores with the same set of pre-created pools
# kubectl create -f two-object-one-zone-test.yaml
#####################################################################
---
apiVersion: ceph.rook.io/v1
kind: CephObjectRealm
metadata:
name: two-object-one-zone
namespace: rook-ceph # namespace:cluster
---
apiVersion: ceph.rook.io/v1
kind: CephObjectZoneGroup
metadata:
name: two-object-one-zone
namespace: rook-ceph # namespace:cluster
spec:
realm: two-object-one-zone
---
apiVersion: ceph.rook.io/v1
kind: CephObjectZone
metadata:
name: object-separate-pools
namespace: rook-ceph # namespace:cluster
spec:
zoneGroup: two-object-one-zone
---
apiVersion: ceph.rook.io/v1
kind: CephObjectStore
metadata:
name: two-object-one-zone-alpha
namespace: rook-ceph # namespace:cluster
spec:
gateway:
port: 80
instances: 1
zone:
name: object-separate-pools
---
apiVersion: ceph.rook.io/v1
kind: CephObjectStore
metadata:
name: two-object-one-zone-beta
namespace: rook-ceph # namespace:cluster
spec:
gateway:
port: 80
instances: 1
zone:
name: object-separate-pools
1 change: 1 addition & 0 deletions pkg/operator/ceph/cluster/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func (c *ClusterController) cleanUpJobTemplateSpec(cluster *cephv1.CephCluster,
Volumes: volumes,
RestartPolicy: v1.RestartPolicyOnFailure,
PriorityClassName: cephv1.GetCleanupPriorityClassName(cluster.Spec.PriorityClassNames),
SecurityContext: &v1.PodSecurityContext{},
ServiceAccountName: k8sutil.DefaultServiceAccount,
HostNetwork: opcontroller.EnforceHostNetwork(),
},
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/ceph/cluster/mgr/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (c *Cluster) makeDeployment(mgrConfig *mgrConfig) (*apps.Deployment, error)
Containers: []v1.Container{
c.makeMgrDaemonContainer(mgrConfig),
},
SecurityContext: &v1.PodSecurityContext{},
ServiceAccountName: serviceAccountName,
RestartPolicy: v1.RestartPolicyAlways,
Volumes: volumes,
Expand Down
Loading

0 comments on commit 70b1cc2

Please sign in to comment.