-
Notifications
You must be signed in to change notification settings - Fork 225
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
Pluggable discovery #146
base: master
Are you sure you want to change the base?
Pluggable discovery #146
Conversation
Add a simple plugin based discovery stragegy Add implmentation for k8s REST API based discovery
@mrbcm thanks for your pull request, I'll review it soon! |
@mehrdadrad Any update on this PR? We have more commits to follow this regarding DNS based discovery in k8s. Wanted to get initial pluggable discovery mechanism in so as not to have a huge PR. |
Thank you for the PR and sorry for the delay. |
Thank you for the review and comments. I agree with you that client-go client library is probably better and was in fact my first implementation. But I did not want to make a general dependency for a k8s only deployment. So I went with a simpler rest client dependency. This does add additional deps, but a rest client can be used in other use-cases to extend vflow as well. (ex: download whitelist/blacklist maybe?). If you feel that go client is still better, I can update this PR. As for having a simpler discovery config, I do see additional discovery modes in k8s, 1) using DNS based discovery. This relies on a k8s feature where dns query for a headless service resolves to set of IP addresses of the pods. This mode may be useful in scenarios where required RBAC permissions are not granted. 2) Custom discovery protocols. Please let me know what you think and thanks. |
Once we use k8s client-go then the binary size goes up significantly. |
Fixes issue #144
Currently memcache_rpc.go is tightly coupled with multicast discovery. This commit decouples RPC and discovery and provides a simple pluggable implementation for discovery.
---- discovery.conf ----
k8s-service-name: vflow-dev
k8s-discovery-poll-interval: 10
----- k8s RBAC.yaml ----
kind: ClusterRole
metadata:
name: vflow-cluster-role
rules:
resources:
verbs:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: vflow-cluster-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vflow-cluster-role
subjects:
name: flowsvcacct-2
namespace: default