-
Notifications
You must be signed in to change notification settings - Fork 292
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
Generate kube config based on plugin RBAC #1020
Generate kube config based on plugin RBAC #1020
Conversation
You have successfully added a new Trivy configuration |
ctx := dispatch.ctx | ||
out, err := sourceClient.Stream(ctx, source.StreamInput{ | ||
Configs: dispatch.pluginConfigs, | ||
Context: source.StreamInputContext{ | ||
IsInteractivitySupported: dispatch.isInteractivitySupported, | ||
ClusterName: dispatch.cfg.Settings.ClusterName, | ||
KubeConfig: dispatch.cfg.Settings.Kubeconfig, |
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.
This might break existing functionality. We might as well remove kube config from config
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.
🤔 I think it would be great to keep the existing functionality of passing external kubeconfig. This functionality is great to connect to an external cluster. So Botkube can reside e.g. on cluster A, but it can listen for events + execute commands from cluster B.
Options I see:
- have
kubeconfig
as it were before, which overrides kubeconfig for all (sources, executors) and we ignorecontext.rbac
🤔 That would need to load the file from path, right? - load external
kubeconfig
as a base for generated kubeconfigs (with modifyingimpersonate
-related properties) - add
context.kubeconfig.path
property which takes custom kubeconfig as a path and injects it in a given plugin.
I'd prefer third option I think 🤔 Let's chat about this in our team.
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.
2 cents from my side: I like that option however, even Argo Workflow which is quite popular project, it doesn't support external/multi-cluster (they have issue opened for more that 2years now). If someone wants to have such functionality, they can always use https://github.com/virtual-kubelet/virtual-kubelet#providers. Of course, it brings additional maintenance cost, but it's also a more powerful and “safer” option.
Maybe at the end it just brings not necessary complexity to the Botkube itself? Probably it's a question to @brampling whether we should leave that functionality or not.
However, if we will decide to leave that functionality, it would be good to name it like context.remote.kubeconfig
? so it is easier to distinguish current cluster RBAC usage vs external one.
@josefkarasek could you please share an rbac config for channel based configuration? I am doing e2e test, I only managed to handle static one |
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.
Good work! Just a few comments/open questions.
} | ||
|
||
func generateGroupSubject(rbac config.GroupPolicySubject) (group []string) { | ||
switch rbac.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.
When exactly the channel name based group mapping will be supported? I know that it'll block the #945 task.
Description
Changes proposed in this pull request:
kubeConfig string
to executor contextTesting
Use executors:
Sources:
Self-host plugins
Install botkube with helm or make sure SA and CluterRole(s) and bindings exist.
ClusterRole
botkube-plugins-default
will be used for generating kube config for plugins.During testing add create/update/delete verbs to ClusterRole
botkube-plugins-default
.Related issue(s)
#934