[ 
https://issues.apache.org/jira/browse/YUNIKORN-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17682531#comment-17682531
 ] 

Qi Zhu commented on YUNIKORN-1549:
----------------------------------

Updated the PR for shim and core:

Shim side:

Added a new config in shim side, which will pass in the ExtraConfig 
map[string]string:

"service.instanceTypeNodeLabelKey" 

Core side:
{code:java}
// Get InstanceType of this node.
// This is a lock free call because all attributes are considered read only
func (sn *Node) GetInstanceType() (string, error) {
   instanceTypeNodeLabelKey := 
configs.GetConfigMap()[configs.InstanceTypeNodeLabelKey]
   nodeLabels := sn.attributes["si.io/nodelabels"]
   nodeLabelsMap := make(map[string]string, 0)
   if err := json.Unmarshal([]byte(nodeLabels), &nodeLabelsMap); err != nil {
      return "", err
   }
   return nodeLabelsMap[instanceTypeNodeLabelKey], nil
} {code}

> Introduce a config to specify what attribute to use as instance type
> --------------------------------------------------------------------
>
>                 Key: YUNIKORN-1549
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1549
>             Project: Apache YuniKorn
>          Issue Type: Improvement
>          Components: core - common
>            Reporter: Yongjun Zhang
>            Assignee: Qi Zhu
>            Priority: Major
>              Labels: config, pull-request-available
>
> To make it flexible, we can introduce a yunikorn config 
> instance-type-node-label-key: <node-label-key>
>               And default the value  to k8s’ default 
> "node.kubernetes.io/instance-type",
> so by default we take instance type from the following attribute:
> “node.kubernetes.io/instance-type=<instance-type>”
> and users can redefine this based on their own environment.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to