kubernetes / kubeadm

Aggregator for issues filed against kubeadm
Apache License 2.0
3.76k stars 716 forks source link

kubeadm: enable join dryrun e2e tests #3116

Closed SataQiu closed 1 week ago

SataQiu commented 3 weeks ago

kubeadm: enable join dryrun e2e tests without a real control plane

Ref: #2653

SataQiu commented 3 weeks ago

/hold for review

pacoxu commented 3 weeks ago

/lgtm

carlory commented 3 weeks ago

/lgtm

SataQiu commented 3 weeks ago

kubeadm upgrade dryrun without cluster is still not supported yet.

# kubeadm upgrade apply -f v1.32.0-alpha.3.47+daef8c2419a638 --ignore-preflight-errors=Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables --allow-release-candidate-upgrades=true --allow-experimental-upgrades=true --dry-run --v=6

open /etc/kubernetes/admin.conf: no such file or directory
failed to load kubeconfig
k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient.(*DryRun).WithKubeConfigFile
        k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient/dryrun.go:79
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.getClient
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/common.go:195
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newApplyData
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/apply.go:226
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newCmdApply.func2
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/apply.go:146
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).InitData
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:185
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newCmdApply.func1
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/apply.go:99
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/cobra@v1.8.1/command.go:985
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/cobra@v1.8.1/command.go:1117
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/cobra@v1.8.1/command.go:1041
k8s.io/kubernetes/cmd/kubeadm/app.Run
        k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:47
main.main
        k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
        runtime/proc.go:272
runtime.goexit
        runtime/asm_amd64.s:1700
couldn't create a Kubernetes client from file "/etc/kubernetes/admin.conf"
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newApplyData
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/apply.go:228
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newCmdApply.func2
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/apply.go:146
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).InitData
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:185
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newCmdApply.func1
        k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/apply.go:99
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/cobra@v1.8.1/command.go:985
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/cobra@v1.8.1/command.go:1117
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/cobra@v1.8.1/command.go:1041
k8s.io/kubernetes/cmd/kubeadm/app.Run
        k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:47
main.main
        k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
        runtime/proc.go:272
runtime.goexit
        runtime/asm_amd64.s:1700
neolit123 commented 3 weeks ago

kubeadm upgrade dryrun without cluster is still not supported yet.

i think it used to work. perhaps we broke it with upgrade apply phases. checking..

neolit123 commented 3 weeks ago

kubeadm upgrade dryrun without cluster is still not supported yet.

i think it used to work. perhaps we broke it with upgrade apply phases. checking..

no, seems like upgrade does need the admin.conf https://github.com/kubernetes/kubernetes/pull/126776/files#diff-657870bffd956e3e3553db7dbb5cb725ea53922da959fcf869c2e31880df72c7R195

but i can try to make it work without it.

neolit123 commented 3 weeks ago

kubeadm upgrade dryrun without cluster is still not supported yet.

i think it used to work. perhaps we broke it with upgrade apply phases. checking..

no, seems like upgrade does need the admin.conf https://github.com/kubernetes/kubernetes/pull/126776/files#diff-657870bffd956e3e3553db7dbb5cb725ea53922da959fcf869c2e31880df72c7R195

but i can try to make it work without it

SataQiu commented 1 week ago

this is ready for more review, I think we can merge it now. @neolit123

k8s-ci-robot commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlory, neolit123, pacoxu, SataQiu

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: - ~~[OWNERS](https://github.com/kubernetes/kubeadm/blob/main/OWNERS)~~ [SataQiu,neolit123,pacoxu] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
SataQiu commented 1 week ago

/hold cancel

Let's see if it works