]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | ================= |
2 | RGW Multi-tenancy | |
3 | ================= | |
4 | ||
5 | .. versionadded:: Jewel | |
6 | ||
7 | The multi-tenancy feature allows to use buckets and users of the same | |
8 | name simultaneously by segregating them under so-called ``tenants``. | |
9 | This may be useful, for instance, to permit users of Swift API to | |
10 | create buckets with easily conflicting names such as "test" or "trove". | |
11 | ||
12 | From the Jewel release onward, each user and bucket lies under a tenant. | |
13 | For compatibility, a "legacy" tenant with an empty name is provided. | |
14 | Whenever a bucket is referred without an explicit tenant, an implicit | |
15 | tenant is used, taken from the user performing the operation. Since | |
16 | the pre-existing users are under the legacy tenant, they continue | |
17 | to create and access buckets as before. The layout of objects in RADOS | |
18 | is extended in a compatible way, ensuring a smooth upgrade to Jewel. | |
19 | ||
20 | Administering Users With Explicit Tenants | |
21 | ========================================= | |
22 | ||
23 | Tenants as such do not have any operations on them. They appear and | |
24 | and disappear as needed, when users are administered. In order to create, | |
25 | modify, and remove users with explicit tenants, either an additional | |
26 | option --tenant is supplied, or a syntax "<tenant>$<user>" is used | |
27 | in the parameters of the radosgw-admin command. | |
28 | ||
29 | Examples | |
30 | -------- | |
31 | ||
32 | Create a user testx$tester to be accessed with S3:: | |
33 | ||
34 | # radosgw-admin --tenant testx --uid tester --display-name "Test User" --access_key TESTER --secret test123 user create | |
35 | ||
36 | Create a user testx$tester to be accessed with Swift:: | |
37 | ||
38 | # radosgw-admin --tenant testx --uid tester --display-name "Test User" --subuser tester:test --key-type swift --access full user create | |
39 | # radosgw-admin --subuser 'testx$tester:test' --key-type swift --secret test123 | |
40 | ||
41 | Note that the subuser with explicit tenant had to be quoted in the shell. | |
42 | ||
43 | Accessing Buckets with Explicit Tenants | |
44 | ======================================= | |
45 | ||
46 | When a client application accesses buckets, it always operates with | |
47 | credentials of a particular user. As mentioned above, every user belongs | |
48 | to a tenant. Therefore, every operation has an implicit tenant in its | |
49 | context, to be used if no tenant is specified explicitly. Thus a complete | |
50 | compatibility is maintained with previous releases, as long as the | |
51 | referred buckets and referring user belong to the same tenant. | |
52 | In other words, anything unusual occurs when accessing another tenant's | |
53 | buckets *only*. | |
54 | ||
55 | Extensions employed to specify an explicit tenant differ according | |
56 | to the protocol and authentication system used. | |
57 | ||
58 | S3 | |
59 | -- | |
60 | ||
61 | In case of S3, a colon character is used to separate tenant and bucket. | |
62 | Thus a sample URL would be:: | |
63 | ||
64 | https://ep.host.dom/tenant:bucket | |
65 | ||
66 | Here's a simple Python sample: | |
67 | ||
68 | .. code-block:: python | |
69 | :linenos: | |
70 | ||
71 | from boto.s3.connection import S3Connection, OrdinaryCallingFormat | |
72 | c = S3Connection( | |
73 | aws_access_key_id="TESTER", | |
74 | aws_secret_access_key="test123", | |
75 | host="ep.host.dom", | |
76 | calling_format = OrdinaryCallingFormat()) | |
77 | bucket = c.get_bucket("test5b:testbucket") | |
78 | ||
79 | Note that it's not possible to supply an explicit tenant using | |
80 | a hostname. Hostnames cannot contain colons, or any other separators | |
81 | that are not already valid in bucket names. Using a period creates an | |
82 | ambiguous syntax. Therefore, the bucket-in-URL-path format has to be | |
83 | used. | |
84 | ||
85 | Swift with built-in authenticator | |
86 | --------------------------------- | |
87 | ||
88 | TBD -- not in test_multen.py yet | |
89 | ||
90 | Swift with Keystone | |
91 | ------------------- | |
92 | ||
93 | TBD -- don't forget to explain the function of | |
94 | rgw keystone implicit tenants = true | |
95 | in commit e9259486decab52a362443d3fd3dec33b0ec654f | |
96 | ||
97 | Notes and known issues | |
98 | ---------------------- | |
99 | ||
100 | Just to be clear, it is not possible to create buckets in other | |
101 | tenants at present. The owner of newly created bucket is extracted | |
102 | from authentication information. | |
103 | ||
104 | This document needs examples of administration of Keystone users. | |
105 | The keystone.rst may need to be updated. |