diff --git a/test/e2e/storage/volume_io.go b/test/e2e/storage/volume_io.go index e9205e4dfc3..37b5c5d2d41 100644 --- a/test/e2e/storage/volume_io.go +++ b/test/e2e/storage/volume_io.go @@ -416,7 +416,7 @@ var _ = utils.SIGDescribe("Volume plugin streaming [Slow]", func() { Name: name, }, FSType: "ext2", - ReadOnly: true, + ReadOnly: false, }, } }) diff --git a/test/e2e/storage/volumes.go b/test/e2e/storage/volumes.go index ec76c1ac3bb..2ed8023d967 100644 --- a/test/e2e/storage/volumes.go +++ b/test/e2e/storage/volumes.go @@ -279,10 +279,9 @@ var _ = utils.SIGDescribe("Volumes", func() { ObjectMeta: metav1.ObjectMeta{ Name: config.Prefix + "-secret", }, - // Must use the ceph keyring at contrib/for-tests/volumes-ceph/ceph/init.sh - // and encode in base64 + // from test/images/volumes-tester/rbd/keyring Data: map[string][]byte{ - "key": []byte("AQAMgXhVwBCeDhAA9nlPaFyfUSatGD4drFWDvQ=="), + "key": []byte("AQDRrKNVbEevChAAEmRC+pW/KBVHxa0w/POILA=="), }, Type: "kubernetes.io/cephfs", } diff --git a/test/images/volumes-tester/rbd/Dockerfile b/test/images/volumes-tester/rbd/Dockerfile index e195f3f064a..2c34651915e 100644 --- a/test/images/volumes-tester/rbd/Dockerfile +++ b/test/images/volumes-tester/rbd/Dockerfile @@ -15,16 +15,17 @@ # CEPH all in one # Based on image by Ricardo Rocha, ricardo@catalyst.net.nz -FROM fedora +FROM fedora:26 # Base Packages -RUN yum install -y wget ceph ceph-fuse strace && yum clean all +RUN yum install -y wget strace psmisc procps-ng ceph ceph-fuse && yum clean all # Get ports exposed EXPOSE 6789 ADD ./bootstrap.sh /bootstrap.sh ADD ./mon.sh /mon.sh +ADD ./mds.sh /mds.sh ADD ./osd.sh /osd.sh ADD ./ceph.conf.sh /ceph.conf.sh ADD ./keyring /var/lib/ceph/mon/keyring diff --git a/test/images/volumes-tester/rbd/Makefile b/test/images/volumes-tester/rbd/Makefile index fc35634606b..910ba816057 100644 --- a/test/images/volumes-tester/rbd/Makefile +++ b/test/images/volumes-tester/rbd/Makefile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -TAG = 0.1 +TAG = 0.2 PREFIX = staging-k8s.gcr.io all: push diff --git a/test/images/volumes-tester/rbd/block.tar.gz b/test/images/volumes-tester/rbd/block.tar.gz index 395d1492f9b..8ec08a1d962 100644 Binary files a/test/images/volumes-tester/rbd/block.tar.gz and b/test/images/volumes-tester/rbd/block.tar.gz differ diff --git a/test/images/volumes-tester/rbd/bootstrap.sh b/test/images/volumes-tester/rbd/bootstrap.sh index bb670aca05d..a147b4c8387 100755 --- a/test/images/volumes-tester/rbd/bootstrap.sh +++ b/test/images/volumes-tester/rbd/bootstrap.sh @@ -35,9 +35,29 @@ mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1 sh ./osd.sh 0 sh ./osd.sh 1 -# Prepare a RBD volume -# NOTE: we need Ceph kernel modules on the host! -rbd import block foo +# Configure and start cephfs metadata server +sh ./mds.sh + +# Prepare a RBD volume "foo" (only with layering feature, the others may +# require newer clients). +# NOTE: we need Ceph kernel modules on the host that runs the client! +rbd import --image-feature layering block foo + +# Prepare a cephfs volume +ceph osd pool create cephfs_data 4 +ceph osd pool create cephfs_metadata 4 +ceph fs new cephfs cephfs_metadata cephfs_data +# Put index.html into the volume +# It takes a while until the volume created above is mountable, +# 1 second is usually enough, but try indefinetily. +sleep 1 +while ! ceph-fuse -m `hostname -i`:6789 /mnt; do + echo "Waiting for cephfs to be up" + sleep 1 +done +echo "Hello Ceph!" > /mnt/index.html +chmod 644 /mnt/index.html +umount /mnt echo "Ceph is ready" diff --git a/test/images/volumes-tester/rbd/ceph.conf.sh b/test/images/volumes-tester/rbd/ceph.conf.sh index ecafa43d6ba..6ccfffda57e 100755 --- a/test/images/volumes-tester/rbd/ceph.conf.sh +++ b/test/images/volumes-tester/rbd/ceph.conf.sh @@ -29,9 +29,13 @@ host = cephbox mon addr = $1 [osd] -osd journal size = 128 +osd journal size = 128 journal dio = false +# allow running on ext4 +osd max object name len = 256 +osd max object namespace len = 64 + [osd.0] osd host = cephbox " > /etc/ceph/ceph.conf diff --git a/test/images/volumes-tester/rbd/create_block.sh b/test/images/volumes-tester/rbd/create_block.sh index e865463a644..705957b1db1 100755 --- a/test/images/volumes-tester/rbd/create_block.sh +++ b/test/images/volumes-tester/rbd/create_block.sh @@ -36,8 +36,9 @@ cleanup() trap cleanup TERM EXIT -# Create 1MB device with ext2 -dd if=/dev/zero of=block count=1 bs=1M +# Create 120MB device with ext2 +# (volume_io tests need at least 100MB) +dd if=/dev/zero of=block seek=120 count=1 bs=1M mkfs.ext2 block # Add index.html to it diff --git a/test/images/volumes-tester/rbd/mds.sh b/test/images/volumes-tester/rbd/mds.sh new file mode 100755 index 00000000000..744ccbf6b3b --- /dev/null +++ b/test/images/volumes-tester/rbd/mds.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Copyright 2017 The Kubernetes Authors. +# +# 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. + +# +# Configures Ceph Metadata Service (mds), needed by CephFS +# +ceph-mds -i cephfs -c /etc/ceph/ceph.conf diff --git a/test/utils/image/manifest.go b/test/utils/image/manifest.go index dae027c3269..d3ed428ebd6 100644 --- a/test/utils/image/manifest.go +++ b/test/utils/image/manifest.go @@ -97,7 +97,7 @@ var ( VolumeISCSIServer = ImageConfig{gcRegistry, "volume-iscsi", "0.2", false} VolumeGlusterServer = ImageConfig{gcRegistry, "volume-gluster", "0.2", false} VolumeCephServer = ImageConfig{gcRegistry, "volume-ceph", "0.1", false} - VolumeRBDServer = ImageConfig{gcRegistry, "volume-rbd", "0.1", false} + VolumeRBDServer = ImageConfig{gcRegistry, "volume-rbd", "0.2", false} ) func GetE2EImage(image ImageConfig) string {