-
Notifications
You must be signed in to change notification settings - Fork 431
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
Fix kubernetes version for node startup script #162
Fix kubernetes version for node startup script #162
Conversation
Welcome @tahsinrahman! |
Hi @tahsinrahman. Thanks for your PR. I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
67e8c9c
to
f880e43
Compare
@tahsinrahman Thank you for your first PR. We do have two versions ControlPlane and Kubelet versions, ContolPlane kubernetes version controls controlplane components such as apiserver, scheduler, etc. Kubelet is self explanatory. Kubeadm doesnt like when control plane and kubelet versions are different so the PR makes sense, at same time, we may need this flexibility in future during upgrades. Can you please redo the PR to pass in both controlplane and kubelet versions and use them accordingly ControlPlane kubernetes version is used in kubeadm config, while kubelet version will be used during apt-get install. |
@@ -72,7 +73,7 @@ func GetVMStartupScript(machine *actuators.MachineScope, bootstrapToken string) | |||
SaKey: string(machine.Scope.ClusterConfig.SAKeyPair.Key), | |||
BootstrapToken: bootstrapToken, | |||
LBAddress: dnsName, | |||
KubernetesVersion: machine.Machine.Spec.Versions.ControlPlane, | |||
KubernetesVersion: strings.TrimPrefix(machine.Machine.Spec.Versions.ControlPlane, "v"), |
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.
A separate function would be nice here, TrimKubernetesVersion()
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.
@tahsinrahman -- Thanks for submitting a PR. :)
A little contrary to @awesomenix's review, I can't see an instance where we'd want to purposely introduce the potential for skew between the control plane components and the kubelet.
I can see the value in making it easier to swap the kubernetes versions, instead of having it hardcoded.
Could you instead:
- Add
export KUBERNETES_VERSION="${KUBERNETES_VERSION:-1.13.5}"
in the generator script under "Machine settings":# Machine settings. - Replace the hardcoded component versions in machines.yaml.template with the new variable (
${KUBERNETES_VERSION}
):cluster-api-provider-azure/cmd/clusterctl/examples/azure/machines.yaml.template
Lines 13 to 14 in 1713947
kubelet: 1.13.5 controlPlane: 1.13.5 kubelet: 1.13.5
During Upgrades, in this guide https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/
If above workflow needs to be automated, then you need controlplane and kubelet versions to be passed into the vm startup scripts or upgrade scripts. This may not be the only scenario, customers may want separate machinesets to have different versions for testing, but that would be a kubelet version. Having separate versions for controlplane and kubelet is useful, but has no meaning during bootstrap process, since kubeadm doesnt like the skew |
Right. In the context of this project, we're only handling cluster reconciliation and machine instantiation i.e., once the bootstrap process for an Azure virtual machine happens, it doesn't happen again. Which means, for our case, skew between the components is not desired. If we can think of alternative use cases (outside of upgrade) where version skew might be appropriate, I could be open to exploring, but overall, it doesn't seem like a good direction to move in. |
f880e43
to
bb7f772
Compare
bb7f772
to
c27f230
Compare
I've updated the pr, can you check? @justaugustus @awesomenix |
Thanks for updating this, @tahsinrahman! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus, tahsinrahman 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 |
@tahsinrahman -- can you make sure your change is gofmt-ed?
|
/lgtm |
What this PR does / why we need it:
Currently, kubernetes version for node startupscript is taken from
machine.Machine.Spec.Versions.ControlPlane
, but it should be frommachine.Machine.Spec.Versions.Kubelet
Also, if kubernetes version is given with prefix
v
(e.gv1.13.4
), it removes the prefixv