-
Notifications
You must be signed in to change notification settings - Fork 20
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
Control which kubernetes nodes chaincode runs on #228
Comments
Very nice upgrade! |
Also we have to consider that NOT all CC run on the same nodes , |
I think adding a new For example, in the simple case with the node role set to "chaincode" the following affinity and toleration would be added: affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "fabric-builder-k8s-role"
operator: In
values:
- "chaincode"
tolerations:
- key: "fabric-builder-k8s-role"
operator: "Equal"
value: "chaincode"
effect: "NoSchedule" Nodes with the matching label and taint should then be dedicated to running chaincode. For example: kubectl label nodes node1 fabric-builder-k8s-role=chaincode
kubectl taint nodes node1 fabric-builder-k8s-role=chaincode:NoSchedule To handle the case where you want different nodes running different chaincode, different node roles could be configured. For example, "org1cc", "org2cc", etc. Does that sound ok? |
See hyperledger-labs#228 Signed-off-by: James Taylor <[email protected]>
See hyperledger-labs#228 Signed-off-by: James Taylor <[email protected]>
See hyperledger-labs#228 Signed-off-by: James Taylor <[email protected]>
See hyperledger-labs#228 Signed-off-by: James Taylor <[email protected]>
It may be desirable to control which kubernetes nodes chaincode runs on. For example, to use a pool of nodes specifically for running chaincode on, or to run the chaincode on the same node as the peer.
Covering all possible use cases is outside the scope of the k8s builder and should be handled with a Dynamic Admission Control using a Mutating Webhook. For example, it looks like the namespace-node-affinity webhook could be used to assign node affinity and tolerations to all pods in the
FABRIC_K8S_BUILDER_NAMESPACE
namespace.Developing and deploying a webhook is not trivial though, so optionally adding basic affinity and toleration to chaincode pods may be useful for simple deployments. For example,
Chaincode nodes would then need a corresponding label and taint. For example,
The text was updated successfully, but these errors were encountered: