-
Notifications
You must be signed in to change notification settings - Fork 327
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
Conversation
comments:
|
|
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.
please help address my comments and create new pr
c04f861
to
0f16ef8
Compare
return nil | ||
} | ||
|
||
func updateCoreDNSVersion(ctx context.Context, client kubernetes.Interface, version string) error { |
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.
please try kubeadm config upload from-file --config /path/kubeadmconf.yml
to update cm rather than do it manually
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.
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" { | ||
|
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.
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 { |
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.
I prefer to depends on something like
tke/pkg/util/apiclient/version.go
Line 29 in 7ac0421
func ClusterVersionIsBefore19(client kubernetes.Interface) bool { |
d94ed68
to
c204af1
Compare
@@ -133,4 +133,6 @@ const ( | |||
MinNumCPU = 2 | |||
|
|||
APIServerHostName = "api.tke.com" | |||
|
|||
NeedUpgradeCoreDNSK8sVersion = "1.19.0" |
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.
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
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.: