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