Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chores: update readme #9

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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