Skip to content

Commit 5ad9c0c

Browse files
markgoddardmnasiadka
authored andcommitted
Add support for Ceph RadosGW integration
* Register Swift-compatible endpoints in Keystone * Load balance across RadosGW API servers using HAProxy The support is exercised in the cephadm CI jobs, but since RGW is not currently enabled via cephadm, it is not yet tested. https://docs.ceph.com/en/latest/radosgw/keystone/ Implements: blueprint ceph-rgw Change-Id: I891c3ed4ed93512607afe65a42dd99596fd4dbf9
1 parent 565aefe commit 5ad9c0c

File tree

21 files changed

+259
-0
lines changed

21 files changed

+259
-0
lines changed

ansible/group_vars/all.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ barbican_api_listen_port: "{{ barbican_api_port }}"
284284

285285
blazar_api_port: "1234"
286286

287+
ceph_rgw_internal_fqdn: "{{ kolla_internal_fqdn }}"
288+
ceph_rgw_external_fqdn: "{{ kolla_external_fqdn }}"
289+
ceph_rgw_port: "6780"
290+
287291
cinder_internal_fqdn: "{{ kolla_internal_fqdn }}"
288292
cinder_external_fqdn: "{{ kolla_external_fqdn }}"
289293
cinder_api_port: "8776"
@@ -607,6 +611,8 @@ enable_ceilometer: "no"
607611
enable_ceilometer_ipmi: "no"
608612
enable_cells: "no"
609613
enable_central_logging: "no"
614+
enable_ceph_rgw: "no"
615+
enable_ceph_rgw_loadbalancer: "{{ enable_ceph_rgw | bool }}"
610616
enable_chrony: "no"
611617
enable_cinder: "no"
612618
enable_cinder_backup: "yes"
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
project_name: "ceph-rgw"
3+
4+
ceph_rgw_services:
5+
# NOTE(mgoddard): There is no container deployment, this is used for load
6+
# balancer configuration.
7+
ceph-rgw:
8+
group: "all"
9+
enabled: "{{ enable_ceph_rgw | bool }}"
10+
haproxy:
11+
radosgw:
12+
enabled: "{{ enable_ceph_rgw_loadbalancer | bool }}"
13+
mode: "http"
14+
external: false
15+
port: "{{ ceph_rgw_port }}"
16+
custom_member_list: "{{ ceph_rgw_haproxy_members }}"
17+
radosgw_external:
18+
enabled: "{{ enable_ceph_rgw_loadbalancer | bool }}"
19+
mode: "http"
20+
external: true
21+
port: "{{ ceph_rgw_port }}"
22+
custom_member_list: "{{ ceph_rgw_haproxy_members }}"
23+
24+
####################
25+
# Load balancer
26+
####################
27+
28+
# List of Ceph hosts to use as HAProxy backends. Each item should contain
29+
# 'host' and 'port'` keys. The 'ip' and 'port' keys are optional. If 'ip' is
30+
# not specified, the 'host' values should be resolvable from the host running
31+
# HAProxy. If the ``port`` is not specified, the default HTTP (80) or HTTPS
32+
# (443) port will be used.
33+
ceph_rgw_hosts: []
34+
ceph_rgw_haproxy_members: >-
35+
{%- set members = [] -%}
36+
{%- for host in ceph_rgw_hosts -%}
37+
{%- set port = (":" ~ host.port) if host.port is defined else "" -%}
38+
{%- set member = "server " ~ host.host ~ " " ~ host.ip | default(host.host) ~ port ~ " " ~ ceph_rgw_haproxy_healthcheck -%}
39+
{%- set _ = members.append(member) -%}
40+
{%- endfor -%}
41+
{{ members }}
42+
ceph_rgw_haproxy_healthcheck: "check inter 2000 rise 2 fall 5"
43+
44+
45+
####################
46+
# OpenStack
47+
####################
48+
49+
# Whether to register Ceph RadosGW swift-compatible endpoints in Keystone.
50+
enable_ceph_rgw_keystone: "{{ enable_ceph_rgw | bool }}"
51+
52+
# Enable/disable ceph-rgw compatibility with OpenStack Swift.
53+
# This should match the configuration used by Ceph RadosGW.
54+
ceph_rgw_swift_compatibility: false
55+
56+
# Enable/disable including the account (project) in the endpoint URL. This
57+
# allows for cross-project and public object access.
58+
# This should match the 'rgw_swift_account_in_url' config option used by Ceph
59+
# RadosGW.
60+
ceph_rgw_swift_account_in_url: false
61+
62+
ceph_rgw_endpoint_path: "{{ '/' if ceph_rgw_swift_compatibility | bool else '/swift/' }}v1{% if ceph_rgw_swift_account_in_url | bool %}/AUTH_%(project_id)s{% endif %}"
63+
64+
ceph_rgw_admin_endpoint: "{{ admin_protocol }}://{{ ceph_rgw_internal_fqdn | put_address_in_context('url') }}:{{ ceph_rgw_port }}{{ ceph_rgw_endpoint_path }}"
65+
ceph_rgw_internal_endpoint: "{{ internal_protocol }}://{{ ceph_rgw_internal_fqdn | put_address_in_context('url') }}:{{ ceph_rgw_port }}{{ ceph_rgw_endpoint_path }}"
66+
ceph_rgw_public_endpoint: "{{ public_protocol }}://{{ ceph_rgw_external_fqdn | put_address_in_context('url') }}:{{ ceph_rgw_port }}{{ ceph_rgw_endpoint_path }}"
67+
68+
ceph_rgw_keystone_user: "ceph_rgw"
69+
70+
openstack_ceph_rgw_auth: "{{ openstack_auth }}"
71+
72+
73+
####################
74+
# Keystone
75+
####################
76+
ceph_rgw_ks_services:
77+
- name: "swift"
78+
type: "object-store"
79+
description: "Openstack Object Storage"
80+
endpoints:
81+
- {'interface': 'admin', 'url': '{{ ceph_rgw_admin_endpoint }}'}
82+
- {'interface': 'internal', 'url': '{{ ceph_rgw_internal_endpoint }}'}
83+
- {'interface': 'public', 'url': '{{ ceph_rgw_public_endpoint }}'}
84+
85+
ceph_rgw_ks_users:
86+
- project: "service"
87+
user: "{{ ceph_rgw_keystone_user }}"
88+
password: "{{ ceph_rgw_keystone_password }}"
89+
role: "admin"
90+
91+
ceph_rgw_ks_roles:
92+
- "ResellerAdmin"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
- import_tasks: register.yml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: "Configure haproxy for {{ project_name }}"
3+
import_role:
4+
role: haproxy-config
5+
vars:
6+
project_services: "{{ ceph_rgw_services }}"
7+
tags: always
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
- include_tasks: "{{ kolla_action }}.yml"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Fail if load balancer members not set
3+
fail:
4+
msg: >-
5+
Ceph RadosGW load balancer configuration is enabled
6+
(enable_ceph_rgw_loadbalancer) but no HAProxy members are configured.
7+
Have you set ceph_rgw_hosts?
8+
when:
9+
- enable_ceph_rgw_loadbalancer | bool
10+
- ceph_rgw_haproxy_members | length == 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---

0 commit comments

Comments
 (0)