smengcl commented on a change in pull request #3095: URL: https://github.com/apache/ozone/pull/3095#discussion_r814022012
########## File path: hadoop-hdds/docs/content/interface/Tenant.md ########## @@ -0,0 +1,294 @@ +--- +title: "Multi-Tenant commands" +weight: 1 +menu: + main: + parent: "Client Interfaces" +summary: Ozone subcommands for tenant management +--- +<!--- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +For a higher level understanding of multi-tenancy architecture, see [Multi-Tenancy feature]({{< ref "feature/Multi-Tenancy.md" >}}). + +All Multi-Tenancy subcommands are located under CLI `ozone tenant`. + +The commands below assume a Kerberized Ozone cluster with Ranger install. Enabling HTTPS on S3 Gateway is optional but recommended. + +## Quick Start + +### Setup + +Follow the [Multi-Tenancy Setup]({{< ref "feature/Multi-Tenancy-Setup.md" >}}) guide if you haven't done so. + +If the OzoneManagers are running in HA, append `--om-service-id=` accordingly to the commands. + +### Create a tenant + +Create a new tenant in the current Ozone cluster. +This operation requires Ozone cluster administrator privilege. + +Creating a tenant creates a volume of the exact same name. Volume name restrictions apply. + +```shell +ozone tenant create <TENANT_NAME> +``` + +Example: + +```shell +bash-4.2$ kinit -kt /etc/security/keytabs/om.keytab om/[email protected] +bash-4.2$ ozone tenant create tenantone +2022-02-16 00:00:00,000 [main] INFO rpc.RpcClient: Creating Tenant: 'tenantone', with new volume: 'tenantone' +Created tenant 'tenantone'. +``` + + +### List tenants + +List all tenants in an Ozone cluster. + +```shell +ozone tenant list +``` + +Example: + +```shell +bash-4.2$ ozone tenant list +tenantone +``` + + +### Assign a user to a tenant + +The first user in a tenant must be assigned by an Ozone cluster administrator. + +By default when user `testuser` is assigned to tenant `tenantone`, the generated Access ID for the user in this tenant is `tenantone$testuser`. + +- Be sure to enclose the Access ID in single quotes in Bash when using it so it doesn't get auto-translated into environment variables. + +It is possible to assign a user to multiple tenants. + +```shell +ozone tenant user assign <USER_NAME> --tenant=<TENANT_NAME> Review comment: Good idea. Just note that `<USER_NAME>` actually should typically be the primary (short user name in this case) of the Kerberos principal, rather than the full Kerberos principal. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
