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

kubeadm cleanup: master -> control-plane (cont.2) #74064

Merged

Conversation

vanduc95
Copy link
Contributor

This PR continuation of #73987

Does this PR introduce a user-facing change?:

NONE

/assign @neolit123

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Feb 14, 2019
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 14, 2019
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 14, 2019
Copy link
Member

@neolit123 neolit123 left a 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
Copy link
Member

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?
Copy link
Member

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
Copy link
Member

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.

@neolit123
Copy link
Member

/kind cleanup
/priority backlog
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 14, 2019
@vanduc95 vanduc95 force-pushed the cleanup-kubeadm-cont.2-20190214 branch 2 times, most recently from f7b0f2a to f4eca14 Compare February 14, 2019 23:57
Copy link
Member

@yagonobre yagonobre left a comment

Choose a reason for hiding this comment

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

Thanks @vanduc95
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 2019
@@ -143,7 +143,7 @@ const (
// the TLS bootstrap to get itself an unique credential
Copy link
Member

@neolit123 neolit123 Feb 15, 2019

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"
Copy link
Member

@neolit123 neolit123 Feb 15, 2019

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]

Copy link
Member

@neolit123 neolit123 Feb 20, 2019

Choose a reason for hiding this comment

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

@vanduc95
i should have deleted the above comment next to deleting the similar one.

also i'm not sure whether we should keep this or change to LabelNodeRoleMaster at this point.
mostly leaning towards change.

but let's wait for more comments...

@rosti @kubernetes/sig-cluster-lifecycle-pr-reviews

Copy link
Contributor

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.

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

ControlPlaneNumCPU

Copy link
Contributor

@atoato88 atoato88 left a 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.

cmd/kubeadm/app/util/config/initconfiguration.go Outdated Show resolved Hide resolved
cmd/kubeadm/app/util/config/initconfiguration.go Outdated Show resolved Hide resolved
@vanduc95 vanduc95 force-pushed the cleanup-kubeadm-cont.2-20190214 branch from 59895d6 to 0643b7e Compare February 19, 2019 09:14
@vanduc95
Copy link
Contributor Author

Thanks for your review @atoato88.

Copy link
Contributor

@rosti rosti left a 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"
Copy link
Contributor

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"
Copy link
Contributor

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

@vanduc95
Copy link
Contributor Author

Thanks @rosti !
This PR has been updated.

@vanduc95 vanduc95 force-pushed the cleanup-kubeadm-cont.2-20190214 branch from 0643b7e to 5d649ff Compare February 20, 2019 02:18
Copy link
Contributor

@rosti rosti left a comment

Choose a reason for hiding this comment

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

Thanks @vanduc95 !
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2019
Copy link
Member

@neolit123 neolit123 left a 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 20, 2019
@vanduc95
Copy link
Contributor Author

Thanks @neolit123, I fixed merge conflicts.

@vanduc95 vanduc95 force-pushed the cleanup-kubeadm-cont.2-20190214 branch from 5d649ff to 8640c17 Compare February 21, 2019 01:29
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2019
@@ -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 {
Copy link
Member

@neolit123 neolit123 Feb 21, 2019

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

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok @neolit123, I changed :)

Copy link
Contributor Author

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

Copy link
Member

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.

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

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

master -> control-plane.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2019
@vanduc95 vanduc95 force-pushed the cleanup-kubeadm-cont.2-20190214 branch from 8640c17 to 51eb01d Compare February 21, 2019 02:10
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2019
@vanduc95 vanduc95 force-pushed the cleanup-kubeadm-cont.2-20190214 branch from 51eb01d to ae1ec88 Compare February 21, 2019 03:04
@vanduc95
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

Copy link
Member

@neolit123 neolit123 left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@neolit123
Copy link
Member

/retest

1 similar comment
@neolit123
Copy link
Member

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants