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

auto migrate scripts and snippets #35

Merged
merged 1 commit into from
May 3, 2018

Conversation

tmjd
Copy link
Member

@tmjd tmjd commented Apr 26, 2018

New migration automation

  • Add new commands to calico-upgrade
  • Add new scripts for automating upgrade
  • Add manifest snippets for automating upgrade
  • Add temporary manifest generation template

The following are provided for that purpose:
* `UPGRADE_OPTIONS` can be used to to pass log level to the commands.
* `UPGRADE_ARGS` could be used to to pass apiconfig if config files are
available instead of enviornment variables.
Copy link

Choose a reason for hiding this comment

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

nit: environment

# calico/kube-controller initContainer

This container will be responsible for checking if the datastore needs to be
migrated and block startup until the migration is finished.
Copy link

Choose a reason for hiding this comment

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

It seems just from reading the description that this container does everything the Node Daemonset initContainer does except for starting the migration itself. Is there a reason we need this?

Copy link

Choose a reason for hiding this comment

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

nvm, reading the rest of this, I see it is for the different components we have.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was a good thought. I've changed it a bit though and should have changes pushed soon, and it diverges a bit more. What was there before worked but I think what I have now better matches the intended behavior.

>1 There was a problem checking if migration is needed.

Description:
TBD.... blah blah
Copy link

Choose a reason for hiding this comment

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

Hahaha

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooops 😀, I'll fix that

#!/bin/sh

# This script checks if upgrade is needed and returns 0 if no upgrade
# is needed. If upgrade is needed then check if it is in progress and
Copy link

@mgleung mgleung Apr 30, 2018

Choose a reason for hiding this comment

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

This script no longer checks if there is an upgrade in progress. We either need to remove this in the comments or add the checks for progress to make it consistent. I think it might be better to check if it is in progress since otherwise this will just keep polling if an upgrade is needed even if it wasn't started.

done

if [ $needed -eq 1 ]; then
echo "No data migration is needed. Continuing on."
Copy link

Choose a reason for hiding this comment

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

The comment at the top says that if $needed is 0, then no upgrade is needed. I think it conflicts with the handling in this check?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think maybe I worded that poorly. Maybe it would be clearer phrased this way. This script checks if upgrade is needed and if no upgrade is needed then returns 0.
WDYT?

Copy link

@mgleung mgleung Apr 30, 2018

Choose a reason for hiding this comment

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

Oh yea, I think I got the variable $needed and the return value mixed up. Ignore my confusion.

Copy link

@mgleung mgleung left a comment

Choose a reason for hiding this comment

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

LGTM, should just need to change the libcalico-go revision once those changes are merged.

- Add new commands to calico-upgrade
- Add new scripts for automating upgrade
- Add manifest snippets for automating upgrade
- Add temporary manifest generation template
- Glide update
- Add RBAC for completion job
@tmjd tmjd force-pushed the wip-auto-migrate branch from 8353de2 to 7db2da6 Compare May 1, 2018 21:48
Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

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

Just a skim but LGTM.

@tmjd tmjd changed the title [WIP] auto migrate auto migrate scripts and snippets May 3, 2018
@tmjd tmjd merged commit 2f990b5 into projectcalico:master May 3, 2018
@tmjd tmjd mentioned this pull request May 3, 2018
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants