-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Calico v3 upgrade #5102
Calico v3 upgrade #5102
Conversation
/assign @geojaz |
/assign @blakebarnett @caseydavenport We may need to hold this till we get etc2 -> etcd3 upgrade working. @blakebarnett thoughts? |
As long as it only applies if the cluster is already running etcd3 it should be fine, might make it confusing for those still on etcd2 but, 1.10 is supposed to support upgrading right? |
docs/networking.md
Outdated
``` | ||
|
||
You will need to change that block, and add an additional field, to look like this: | ||
|
||
``` | ||
networking: | ||
calico: | ||
apiVersion: v3 |
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.
should this just be majorVersion
?
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.
Couldn't Calico release a version v4.x and still be on the same api version and then it would be mis-named if we upgrade the manifests in Kops? Or it could be preferable to make that upgrade require an explicit change.
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.
Let's leave it as is. If anything calicoAPIVersion
might be less ambiguous, if you're up for making that change.
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.
Looking at this now, it might be best represented as majorVersion
? @tmjd
/ok-to-test |
@tmjd this LGTM, though I'd suggest using the recently released Calico v3.1.3. /lgtm |
/assign @geojaz |
@tmjd Do you plan also upgrade canal version ? |
@maver1ck I didn't have any concrete plans though might get to it eventually. I believe the upgrade for Canal should be easier than Calico because the Canal installation uses kubernetes as the data store (instead of etcd) and that upgrade is much easier. I'd be happy to review a PR for Canal if one is submitted. |
I think really solid etcd upgrades are going to be in 1.11, so moving this to 1.11 |
45df9d3
to
9f7590c
Compare
/test pull-kops-e2e-kubernetes-aws |
/lgtm |
9f7590c
to
55c469d
Compare
55c469d
to
79940f6
Compare
/lgtm |
@geojaz could you PTAL? I'd very much like to get this merged. |
Also @justinsb |
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.
/lgtm
thanks to those who helped push this to completion @tmjd and @caseydavenport
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caseydavenport, geojaz, tmjd The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We are currently running Kubernetes 1.10 using etcd2 and Calico 2.6.8 in production, and are looking to upgrade to etcd3 when we switch over to Kubernetes 1.11 since kops1.11 has been released. @caseydavenport , @tmjd How do we do the calico-upgrade data migration if we no longer have an etcd2 cluster to rely on, but the schema has not been converted from v1 to v3 yet? calico-upgrade does not seem to allow you to specify an etcd3 cluster with the v1 apiVersion as source. Is running a temporary etcd2 cluster using a backup the only way we can achieve this? The steps we're trying to do as part of our upgrade:
Your expertise and advice is highly appreciated. Thank you! |
@sstarcher glad I'm not the only one with this problem. The way I came up with is to download a backup that etcd-manager has made of etcd2 cluster prior to upgrade, and running my own local etcd cluster:
let's see if I can get calico-upgrade to run now. |
seems to work with my local etcd2 cluster:
then I had to empty etcd3's cluster of old calico keys:
|
@ottoyiu awesome, I was getting ready to start this process also, thanks for posting your work. Would this conversion be best to run on etcd2 before upgrading to etcd3 then or would the changes that happen in the meantime throw it off too much? I worry about doing it on a busy production cluster like this... |
@blakebarnett let me know what you end up doing. I might need to spend some time trying to find out what's the least disruptive way to upgrade from calico v2, etcdv3 to calico v3. |
I don't know what the kops etcdv2 to etcdv3 conversion does specifically. Does it retain the etcd data that existed in etcdv2? If you didn't know the etcd server v3 supports both the v2 and v3 etcd API, the data and users are completely separate. So it could be possible that the Calico data that was in the etcd v2 server still exists and after doing the kops upgrade (which updates the etcd server from v2 to v3) it is just necessary to go through the process described in the docs https://github.com/kubernetes/kops/blob/master/docs/calico-v3.md#upgrading-an-existing-cluster. @ottoyiu you said
I guess perhaps it is not obvious from the docs but an etcd v3 server can be configured as the v1 apiVersion source, like what is described at https://docs.projectcalico.org/v3.1/getting-started/kubernetes/upgrade/setup#configuring-calico-upgrade-to-connect-to-the-etcdv2-datastore. The datastoreType of etcdv2 is actually the etcd API version so will work for an etcd v3 server (assuming the v2 api hasn't been disabled). |
@tmjd it's good to know that datastoreType is merely the API version of etcd; I will try running the migration on an etcd3 cluster with compatibility mode enable and will report back. |
Addresses #5101
I have been able to install with Kops 1.9.0 and then using my changes here am able to upgrade to Calico v3.
Note: This PR is currently using unreleased changes from calico/upgrade that exist as projectcalico/calico-upgrade#35, before this PR is merged I expect a release to be made based on those changes and then the images named tmjd/calico-upgrade to be replaced.
TODO: