Skip to content

Commit

Permalink
chores: update readme (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: 佑祎 <zzw261520@alibaba-inc.com>
  • Loading branch information
zwzhang0107 committed Jun 20, 2023
1 parent ed5f032 commit 3f18595
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 20 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ Koordinator extends `github.com/hortonworks/gohadoop` by implementing resource m
Set HADOOP_CONF_DIR environment variable, and ensure the conf directory contains both *-default.xml and *-site.xml files.
rm_update_node_resource.go is an example go YARN rpc client of rm-admin: call update node resource to do the updates.

# Run rm_update_node_resource
change the `host` and `port` to target node id
$ HADOOP_CONF_DIR=conf go run pkg/yarn/client/examples/rm_update_node_resource.go
# Run rm_update_node_resource example
Change the `host` and `port` to target node id.

Execute command:

```shell script
$ HADOOP_CONF_DIR=conf go run pkg/yarn/client/examples/rm_update_node_resource.go
```

# Run yarn-operator
Install `koordinator` according to [doc](https://koordinator.sh/docs/installation/).

Add annotation to node with YARN node ID
```shell script
kubectl annotate node --overwrite ${k8s.node.name} node.yarn.koordinator.sh=${yarn.node.id}
```

Change the `yarn.resourcemanager.admin.address` in config/manager/configmap.yaml

Execute command:
```shell script
$ kubectl apply -f config/manager/
```
73 changes: 56 additions & 17 deletions config/manager/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,60 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
name: koord-yarn-operator
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
- create
- update
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: koordinator-system
name: koord-yarn-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: koord-yarn-operator-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: koord-yarn-operator
subjects:
- kind: ServiceAccount
name: koord-yarn-operator
namespace: koordinator-system
2 changes: 2 additions & 0 deletions pkg/controller/noderesource/resource_sync_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ func (r *YARNResourceSyncReconciler) Reconcile(ctx context.Context, req reconcil
klog.Warningf("update batch resource to yarn node %v:%v failed, error %v", yarnNodeName, yarnNodePort, err)
return ctrl.Result{Requeue: true}, err
}
klog.V(4).Infof("update batch resource to yarn node %v:%v finish, cpu-core %v, memory-mb %v",
yarnNodeName, yarnNodePort, batchCPU.ScaledValue(resource.Kilo), batchMemory.ScaledValue(resource.Mega))
return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 3f18595

Please sign in to comment.