-
Notifications
You must be signed in to change notification settings - Fork 23
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
RFC: selector plugin #17
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: YangKeao <keao.yang@yahoo.com>
|
||
type Selector interface { | ||
Validate(selector RawSelector) field.ErrorList | ||
Default(root map[string]interface{}, selector RawSelector) RawSelector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is root map[string]interface{}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root is the whole object. For example, setting default value for the pid selector namespaces need the namespace of root🤦♂️
|
||
1. Call related selectors to list all selected resources. | ||
2. Call scope limitation to randomly choose some of them. | ||
3. Iterate through the selected resources and call the implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Iterate through the selected resources and call the implementation.
Maybe we could do that in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
|
||
Besides the network communication, chaos-mesh should also provide a way to | ||
communicate through local unix socket, to avoid uneccessary network overhead. | ||
For example, the plugin can be registered with a path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this for? I think it is impossible for an external plugin to using unix domain socket: I imagine that the external plugin runs as one pod that you do not know which node will be scheduled on, if the pod of "external plugin" and the pod "controller-manager" run on different node, there is no way to use unix domain socket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I plan to setup some "official plugin" like pod selector to use unix socket. They use the same SDK with others (but run in the same binary or container or pod with the controller).
The users can also add extra container and volume for the controller to deploy the selector plugin, for performance.
Signed-off-by: YangKeao <keao.yang@yahoo.com>
... | ||
``` | ||
|
||
And then, the controller could establish a `grpc` connection to the service and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the service used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement service for every selector type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The users should setup a service for it. Just like the webhook
in Kubernetes. We need to setup a service for controller-manager, and create a WebhookConfiguration
points to the service.
Signed-off-by: YangKeao keao.yang@yahoo.com