mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-08 16:30:57 -04:00
Merge pull request #133620 from zeqian-meng/remove-rbd-image
Remove rbd image and storage class
This commit is contained in:
commit
58715a58da
13 changed files with 0 additions and 322 deletions
|
|
@ -1,14 +0,0 @@
|
|||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: slow
|
||||
provisioner: kubernetes.io/rbd
|
||||
parameters:
|
||||
monitors: 127.0.0.1:6789
|
||||
adminId: admin
|
||||
adminSecretName: ceph-secret-admin
|
||||
adminSecretNamespace: "kube-system"
|
||||
pool: kube
|
||||
userId: kube
|
||||
userSecretName: ceph-secret-user
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
linux/amd64=fedora:38
|
||||
linux/arm64=arm64v8/fedora:38
|
||||
linux/ppc64le=ppc64le/fedora:38
|
||||
linux/s390x=s390x/fedora:38
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
# Copyright 2016 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.
|
||||
|
||||
# CEPH all in one
|
||||
# Based on image by Ricardo Rocha, ricardo@catalyst.net.nz
|
||||
|
||||
ARG BASEIMAGE
|
||||
FROM $BASEIMAGE
|
||||
|
||||
CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/
|
||||
|
||||
# Base Packages
|
||||
RUN yum install -y wget strace psmisc procps-ng ceph ceph-fuse hostname && 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
|
||||
ADD ./block.tar.gz /
|
||||
|
||||
CMD /bootstrap.sh
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# rbd and ceph target container for testing.
|
||||
|
||||
* The container needs to run with `docker --privileged` mode
|
||||
|
||||
`block.tar.gz` is a small ext2 filesystem created by `create_block.sh` (run as root!)
|
||||
|
||||
# Credentials
|
||||
|
||||
Credentials in this directory are generated for testing purposes only.
|
||||
|
|
@ -1 +0,0 @@
|
|||
1.0.6
|
||||
Binary file not shown.
|
|
@ -1,76 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2015 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.
|
||||
|
||||
#
|
||||
# Bootstraps a CEPH server.
|
||||
# It creates two OSDs on local machine, creates RBD pool there
|
||||
# and imports 'block' device there.
|
||||
#
|
||||
# We must create fresh OSDs and filesystem here, because shipping it
|
||||
# in a container would increase the image by ~300MB.
|
||||
#
|
||||
|
||||
|
||||
# Create /etc/ceph/ceph.conf
|
||||
sh ./ceph.conf.sh "$(hostname -i)"
|
||||
|
||||
# Configure and start ceph-mon
|
||||
sh ./mon.sh "$(hostname -i)"
|
||||
|
||||
# Configure and start 2x ceph-osd
|
||||
mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1
|
||||
sh ./osd.sh 0
|
||||
sh ./osd.sh 1
|
||||
|
||||
# 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!
|
||||
# As the default pool `rbd` might not be created on arm64 platform for ceph deployment,
|
||||
# should create it if it does not exist.
|
||||
arch=$(uname -m)
|
||||
if [[ ${arch} = 'aarch64' || ${arch} = 'arm64' ]]; then
|
||||
if [[ $(ceph osd lspools) = "" ]]; then
|
||||
ceph osd pool create rbd 8
|
||||
rbd pool init rbd
|
||||
fi
|
||||
fi
|
||||
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"
|
||||
|
||||
# Wait forever
|
||||
while true; do
|
||||
sleep 10
|
||||
done
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2015 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 /etc/ceph.conf from a template.
|
||||
#
|
||||
|
||||
echo "
|
||||
[global]
|
||||
auth cluster required = none
|
||||
auth service required = none
|
||||
auth client required = none
|
||||
|
||||
[mon.a]
|
||||
host = cephbox
|
||||
mon addr = $1
|
||||
|
||||
[osd]
|
||||
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
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2015 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.
|
||||
|
||||
# Create block.tar.gz with a small ext2 filesystem.
|
||||
# It must be run as root (to mount with '-o loop')!
|
||||
|
||||
# Exit on the first error.
|
||||
set -e
|
||||
|
||||
MNTDIR="$(mktemp -d)"
|
||||
|
||||
cleanup()
|
||||
{
|
||||
# Make sure we return the right exit code
|
||||
RET=$?
|
||||
# Silently remove everything and ignore errors
|
||||
set +e
|
||||
/bin/umount "$MNTDIR" 2>/dev/null
|
||||
/bin/rmdir "$MNTDIR" 2>/dev/null
|
||||
/bin/rm block 2>/dev/null
|
||||
exit $RET
|
||||
}
|
||||
|
||||
trap cleanup TERM EXIT
|
||||
|
||||
# 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
|
||||
mount -o loop block "$MNTDIR"
|
||||
echo "Hello from RBD" > "$MNTDIR/index.html"
|
||||
umount "$MNTDIR"
|
||||
|
||||
rm block.tar.gz 2>/dev/null || :
|
||||
tar cfz block.tar.gz block
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[mon.]
|
||||
key = AQDRrKNV6z4UChAABzP1ZyysTU4pjgjNOf/p3A==
|
||||
[client.admin]
|
||||
key = AQDRrKNVbEevChAAEmRC+pW/KBVHxa0w/POILA==
|
||||
auid = 0
|
||||
caps mds = "allow *"
|
||||
caps mon = "allow *"
|
||||
caps osd = "allow *"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env 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
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2015 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 and launches a new MON.
|
||||
#
|
||||
|
||||
# monitor setup
|
||||
monmaptool --create --clobber --fsid "$(uuidgen)" --add a "${1}":6789 /etc/ceph/monmap
|
||||
mkdir /var/lib/ceph/mon/ceph-a
|
||||
ceph-mon -i a --mkfs --monmap /etc/ceph/monmap -k /var/lib/ceph/mon/keyring
|
||||
cp /var/lib/ceph/mon/keyring /var/lib/ceph/mon/ceph-a
|
||||
ceph-mon -i a --monmap /etc/ceph/monmap -k /var/lib/ceph/mon/ceph-a/keyring
|
||||
|
||||
# client setup (handy)
|
||||
cp /var/lib/ceph/mon/keyring /etc/ceph
|
||||
|
||||
# for this test we want to
|
||||
ceph osd getcrushmap -o /tmp/crushc
|
||||
crushtool -d /tmp/crushc -o /tmp/crushd
|
||||
sed -i 's/step chooseleaf firstn 0 type host/step chooseleaf firstn 0 type osd/' /tmp/crushd
|
||||
crushtool -c /tmp/crushd -o /tmp/crushc
|
||||
ceph osd setcrushmap -i /tmp/crushc
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2015 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 and launches a new OSD.
|
||||
#
|
||||
|
||||
ceph osd create
|
||||
ceph-osd -i "${1}" --mkfs --mkkey
|
||||
ceph auth add "osd.${1}" osd 'allow *' mon 'allow rwx' -i "/var/lib/ceph/osd/ceph-${1}/keyring"
|
||||
ceph osd crush add "${1}" 1 root=default host=cephbox
|
||||
ceph-osd -i "${1}" -k "/var/lib/ceph/osd/ceph-${1}/keyring"
|
||||
Loading…
Reference in a new issue