geerlingguy / ansible-role-kubernetes

Ansible Role - Kubernetes
https://galaxy.ansible.com/geerlingguy/kubernetes/
MIT License
554 stars 268 forks source link

Upgrade to new kubernetes versions #123

Open Rahulsharma0810 opened 2 years ago

Rahulsharma0810 commented 2 years ago

Is there a way to upgrade the Kubernetes version through this role. Actually I am stuck with older version of Kubernetes v1.20.15 and not able to upgrade to the kubernetes version now.

❯ sudo kubeadm upgrade plan

[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[upgrade/config] In order to upgrade, a ConfigMap called "kubeadm-config" in the kube-system namespace must exist.
[upgrade/config] Without this information, 'kubeadm upgrade' won't know how to configure your upgraded cluster.

[upgrade/config] Next steps:
        - OPTION 1: Run 'kubeadm config upload from-flags' and specify the same CLI arguments you passed to 'kubeadm init' when you created your control-plane.
        - OPTION 2: Run 'kubeadm config upload from-file' and specify the same config file you passed to 'kubeadm init' when you created your control-plane.
        - OPTION 3: Pass a config file to 'kubeadm upgrade' using the --config flag.

[upgrade/config] FATAL: the ConfigMap "kubeadm-config" in the kube-system namespace used for getting configuration information was not found
To see the stack trace of this error execute with --v=5 or higher
❯ sudo kubeadm upgrade plan --config /etc/kubernetes/kubeadm-kubelet-config.yaml

[upgrade/config] Making sure the configuration is correct:
W0613 23:37:56.776923 3107215 common.go:94] WARNING: Usage of the --config flag with kubeadm config types for reconfiguring the cluster during upgrade is not recommended!
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade/health] FATAL: [preflight] Some fatal errors occurred:
        [ERROR ControlPlaneNodesReady]: failed to find any nodes with a control-plane role
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

Any help is appreciated.

stale[bot] commented 2 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 1 year ago

This issue is no longer marked for closure.

geerlingguy commented 1 year ago

At the very least, it would be nice to have documentation around the best way to do upgrades. Kubernetes upgrades are a pain regardless of how automated you can make them.