-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
kubeadm cleanup: master -> control-plane (cont.2) #74064
kubeadm cleanup: master -> control-plane (cont.2) #74064
Conversation
Hi @vanduc95. Thanks for your PR. I'm waiting for a 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. |
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.
thanks @vanduc95
// as we handle that ourselves in the markmaster phase | ||
// TODO: Maybe we want to do that some time in the future, in order to remove some logic from the markmaster phase? | ||
// Write env file with flags for the kubelet to use. We do not need to write the --register-with-taints for the control-plane, | ||
// as we handle that ourselves in the markcontrolplane phase |
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.
mark-control-plane
// TODO: Maybe we want to do that some time in the future, in order to remove some logic from the markmaster phase? | ||
// Write env file with flags for the kubelet to use. We do not need to write the --register-with-taints for the control-plane, | ||
// as we handle that ourselves in the markcontrolplane phase | ||
// TODO: Maybe we want to do that some time in the future, in order to remove some logic from the markcontrolplane phase? |
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.
mark-control-plane
@@ -59,7 +59,7 @@ func FetchInitConfigurationFromCluster(client clientset.Interface, w io.Writer, | |||
|
|||
// getInitConfigurationFromCluster is separate only for testing purposes, don't call it directly, use FetchInitConfigurationFromCluster instead | |||
func getInitConfigurationFromCluster(kubeconfigDir string, client clientset.Interface, newControlPlane bool) (*kubeadmapi.InitConfiguration, error) { | |||
// TODO: This code should support reading the MasterConfiguration key as well for backwards-compat | |||
// TODO: This code should support reading the ClusterConfiguration key as well for backwards-compat |
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 remove this comment.
the MasterConfiguration
key no longer exists in our code base.
/kind cleanup |
f7b0f2a
to
f4eca14
Compare
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.
Thanks @vanduc95
/lgtm
@@ -143,7 +143,7 @@ const ( | |||
// the TLS bootstrap to get itself an unique credential |
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.
vanduc95 there are a lot more Master entries in this file.
we need to change code as well not only comments! :)
@@ -191,7 +191,7 @@ const ( | |||
// Default behaviour is 24 hours | |||
DefaultTokenDuration = 24 * time.Hour | |||
|
|||
// LabelNodeRoleMaster specifies that a node is a master | |||
// LabelNodeRoleMaster specifies that a node is a control-plane | |||
// This is a duplicate definition of the constant in pkg/controller/service/service_controller.go | |||
LabelNodeRoleMaster = "node-role.kubernetes.io/master" |
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.
this is an exception keep it like LabelNodeRoleMaster
.
[1]
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.
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 need to keep it like LabelNodeRoleMaster
. There is currently a constant named in the same way and used for the same purpose in pkg/controller/service/service_controller.go
and the idea is at some point to move that constant to a common place (where we won't import a huge package just for it).
Until then, it's best to keep the constant names in sync.
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.
ok, keeping this like so.
@@ -350,18 +350,18 @@ const ( | |||
// DefaultAPIServerBindAddress is the default bind address for the API Server | |||
DefaultAPIServerBindAddress = "0.0.0.0" | |||
|
|||
// MasterNumCPU is the number of CPUs required on master | |||
// MasterNumCPU is the number of CPUs required on control-plane | |||
MasterNumCPU = 2 |
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.
ControlPlaneNumCPU
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.
If others are in favor of this, please take into account my review comments.
59895d6
to
0643b7e
Compare
Thanks for your review @atoato88. |
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.
Thanks @vanduc95 !
We have to be careful with some constants though. They were copied locally to avoid importing large external packages and they must retain their old names as they are used throughout k8s sources.
// This is a duplicate definition of the constant in pkg/controller/service/service_controller.go | ||
LabelNodeRoleMaster = "node-role.kubernetes.io/master" | ||
LabelNodeRoleControlPlane = "node-role.kubernetes.io/master" |
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.
Don't change this one. It's a local copy of an external constant, that will eventually be removed and pointed again to the external reference.
// (i.e. bound to the cluster-admin ClusterRole) | ||
MastersGroup = "system:masters" | ||
ControlPlaneGroup = "system:masters" |
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.
This must be changed to SystemPrivilegedGroup
Thanks @rosti ! |
0643b7e
to
5d649ff
Compare
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.
Thanks @vanduc95 !
/lgtm
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.
@vanduc95
please rebase to fix merge conflicts.
/approve
Thanks @neolit123, I fixed merge conflicts. |
5d649ff
to
8640c17
Compare
cmd/kubeadm/app/preflight/checks.go
Outdated
@@ -871,7 +871,7 @@ func (ncc NumCPUCheck) Check() (warnings, errorList []error) { | |||
return warnings, errorList | |||
} | |||
|
|||
// RunInitMasterChecks executes all individual, applicable to Master node checks. | |||
// RunInitMasterChecks executes all individual, applicable to master node checks. | |||
func RunInitMasterChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.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.
looks like we missed this one...
could you please change it too?
RunInitMasterChecks
-> RunInitNodeChecks
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.
yes @neolit123,
I just modified variables, constants and function names under kubeadm/app/constants package. In addition, I also modified in the files which have reference to constants in kubeadm/app/constants.
I will change other package in next PR. Thanks
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.
ok, sounds good.
thanks for that!
/lgtm
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.
Ok @neolit123, I changed :)
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.
lol, I just updated PR :D
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.
👍 let's wait to see if CI passes and will LGTM again.
cmd/kubeadm/app/preflight/checks.go
Outdated
@@ -871,7 +871,7 @@ func (ncc NumCPUCheck) Check() (warnings, errorList []error) { | |||
return warnings, errorList | |||
} | |||
|
|||
// RunInitMasterChecks executes all individual, applicable to Master node checks. | |||
// RunInitMasterChecks executes all individual, applicable to master node checks. |
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.
master
-> control-plane
.
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.
Done
8640c17
to
51eb01d
Compare
51eb01d
to
ae1ec88
Compare
/test pull-kubernetes-e2e-gce |
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.
thanks @vanduc95
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123, vanduc95 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 |
/retest |
1 similar comment
/retest |
This PR continuation of #73987
Does this PR introduce a user-facing change?:
/assign @neolit123