-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Refactor away from using Cluster object in nodeup #14870
Conversation
/retest |
2 similar comments
/retest |
/retest |
8fcfd44
to
8d14033
Compare
d8896b4
to
ce85efa
Compare
/retest |
1 similar comment
/retest |
ce85efa
to
63b0c3c
Compare
/retest |
63b0c3c
to
243291c
Compare
/retest |
1 similar comment
/retest |
243291c
to
6eae31b
Compare
Ah, my change had broken Gossip because nodeup was checking the Name field of the Cluster object. |
6eae31b
to
4acc4b4
Compare
// IsGossip is true if the cluster runs Gossip DNS. | ||
IsGossip bool | ||
|
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 dislike the IsGossip
name. Maybe UsesGossipDNS
? Though... let's say it's consistent.
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'd also lean towards a function if we can determine it from other values, but ... I don't think it's a blocker as it's only internal implementation (I believe)
nodeup/pkg/model/etc_hosts.go
Outdated
task.Records = append(task.Records, nodetasks.HostRecord{ | ||
Hostname: b.Cluster.APIInternalName(), | ||
Hostname: "api.internal." + b.NodeupConfig.ClusterName, |
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.
It's pretty hard already tracking all instances of using "internal" names. Best to keep this as a function or variable.
/retest |
nodeup/pkg/model/context.go
Outdated
@@ -325,7 +334,7 @@ func (c *NodeupModelContext) BuildBootstrapKubeconfig(name string, ctx *fi.Nodeu | |||
// This code path is used for the kubelet cert in Kubernetes 1.18 and earlier. | |||
kubeConfig.ServerURL = "https://127.0.0.1" | |||
} else { | |||
kubeConfig.ServerURL = "https://" + c.Cluster.APIInternalName() | |||
kubeConfig.ServerURL = "https://api.internal." + c.NodeupConfig.ClusterName |
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.
Might be nice to keep the function here (c.APIInternalName()
), though not a blocker.
Addresses: []string{b.BootConfig.APIServerIP}, | ||
}) | ||
if b.UseKopsControllerForNodeBootstrap() { | ||
task.Records = append(task.Records, nodetasks.HostRecord{ | ||
Hostname: "kops-controller.internal." + b.Cluster.Name, | ||
Hostname: "kops-controller.internal." + b.NodeupConfig.ClusterName, |
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 see hakman had the same idea about functions above - maybe we make this a function as well, as it's otherwise inconsistent (albeit pre-existing inconsistency). Not a blocker though, as this is internal / can be done later.
Generally lgtm - and I really like the direction of the refactor. A few quibbles over when we should use a function, but we can maybe reach some guidelines in office hours (if we're having them today? If not I vote to merge and iterate, I might propose a few helper functions for the hostnames in particular). I really like the direction here though, I would love to have nodeup only work in terms of Tasks that come from kops-controller (or from metadata in the case of control plane). That would require us to treat (nodeup) Tasks as versioned, but I think it would be great to simplify nodeup and enable things like "hot" upgrades. But that's more directional IMO! |
/retest |
11a6d4b
to
99d36bd
Compare
Is there anything else for this PR? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman 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 |
No description provided.