Functional Ceph RadosGW docker container and config

This is just a basic example of getting RadosGW to run in docker with Keystone auth support.

It runs S3 and Swift API’s out of the box, so you can use tools like s3cmd or ‘openstack container list’ using the below configs

 

Command to run inside docker container

radosgw -d -f --cluster ceph --name client.rgw.mon-1.rgw0 --setuser ceph --setgroup ceph

Dockerfile

FROM ubuntu:18.04
RUN apt update
RUN apt install wget gnupg -y
RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
RUN echo deb https://download.ceph.com/debian-octopus/ bionic main | tee /etc/apt/sources.list.d/ceph.list
RUN apt update
ENV DEBIAN_FRONTEND=noninteractive
RUN apt install -y radosgw

ceph.conf example

[client.rgw.mon-1.rgw0]
host = mon-1
keyring = /var/lib/ceph/radosgw/ceph-rgw.mon-1.rgw0/keyring
log file = /var/log/ceph/ceph-rgw-mon-1.rgw0.log
rgw frontends = beast port=8080
#endpoint=0.0.0.0:8080
rgw thread pool size = 512

rgw keystone api version = 3
rgw keystone url = http://172.17.8.101:5000
rgw keystone admin user = admin
rgw keystone admin password = c5Tl0IsBeIS2XDZ58AkBmI2M
rgw keystone admin domain = default
rgw keystone admin project = admin
rgw keystone accepted roles = member,admin
rgw keystone token cache size = 500
#rgw keystone implicit tenants = {true for private tenant for each new user}


# Please do not change this file directly since it is managed by Ansible and will be overwritten
[global]
cluster network = 172.21.0.0/16
fsid = 8b8dff27-af09-4a7a-bc71-f12b57832ecd
mon host = [v2:172.21.15.12:3300,v1:172.21.15.12:6789],[v2:172.21.15.13:3300,v1:172.21.15.13:6789],[v2:172.21.15.14:3300,v1:172.21.15.14:6789]
mon initial members = mon-1,mon-2,mon-3
osd pool default crush rule = -1
public network = 172.21.0.0/16