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

feat(platform): update k8s 1.19.7 support #1070

Merged
merged 5 commits into from
Feb 1, 2021

Conversation

leoryu
Copy link
Contributor

@leoryu leoryu commented Jan 28, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@huxiaoliang
Copy link
Contributor

comments:

  1. We should upgrade coredns so that align with k8s version to leverage kubeadm to handle corefile migration case: https://github.com/rajansandeep/kubernetes/blob/2eabd9d832960bc7be50fd6a7ee9dd0e2355c53a/cmd/kubeadm/app/phases/addons/dns/dns.go#L274
  2. please update UT case to pick up k8s 1.19 as well: https://github.com/tkestack/tke/blob/master/.github/workflows/e2e.yml#L40 -> please create new section for 1.19, not update/remove 1.18
  3. update release case for install k8s 1.19

@huxiaoliang
Copy link
Contributor

huxiaoliang commented Jan 28, 2021

  1. core dns an k8s version map is here: https://github.com/coredns/deployment/blob/master/kubernetes/CoreDNS-k8s_version.md
  2. useful link: https://kubernetes.io/docs/tasks/administer-cluster/coredns/
  3. to keep compatibility, we should have core dns 1.6 and 1.7, core dns upgrade process only triggered when upgrade tkestack from 1.5 -> 1.6

Copy link
Contributor

@huxiaoliang huxiaoliang left a comment

Choose a reason for hiding this comment

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

please help address my comments and create new pr

return nil
}

func updateCoreDNSVersion(ctx context.Context, client kubernetes.Interface, version string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

please try kubeadm config upload from-file --config /path/kubeadmconf.yml to update cm rather than do it manually

Copy link
Contributor

Choose a reason for hiding this comment

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

you should use kubeadm config view > then kubeadm config upload from-file --config /path/kubeadmconf.yml

return errors.Wrap(fmt.Errorf("invaild version format %s", c.Spec.Version), "unable to update coreDNS version")
}
if versionRet[0] == "1" && versionRet[1] == "19" {

Copy link
Contributor

Choose a reason for hiding this comment

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

We already have code to check version before and after, please reuse

@@ -140,6 +146,49 @@ func (p *Provider) EnsurePreClusterUpgradeHook(ctx context.Context, c *v1.Cluste
return util.ExcuteCustomizedHook(ctx, c, platformv1.HookPreClusterUpgrade, c.Spec.Machines[:1])
}

func (p *Provider) EnsureUpgradeCoreDNS(ctx context.Context, c *v1.Cluster) error {
if version.Compare(c.Spec.Version, "1.19.0") >= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to depends on something like

func ClusterVersionIsBefore19(client kubernetes.Interface) bool {
to handle version

@@ -133,4 +133,6 @@ const (
MinNumCPU = 2

APIServerHostName = "api.tke.com"

NeedUpgradeCoreDNSK8sVersion = "1.19.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

from 1.19, we should support upgrade coredns to align with k8s, so we need to make this process automatically and don't hard code coredns version in our hand. all install and upgrade logic will handled by kubeadm

@huxiaoliang huxiaoliang merged commit b4bb3c0 into tkestack:master Feb 1, 2021
@leoryu leoryu deleted the update_k8s_1.19.7 branch May 8, 2021 06:23
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.

None yet

2 participants