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

Add dry run e2e tests #2673

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Conversation

SataQiu
Copy link
Member

@SataQiu SataQiu commented Mar 27, 2022

xref: #2653

edit: neolit123 (fixes -> xref)

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 27, 2022
@k8s-ci-robot k8s-ci-robot requested a review from RA489 March 27, 2022 13:39
@k8s-ci-robot k8s-ci-robot added sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 27, 2022
@RA489
Copy link
Contributor

RA489 commented Mar 28, 2022

/test pull-kubeadm-kinder-verify

@k8s-ci-robot k8s-ci-robot added the area/kinder Issues to track work in the kinder tool label Apr 10, 2022
@SataQiu SataQiu changed the title [WIP] add dry run e2e tests Add regular dry run e2e tests Apr 10, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 10, 2022
@SataQiu
Copy link
Member Author

SataQiu commented Apr 10, 2022

/cc @neolit123

@@ -156,6 +156,18 @@ jobGroups:
- kubernetesVersion: -2
- kubernetesVersion: -3

- name: dryrun-regular
Copy link
Member

@neolit123 neolit123 Apr 11, 2022

Choose a reason for hiding this comment

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

thanks for the PR @SataQiu
as noted in #2653

i think we can call this workflow group just dryrun and make it also include upgrade

allocate a kinder cluster with 1 node
call kubeadm init --dry-run on it (add --upload-certs and other special flags, how to test external CA?)
call kubeadm join --dry-run on it (add --control-plane, --certificate-key and other flags?)
call kubeadm reset --dry-run on it
call kubeadm init ... to create an actual k8s node
call kubeadm upgrade apply --dry-run to dry run the "primary node" upgrade of this node
call kubeadm upgrade node --dry-run to dry run the "secondary node" upgrade of this node

cmd: kinder
args:
- do
- kubeadm-init
Copy link
Member

@neolit123 neolit123 Apr 11, 2022

Choose a reason for hiding this comment

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

instead of using the kinder wrapped kubeadm commands for init/join/reset i think it might be possible to just create 1 CP node (0 workers).

and have a bash script that calls all kubeadm commands on the same node - example:
https://github.com/kubernetes/kubeadm/blob/main/kinder/ci/workflows/unversioned-kubelet-cm-tasks.yaml#L69-L75

docker exec {{ .vars.clusterName }}-control-plane-1 kubeadm init ... --dry-run ....  || exit 1
docker exec {{ .vars.clusterName }}-control-plane-1 kubeadm ...  || exit 1
...

did you try that?

this would also avoid adding the --kubeadm-dryrun=true flag in kinder. not that it's a problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

instead of using the kinder wrapped kubeadm commands for init/join/reset i think it might be possible to just create 1 CP node (0 workers).

and have a bash script that calls all kubeadm commands on the same node - example: https://github.com/kubernetes/kubeadm/blob/main/kinder/ci/workflows/unversioned-kubelet-cm-tasks.yaml#L69-L75

docker exec {{ .vars.clusterName }}-control-plane-1 kubeadm init ... --dry-run ....  || exit 1
docker exec {{ .vars.clusterName }}-control-plane-1 kubeadm ...  || exit 1
...

did you try that?

this would also avoid adding the --kubeadm-dryrun=true flag in kinder. not that it's a problem.

Thanks @neolit123
This makes sense, I'll try it later.

@SataQiu SataQiu changed the title Add regular dry run e2e tests Add dry run e2e tests Apr 12, 2022
@SataQiu
Copy link
Member Author

SataQiu commented Apr 12, 2022

@neolit123 It seems much cleaner to use docker exec ....

args:
- -c
- |
docker exec {{ .vars.clusterName }}-control-plane-1 kubeadm init --ignore-preflight-errors=Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables --kubernetes-version={{ .vars.kubernetesVersion }} --dry-run=true --v={{ .vars.kubeadmVerbosity }} || exit 1
Copy link
Member

@neolit123 neolit123 Apr 12, 2022

Choose a reason for hiding this comment

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

we can define the --ignore-preflight-errors... as a variable under vars and use it in a few places.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines +86 to +91
- do
- kubeadm-join
- --name={{ .vars.clusterName }}
- --loglevel=debug
- --kubeadm-verbosity={{ .vars.kubeadmVerbosity }}
Copy link
Member

@neolit123 neolit123 Apr 12, 2022

Choose a reason for hiding this comment

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

i guess this is fine for now, we should change it to not require access to the cluster-info config map.
as per the discussion here:
#2653 (comment)

after that we can possibly have a single CP node on which we can run all dry-run commands that we want instead of having 1CP1W and doing an actual join.

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, @SataQiu
we need a test infra PR as well to get the initial test job running.

i've enumerated the remaining tasks here:
#2653 (comment)

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123, 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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 736d689 into kubernetes:main Apr 18, 2022
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/kinder Issues to track work in the kinder tool area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants