From 3f3412148c81f4a7161a0bb5209b6f50f0ea5cd2 Mon Sep 17 00:00:00 2001 From: lub Date: Sun, 8 Dec 2019 20:58:12 +0100 Subject: [PATCH] add initial compose files --- .gitignore | 1 + client/docker-compose.yml | 23 +++++++++++++++++++++++ mds/docker-compose.yml | 18 ++++++++++++++++++ mgr/docker-compose.yml | 15 +++++++++++++++ mon/docker-compose.yml | 25 +++++++++++++++++++++++++ osd/docker-compose.yml | 23 +++++++++++++++++++++++ 6 files changed, 105 insertions(+) create mode 100644 .gitignore create mode 100644 client/docker-compose.yml create mode 100644 mds/docker-compose.yml create mode 100644 mgr/docker-compose.yml create mode 100644 mon/docker-compose.yml create mode 100644 osd/docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..354d3c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +mon/.env \ No newline at end of file diff --git a/client/docker-compose.yml b/client/docker-compose.yml new file mode 100644 index 0000000..98069de --- /dev/null +++ b/client/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3.0" +services: + ceph_client: + image: docker.io/ceph/daemon:latest-nautilus + devices: + - /dev/fuse + volumes: + - /ceph/client/etc/ceph/:/etc/ceph/ + #:shared makes container mounts accessiable from the host + - /cephfs/:/cephfs/:shared + entrypoint: ceph-fuse + command: /cephfs/ -f --id ${HOSTNAME} + security_opt: + #required for fuse + - apparmor:unconfied + cap_add: + #required for fuse + - SYS_ADMIN + networks: + - ceph +networks: + ceph: + external: true \ No newline at end of file diff --git a/mds/docker-compose.yml b/mds/docker-compose.yml new file mode 100644 index 0000000..102c0ba --- /dev/null +++ b/mds/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.0" +services: + ceph_mds: + image: docker.io/ceph/daemon:latest-nautilus + #copy hostname of the host to avoid confusion in e.g. `ceph status` + hostname: ${HOSTNAME} + environment: + #in case cephfs doesn't exist, yet (normally only during bootstrap) + - CEPHFS_CREATE=1 + volumes: + - /ceph/mds/var/lib/ceph/:/var/lib/ceph/ + - /ceph/mds/etc/ceph/:/etc/ceph/ + command: mds + networks: + - ceph +networks: + ceph: + external: true \ No newline at end of file diff --git a/mgr/docker-compose.yml b/mgr/docker-compose.yml new file mode 100644 index 0000000..d7d834a --- /dev/null +++ b/mgr/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.0" +services: + ceph_mgr: + image: docker.io/ceph/daemon:latest-nautilus + #copy hostname of the host to avoid confusion in e.g. `ceph status` + hostname: ${HOSTNAME} + volumes: + - /ceph/mgr/var/lib/ceph/:/var/lib/ceph/ + - /ceph/mgr/etc/ceph/:/etc/ceph/ + command: mgr + networks: + - ceph +networks: + ceph: + external: true \ No newline at end of file diff --git a/mon/docker-compose.yml b/mon/docker-compose.yml new file mode 100644 index 0000000..00ff341 --- /dev/null +++ b/mon/docker-compose.yml @@ -0,0 +1,25 @@ +#mons need a static ip address +#we reserve 10.13.37.0/24 for this +#manually pick a free ip address and place it in a .env file: +#MON_IP=10.13.37.312 + +version: "3.0" +services: + ceph_mon: + image: docker.io/ceph/daemon:latest-nautilus + #copy hostname of the host to avoid confusion in e.g. `ceph status` + hostname: ${HOSTNAME} + environment: + - MON_IP=${MON_IP} + - CEPH_PUBLIC_NETWORK=10.13.37.0/23 + - CEPH_CLUSTER_NETWORK=10.13.37.0/23 + volumes: + - /ceph/mon/var/lib/ceph/:/var/lib/ceph/ + - /ceph/mon/etc/ceph/:/etc/ceph/ + command: mon + networks: + ceph: + ipv4_address: ${MON_IP} +networks: + ceph: + external: true \ No newline at end of file diff --git a/osd/docker-compose.yml b/osd/docker-compose.yml new file mode 100644 index 0000000..4b99bda --- /dev/null +++ b/osd/docker-compose.yml @@ -0,0 +1,23 @@ +#provide the OSD_ID via a environment variable: +#OSD_ID=1337 + +version: "3.0" +services: + ceph_osd_${OSD_ID}: + image: docker.io/ceph/daemon:latest-nautilus + #copy hostname of the host to correctly calculate CRUSH map positions + hostname: ${HOSTNAME} + environment: + - OSD_ID=${OSD_ID} + volumes: + - /ceph/osd_${OSD_ID}/var/lib/ceph/:/var/lib/ceph/ + - /ceph/osd_${OSD_ID}/etc/ceph/:/etc/ceph/ + - /dev/:/dev/ + command: osd_ceph_volume_activate + cap_add: + - SYS_ADMIN + networks: + - ceph +networks: + ceph: + external: true \ No newline at end of file