You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by ww...@apache.org on 2021/05/11 22:22:53 UTC

[incubator-yunikorn-site] branch master updated: [YUNIKORN-651] Add document to explain how to define user identity (#52)

This is an automated email from the ASF dual-hosted git repository.

wwei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-yunikorn-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 10e21cf  [YUNIKORN-651] Add document to explain how to define user identity (#52)
10e21cf is described below

commit 10e21cfd2ce69511baf6a32c1d8ce1b6381785f8
Author: Amit Sharma <60...@users.noreply.github.com>
AuthorDate: Tue May 11 15:22:48 2021 -0700

    [YUNIKORN-651] Add document to explain how to define user identity (#52)
---
 docs/user_guide/queue_config.md         |  7 +---
 docs/user_guide/usergroup_resolution.md | 68 +++++++++++++++++++++++++++++++++
 sidebars.js                             |  1 +
 3 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/docs/user_guide/queue_config.md b/docs/user_guide/queue_config.md
index fb3e4b8..a3a931f 100644
--- a/docs/user_guide/queue_config.md
+++ b/docs/user_guide/queue_config.md
@@ -25,15 +25,12 @@ under the License.
 The basis for the queue configuration is given in the [configuration design document](design/scheduler_configuration.md).
 
 This document provides the generic queue configuration.
-It references both the [Access control lists](user_guide/acls.md) and [placement rule](user_guide/placement_rules.md) documentation.
+It references both the [Access Control Lists](user_guide/acls.md) and [Placement rules](user_guide/placement_rules.md) documentation.
 
 This document explains how to create the partition and queue configuration for the scheduler with examples.
 
 The scheduler relies on the shim to reliably provide user information as part of the application submission.
-In the current shim there is no reliable way to identify the user and the groups the user belongs to.
-The user and group information provided by the shim is incomplete in the best case.
-This shim limitation impacts the behaviour of user based limits and access control in the scheduler.
-The current implementation only provides the framework in the scheduler and will not be fully functional until the shim changes are added. 
+The current shim identifies the user and the groups the user belongs to using the methodology provided in [User & Group Resolution](usergroup_resolution) 
 
 ## Configuration
 The configuration file for the scheduler that is described here only provides the configuration for the partitions and queues.
diff --git a/docs/user_guide/usergroup_resolution.md b/docs/user_guide/usergroup_resolution.md
new file mode 100644
index 0000000..0816a20
--- /dev/null
+++ b/docs/user_guide/usergroup_resolution.md
@@ -0,0 +1,68 @@
+---
+id: usergroup_resolution
+title: User & Group Resolution
+---
+
+<!--
+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.
+-->
+
+## User resolution
+
+User information is an important aspect of the scheduling cycle. It is one of the key identifier that can be used to determine the queue to which a job should be submitted. The Yunikorn Scheduler relies on the K8s Shim to provide user information. In the world of Kubernetes, there is no object defined that identfies the actual user. This is by design and more information can be found [here](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#users-in-kubernetes)
+
+Since, Kubernetes has no pre-defined field or resource for user information and individual cluster deployments with unique user identification tools can vary, we have defined a standard way of identifying the user. Yunikorn requires a Kubernetes [Label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) added. Using the [recommendation](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/) provided here, the default label is defined as below:
+
+| Label                                          | Value |
+|----------------------------------------------- |---------------------	|
+| yunikorn.apache.org/username 	                 | User name. It can have duplicate entries but only the first value will be used. The default user is `nobody` |
+
+Example:
+```yaml
+metadata:
+  labels:
+    yunikorn.apache.org/username: "john"
+```
+:::tip 
+In order to make this field uniquiely identifiable to the authorized user, the suggestion is to add this label as an immutable field by the user identification tool used by the cluster administrators. The cluster administrators or users are free to use any method or tool to add this field and value. This includes adding it manually at the time of submission. 
+:::
+
+:::note Assumption 
+Assumption:
+  Yunikorn assumes that all pods belonging to an application are owned by the same user. We recommend that the user label is added to every pod of an app. This is to ensure that there is no discrepency. 
+:::
+
+The `yunikorn.apache.org/username` key can be customized by overriding the default value using the `USER_LABEL_KEY`env variable to the [K8s](https://github.com/apache/incubator-yunikorn-release/blob/master/helm-charts/yunikorn/templates/deployment.yaml). This is particularly useful in scenarios where the user label is already being added or if the label has to be modified for some secuirty reasons. 
+
+```yaml          
+            env:
+            - name: USER_LABEL_KEY
+              value: "custom_user_label"
+```
+
+## Group resolution
+
+Group membership resolution is pluggables and is defined here. Groups do not have to be part of provided user and group object. When the object is added to the cache the groups are automatically resolved based on the resolution that is configured.
+The resolver which is linked to the cache can be set per partition.
+
+The default group resolver is "no resolver".
+This resolver just echos the user name and a primary group with the same name as the user.
+
+Other resolvers are:
+* OS resolver
+* test resolver
diff --git a/sidebars.js b/sidebars.js
index 51832cb..8e9e279 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -23,6 +23,7 @@ module.exports = {
         'User Guide': [
             'user_guide/queue_config',
             'user_guide/placement_rules',
+            'user_guide/usergroup_resolution',            
             'user_guide/sorting_policies',
             'user_guide/acls',
             'user_guide/resource_quota_management',