-
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 graduate preflight phase #69666
Kubeadm graduate preflight phase #69666
Conversation
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 @fabriziopandini
added a couple of minor comments.
LGTM
(not adding /lgtm to avoid the bot auto-retesting)
return nil | ||
} | ||
|
||
// TODO: consider if to split this into a nested phase preflight/pull |
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, we should probably consider something like that.
e.g.
...
preflight/validate
preflight/image-pull
...
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 postponed this change after completing the implementation of the first list of phases agreed on kubernetes/kubeadm#1163
cmd/kubeadm/app/cmd/init.go
Outdated
@@ -161,7 +162,7 @@ func NewCmdInit(out io.Writer) *cobra.Command { | |||
options.bto.AddTTLFlag(cmd.PersistentFlags()) | |||
|
|||
// initialize the workflow runner with the list of phases | |||
// TODO: add the phases to the runner. e.g. initRunner.AppendPhase(phases.PreflightMaster) | |||
initRunner.AppendPhase(phases.PreflightMaster) |
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.
[1]
} | ||
|
||
// PreflightMaster defines that kubeadm workflow phase that implements preflight checks for a new master node. | ||
var PreflightMaster = workflow.SimplePhase{ |
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.
probably better to make such phase variables private and have a public getter instead.
GetPreflightMaster() { return preflightMaster }
otherwise any package can modify the PreflightMaster variable.
also we might want to prefix these with Phase - e.g.
PhasePreflightMaster
?
@@ -70,47 +115,11 @@ func NewCmdPreFlight() *cobra.Command { | |||
options.AddConfigFlag(cmd.PersistentFlags(), &cfgPath) | |||
options.AddIgnorePreflightErrorsFlag(cmd.PersistentFlags(), &ignorePreflightErrors) | |||
|
|||
cmd.AddCommand(NewCmdPreFlightMaster(&cfgPath, &ignorePreflightErrors)) | |||
cmd.AddCommand(NewCmdPreFlightNode(&cfgPath, &ignorePreflightErrors)) |
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 wonder, if we have plans to make the worker preflight phase-able too eventually...
might be wise to keep that in mind in terms of code organization, even if we never do it.
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.
Not for v1.13 IMO
/hold |
return err | ||
} | ||
} else { | ||
fmt.Println("[preflight] Would pull the required images (like 'kubeadm config images pull')") |
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 would be useful to dump the images that were supposed to be pulled here.
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 agree this is a useful suggestion but I think we should graduate phases as much as possible without changes because there is still a lot of work to do, and then eventually address possible improvements with separated PR.
This one, if you want to file an issue, could be a good issue for first-time contributors 😉
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 think we already dump them with --v>=0
no?
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 don't think so, but I am not 100% certain. We have to check on that.
Once this gets merged, I'll file an issue.
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.
--v=1 seems to show them:
[preflight/images] Pulling images required for setting up a Kubernetes cluster
[preflight/images] This might take a minute or two, depending on the speed of your internet connection
[preflight/images] You can also perform this action in beforehand using 'kubeadm config images pull'
I1017 18:33:05.090825 8365 checks.go:840] pulling k8s.gcr.io/kube-apiserver:v1.12.1
I1017 18:33:25.091417 8365 checks.go:840] pulling k8s.gcr.io/kube-controller-manager:v1.12.1
...
probably fine to leave it like that, unless we want to show them with v=0 (aka fmt.Print).
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.
That seems to be the case where there is no --dry-run
. My idea is to have this with --dry-run
.
I'll loop back to this after we agree on #69684 |
d6a2a53
to
afe4a74
Compare
afe4a74
to
8fe2e99
Compare
8fe2e99
to
e289ef2
Compare
/hold cancel |
/test pull-kubernetes-e2e-kops-aws |
/lgtm |
/remove-kind documentation @fabriziopandini otherwise we are going to end up with NONE for all of them. |
@neolit123, since we are doing this via multiple PRs (and probably also a final iteration to finalize details) in my opinion release notes should be added only at the end. |
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.
/lgtm
/approve
let's keep rolling but please change the usage of 'ctx'
cmd/kubeadm/app/cmd/init.go
Outdated
@@ -305,23 +307,20 @@ func newInitData(cmd *cobra.Command, options *initOptions) (initData, error) { | |||
}, nil | |||
} | |||
|
|||
func (ctx initData) Cfg() *kubeadmapi.InitConfiguration { |
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.
just name the var anything other than ctx.
e289ef2
to
22da6a6
Compare
|
i wish github allowed to show what changed since the last push. : |
@neolit123 +1 |
/lgtm @fabriziopandini @timothysc so this PR should just merge if |
/approve |
@neolit123 we are still blocked |
i forgot about that file :...when new generated docs are added they need to be reflected in docs/.generated_docs too and this means that we would need approvers in /docs/OWNERS (/docs/admin is not sufficient)! @spiffxp @timothysc @ixdy @tengqm there is no point to generate these place holder docs on every commit. this is a big UX blocker for contributors and there are a couple of solutions:
i will send a PR for the later to see how that gets received. |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: fabriziopandini, timothysc 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 |
What this PR does / why we need it:
This PR graduates phase preflight in the kubeadm init workflow.
As a result the command
kubeadm aplha phase preflight
is removed and instead the kubeadm init command is modified and now it prints the following help:nb (other phases in kubeadm init workflow are not yet graduated)
Additionally following sub commands are automatically added to kubeadm by the PhaseRunner:
Which issue(s) this PR fixes :
Rif kubernetes/kubeadm#1163
Special notes for your reviewer:
Depends on
/sig cluster-lifecycle
/kind documentation
/assign @neolit123
/cc @timothysc
@kubernetes/sig-cluster-lifecycle-pr-reviews
@chuckha
@rosti
Release note: