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

kubctl rollout restart deployment/xyz functionality #407

Closed
juneeighteen opened this issue Oct 7, 2020 · 2 comments
Closed

kubctl rollout restart deployment/xyz functionality #407

juneeighteen opened this issue Oct 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@juneeighteen
Copy link

Is your feature request related to a problem? Please describe.
The one missing feature in botkube for me is the ability to have users run @BotKube rollout restart deployment/staging-app

Describe the solution you'd like
I cannot get BotKube to support the rollout kubectl verb. I've tried adding it, but it keeps telling me "Command is not supported"

Describe alternatives you've considered
Not sure how to work around this.

Additional context
@botkube rollout restart deployments/staging-app
Command not supported. Please run /botkubehelp to see supported commands.

@juneeighteen juneeighteen added the enhancement New feature or request label Oct 7, 2020
@PrasadG193
Copy link
Collaborator

@juneeighteen Could you please share kubectl command config you added to allow this command. For every command BotKube maps it to @BotKube [verb] [resource] ..... format and checks if verb and resource exists in the configuration. You can try with adding rollout in the verb and restart in the resource. Also, keep in mind to update botkube-clusterrole to give permission to BotKube SA to execute this command

@juneeighteen
Copy link
Author

Thanks @PrasadG193 !!

We can now send the Slack command "BotKube rollout restart deployments/appName". 🥳

This is what I ended up with and it's working!

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: botkube-clusterrole
  labels:
    app: botkube
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["get", "watch", "list", "rollout"]
  - apiGroups: [""]
    verbs: ["delete"]
    resources: ["pods"]
  - apiGroups: [""]
    resources: ["deployments"]
    verbs: ["get", "list", "watch", "create", "update", "patch"]
  - apiGroups: ["apps"]
    resources: ["deployments/scale", "deployments"]
    verbs: ["get", "patch"]

ConfigMap:

commands:
          verbs: ["api-resources", "delete", "api-versions", "cluster-info", "describe", "diff", "explain", "get", "logs", "top", "rollout", "scale"]
          resources: ["deployments", "pods", "nodes", "restart"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants