From 7f23c5d78d7fac02849438d5d45f43e0f42217c4 Mon Sep 17 00:00:00 2001 From: Narinder Gupta Date: Tue, 31 Oct 2017 10:53:52 -0500 Subject: adding ceph support for Kubernetes. Change-Id: If7cf0add214da153daf39967fac15ba027cc3885 Signed-off-by: Narinder Gupta --- ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml | 4 ++- ci/config_tpl/juju2/bundlek8_tpl/ceph.yaml | 35 +++++++++++++++++++++++++ ci/config_tpl/juju2/bundlek8_tpl/relations.yaml | 5 +++- ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml | 23 ++++++++++++++-- 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 ci/config_tpl/juju2/bundlek8_tpl/ceph.yaml (limited to 'ci/config_tpl') diff --git a/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml b/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml index b4ed14ac..ef5bbe37 100644 --- a/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml +++ b/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml @@ -26,7 +26,9 @@ {% else %} {% include 'flannel.yaml' %} {% endif %} - +{% if k8.feature.storage == 'ceph' %} +{% include 'ceph.yaml' %} +{% endif %} relations: - [ 'ntp:juju-info', 'nodes:juju-info' ] diff --git a/ci/config_tpl/juju2/bundlek8_tpl/ceph.yaml b/ci/config_tpl/juju2/bundlek8_tpl/ceph.yaml new file mode 100644 index 00000000..56149033 --- /dev/null +++ b/ci/config_tpl/juju2/bundlek8_tpl/ceph.yaml @@ -0,0 +1,35 @@ + + ceph-mon: + charm: "./{{ ubuntu.release }}/ceph-mon" + num_units: {{ unit_ceph_qty() }} +{% if os.service.bindings %} + bindings: + "": *oam-space + public: *ceph-public-space + cluster: *ceph-cluster-space +{% endif %} + options: + expected-osd-count: {{ unit_ceph_qty() }} + to: +{% for unit_id in to_select(unit_ceph_qty()) %} + - "lxd:nodes/{{ unit_id }}" +{% endfor %} + + ceph-osd: + charm: "./{{ ubuntu.release }}/ceph-osd" + num_units: {{ opnfv.units }} +{% if os.service.bindings %} + bindings: + "": *oam-space + public: *ceph-public-space + cluster: *ceph-cluster-space +{% endif %} + options: + osd-devices: *osd-devices + osd-journal: *osd-journal + osd-reformat: 'yes' + to: + {% for unit_id in range(0, opnfv.units) %} + - "nodes/{{ unit_id }}" + {% endfor %} + diff --git a/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml b/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml index 44018201..42c9e136 100644 --- a/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml +++ b/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml @@ -21,4 +21,7 @@ - [ 'kubernetes-worker:kube-api-endpoint', 'kubeapi-load-balancer:website' ] - [ 'kubeapi-load-balancer:certificates', 'easyrsa:client' ] {% endif %} - +{% if k8.feature.storage == 'ceph' %} + - [ 'ceph-osd:mon', 'ceph-mon:osd' ] + - [ 'ceph-mon:admin', 'kubernetes-master:ceph-storage' ] +{% endif %} diff --git a/ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml b/ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml index 17dbd7da..01afb34d 100644 --- a/ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml +++ b/ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml @@ -1,5 +1,24 @@ - - # OAM - Operations, Administration and Maintenance oam-space: &oam-space internal-api + # CEPH configuration + # CEPH access network +{% if opnfv.spaces_dict.storageaccess is defined %} + ceph-public-space: &ceph-public-space storage-access-space + ceph-access-constr: &ceph-access-constr spaces=storage-access-space +{% else %} + ceph-public-space: &ceph-public-space internal-api + ceph-access-constr: &ceph-access-constr spaces=internal-api +{% endif %} + + # CEPH replication network +{% if opnfv.spaces_dict.storage is defined %} + ceph-cluster-space: &ceph-cluster-space storage-cluster +{% else %} + ceph-cluster-space: &ceph-cluster-space internal-api +{% endif %} + + # CEPH OSD and journal devices; temporary workaround for #1674148 + osd-devices: &osd-devices {{ opnfv.storage_dict.ceph.disk }} + osd-journal: &osd-journal + -- cgit 1.2.3-korg