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

Freeze the version of kubelet, kubectl and kubeadm #273

Merged
merged 1 commit into from
Apr 2, 2020

Conversation

Xenwar
Copy link
Member

@Xenwar Xenwar commented Mar 26, 2020

As we have it now, KUBERNETES_VERSION is fixed in time. However, the binaries (kubelet, kubeadm and kubectl), are always the latest and this causes a mismatch between the two.

The purpose of this PR is then making both freeze in time and prevent auto update/upgrade of both. This allows developers to keep using specific version, if they wish to do so.

In future works, we intend to use the metal3-dev-env for testing upgrade workflow, where the kuberenetes and binaries upgrade is done independently. To that end, we have added a new variable. KUBERNETES_BINARIES_VERSION which defaults to the value of KUBERNETES_VERSION

This PR makes the versions both of KUBERNETES_VERSION and KUBERNETES_BINARIES_VERSION set to 1.17.0 only for testing purpose.

Fixes #271

@Xenwar Xenwar changed the title Freeze the version of kubelet, kubectl and kubeadm [WIP]: Freeze the version of kubelet, kubectl and kubeadm Mar 26, 2020
@metal3-io-bot metal3-io-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2020
lib/common.sh Outdated
@@ -111,6 +111,7 @@ export DEFAULT_HOSTS_MEMORY=${DEFAULT_HOSTS_MEMORY:-8192}
export CLUSTER_NAME=${CLUSTER_NAME:-"test1"}
export CLUSTER_APIENDPOINT_IP=${CLUSTER_APIENDPOINT_IP:-"192.168.111.249"}
export KUBERNETES_VERSION=${KUBERNETES_VERSION:-"v1.18.0"}
export K3_BINARIES_VERSION=${K3_BINARIES_VERSION:-"1.18.0"}
Copy link
Member

Choose a reason for hiding this comment

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

why not to use KUBERNETES_VERSION variable ?

Copy link
Member Author

Choose a reason for hiding this comment

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

They are not in the same format. (v)
:-"v1.18.0"
:-"1.18.0"

Copy link
Member

@fmuyassarov fmuyassarov Mar 26, 2020

Choose a reason for hiding this comment

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

I see, but then you should change also K3_BINARIES_VERSION to be default('1.18.0', true) }}" in vm-setup/roles/v1aX_integration_test/vars/main.yml , no?

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 I have done so.
It is included in this commit

Copy link
Member

Choose a reason for hiding this comment

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

you could make KUBERNETES_VERSION to be 1.18.0 and then wherever used add the v in front, that would be better than creating this duplicated variable

Copy link
Member Author

Choose a reason for hiding this comment

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

ok. I will look into that.

@fmuyassarov
Copy link
Member

/test-integration

1 similar comment
@fmuyassarov
Copy link
Member

/test-integration

@Xenwar Xenwar force-pushed the freeze_kube-binaries branch 2 times, most recently from 3730c11 to d3b9281 Compare March 27, 2020 05:29
@Xenwar
Copy link
Member Author

Xenwar commented Mar 27, 2020

/test-integration

@Xenwar Xenwar changed the title [WIP]: Freeze the version of kubelet, kubectl and kubeadm Freeze the version of kubelet, kubectl and kubeadm Mar 27, 2020
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2020
@maelk
Copy link
Member

maelk commented Mar 27, 2020

why K3 btw ?

@maelk
Copy link
Member

maelk commented Mar 27, 2020

now you are missing the setting of the variable in the lib/common.sh. Kubernetes version is set there, we should have both at the same place. Also, if you add something into lib/common.sh, it should be considered whether that should be added in config_example.sh or not and on the try-it.md of the website

Copy link
Member Author

@Xenwar Xenwar left a comment

Choose a reason for hiding this comment

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

why K3 btw ?

It stands for the three binaries. kubeadm, kubectl and kubelet.
Also tried 3K, but it did not accept it.
And, I thought it would be too long to write KUBEADM_KUBELET_KUBECTL_VERSION

lib/common.sh Outdated
@@ -111,6 +111,7 @@ export DEFAULT_HOSTS_MEMORY=${DEFAULT_HOSTS_MEMORY:-8192}
export CLUSTER_NAME=${CLUSTER_NAME:-"test1"}
export CLUSTER_APIENDPOINT_IP=${CLUSTER_APIENDPOINT_IP:-"192.168.111.249"}
export KUBERNETES_VERSION=${KUBERNETES_VERSION:-"v1.18.0"}
export K3_BINARIES_VERSION=${K3_BINARIES_VERSION:-"1.18.0"}
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 I have done so.
It is included in this commit

lib/common.sh Outdated
@@ -111,6 +111,7 @@ export DEFAULT_HOSTS_MEMORY=${DEFAULT_HOSTS_MEMORY:-8192}
export CLUSTER_NAME=${CLUSTER_NAME:-"test1"}
export CLUSTER_APIENDPOINT_IP=${CLUSTER_APIENDPOINT_IP:-"192.168.111.249"}
export KUBERNETES_VERSION=${KUBERNETES_VERSION:-"v1.18.0"}
export K3_BINARIES_VERSION=${K3_BINARIES_VERSION:-"1.18.0"}
Copy link
Member Author

Choose a reason for hiding this comment

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

ok. I will look into that.

@Xenwar
Copy link
Member Author

Xenwar commented Mar 27, 2020

@maelk
Added the value in
lib/common.sh
config_example.sh (this may not be needed as the Kubernetes version is not there either)
try-it.html

Copy link
Member

@maelk maelk left a comment

Choose a reason for hiding this comment

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

lgtm, just a nit, it could still be KUBERNETES_BINARIES_VERSION, and could default to KUBERNETES_BINARIES_VERSION="${KUBERNETES_BINARIES_VERSION:-${KUBERNETES_VERSION#'v'}}" that will just remove the v from the K8S version

@maelk
Copy link
Member

maelk commented Mar 27, 2020

I think it is obvious that kubernetes binaries cover kubeadm kubectl and kubelet

@Xenwar
Copy link
Member Author

Xenwar commented Mar 27, 2020

I think it is obvious that kubernetes binaries cover kubeadm kubectl and kubelet

I agree. We can remove it. It is needed for upgrading automated tests. Even in that it is only test case.

@kashifest
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2020
@kashifest
Copy link
Member

/tesct-centos-integration

@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2020
@Xenwar
Copy link
Member Author

Xenwar commented Mar 27, 2020

lgtm, just a nit, it could still be KUBERNETES_BINARIES_VERSION, and could default to KUBERNETES_BINARIES_VERSION="${KUBERNETES_BINARIES_VERSION:-${KUBERNETES_VERSION#'v'}}" that will just remove the v from the K8S version

Changed accordingly.

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-centos-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-integration

Copy link
Member

@maelk maelk left a comment

Choose a reason for hiding this comment

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

ok for me, but I think we should rather go with K8S 1.18.0 now that the tests are passing

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

ok for me, but I think we should rather go with K8S 1.18.0 now that the tests are passing

Thanks.
I agree. Forgot changing it as described in the description.

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-centos-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

please do wait for test result with 1.18.0 (current code) before giving lgtm or approval

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-centos-integration

@Xenwar Xenwar changed the title [WIP]Freeze the version of kubelet, kubectl and kubeadm Freeze the version of kubelet, kubectl and kubeadm Apr 1, 2020
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 1, 2020
@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-centos-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 1, 2020

/test-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 2, 2020

The test with v1.18.0 is failing due to missing files, unlike previous releases.
An issue is created in kuberentes, kubernetes/kubernetes#89757.

I suggest we hold this until the issue is resolved.

Fixes metal3-io#271

Signed-off-by: Anwar Hassen <anwar.hassen@est.tech>
@Xenwar
Copy link
Member Author

Xenwar commented Apr 2, 2020

/test-centos-integration

@Xenwar
Copy link
Member Author

Xenwar commented Apr 2, 2020

/test-integration

Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2020
@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maelk, Xenwar

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2020
@metal3-io-bot metal3-io-bot merged commit 8b7bedb into metal3-io:master Apr 2, 2020
@Xenwar Xenwar deleted the freeze_kube-binaries branch October 22, 2020 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Freeze kubeadm, kubelet and kubectl version
5 participants