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

Improve migrate flow #1198

Merged
merged 8 commits into from
Aug 22, 2023
Merged

Conversation

josefkarasek
Copy link

@josefkarasek josefkarasek commented Aug 17, 2023

Description

Changes proposed in this pull request:

  • allow migration when k8s-default-tools are disabled/not bound
  • use install internal command to perform Botkube installation
  • use kubex.LoadRestConfigWithMetaInformation() and register --kubeconfig flag, to get OOTB experience with finding current k8s context
  • print cluster context name to tell the user against which cluster migration is executed
  • generate unique configurationName
  • Botkube CLI help specifies that botkube install is used for both installation and upgrading an existing Botkube instance.

Testing

Create Botkube instance in your local env
Login and migrate

helm upgrade botkube --install --version v1.2.0 --namespace botkube --create-namespace --wait   --set communications.default-group.socketSlack.enabled=true   --set communications.default-group.socketSlack.channels.default.name=${SLACK_CHANNEL_NAME}   --set communications.default-group.socketSlack.appToken=${SLACK_API_APP_TOKEN}   --set communications.default-group.socketSlack.botToken=${SLACK_API_BOT_TOKEN}   --set executors.k8s-default-tools.botkube/kubectl.enabled=true   --set settings.clusterName=${CLUSTER_NAME}   --set settings.log.level=debug   --set analytics.disable=true   botkube/botkube

go run cmd/cli/main.go login --cloud-dashboard-url=http://localhost:3000
go run cmd/cli/main.go migrate -w --cloud-api-url=http://localhost:8080/graphql --cloud-dashboard-url=http://localhost:3000

For testing that Actions can be migrated even when a bound plugin is not defined - rename a plugin in one of the pre-defined actions and migrate. The Action should be omitted and not included in the migration.

Related issue(s)

#1172

@josefkarasek josefkarasek marked this pull request as ready for review August 18, 2023 09:46
@josefkarasek josefkarasek requested review from PrasadG193 and a team as code owners August 18, 2023 09:46
@@ -77,7 +76,7 @@ func (c *Helm) Install(ctx context.Context, status *printer.StatusPrinter, opts
}

if !upgrade {
return nil, errors.New("upgrade aborted")
return nil, nil

This comment was marked as outdated.

@josefkarasek josefkarasek marked this pull request as draft August 21, 2023 06:27
@josefkarasek josefkarasek marked this pull request as ready for review August 21, 2023 08:12
Copy link
Contributor

@huseyinbabal huseyinbabal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM 🚀

@huseyinbabal
Copy link
Contributor

@josefkarasek I saw only one glitch about flow, even we use -w flag in migrate command, it does not wait for botkube become ready. For example it says, botkube upgraded successfully, but actually it is still in Terminating state, and becomes available afterwards, just FYI...

@josefkarasek
Copy link
Author

@josefkarasek I saw only one glitch about flow, even we use -w flag in migrate command, it does not wait for botkube become ready. For example it says, botkube upgraded successfully, but actually it is still in Terminating state, and becomes available afterwards, just FYI...

I could not reproduce this. With Huseyin we agreed we'll monitor this in the immediate future.

@josefkarasek josefkarasek merged commit 9d06277 into kubeshop:main Aug 22, 2023
13 checks passed
@mszostok mszostok added the enhancement New feature or request label Sep 8, 2023
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

Successfully merging this pull request may close these issues.

3 participants