- start k8s with kinikube with an extra disk:
minikube start --extra-disks=1 --driver=kvm2
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/crds.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/common.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/operator.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/csi-operator.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/cluster-test.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/object-test.yaml
- expose the object store service to the outside:
kubectl create -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/rgw-external.yaml
- create a storage class and object bucket claim:
kubectl apply -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/storageclass-bucket-delete.yaml
kubectl apply -f https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/object-bucket-claim-delete.yaml
- upload an object to the bucket:
export AWS_URL=$(minikube service --url rook-ceph-rgw-my-store-external -n rook-ceph)
export AWS_ACCESS_KEY_ID=$(kubectl -n default get secret ceph-delete-bucket -o jsonpath='{.data.AWS_ACCESS_KEY_ID}' | base64 --decode)
export AWS_SECRET_ACCESS_KEY=$(kubectl -n default get secret ceph-delete-bucket -o jsonpath='{.data.AWS_SECRET_ACCESS_KEY}' | base64 --decode)
export BUCKET_NAME=$(kubectl get objectbucketclaim ceph-delete-bucket -o jsonpath='{.spec.bucketName}')
echo "hello world" > hello.txt
aws --endpoint-url $AWS_URL s3 cp hello.txt s3://$BUCKET_NAME