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 e2e tests for rootless control-plane. #2511

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

vinayakankugoyal
Copy link
Contributor

@vinayakankugoyal vinayakankugoyal commented Jun 19, 2021

edit: neolit123

xref #2473
xref kubernetes/enhancements#2568

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@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. labels Jun 19, 2021
@k8s-ci-robot k8s-ci-robot requested review from pacoxu and yagonobre June 19, 2021 18:57
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 19, 2021
@neolit123
Copy link
Member

neolit123 commented Jun 21, 2021

this looks fine as a start.

as we discussed we can do the following workflow

  • create cluster nodes
  • write rootless test scripts (examples in discovery.yaml)
  • init / join
  • test rootless (examples in discovery.yaml)
  • do kubeadm and k8s e2e suite tests
  • upgrade
    we can try - --upgrade-version={{ .vars.kubernetesVersion }} there
  • test rootless again

with the new locally committed "rootless" changes in config.yaml does:
./hack/update-workflows.sh work?

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 21, 2021
@vinayakankugoyal vinayakankugoyal marked this pull request as ready for review June 21, 2021 20:11
@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 Jun 21, 2021
@vinayakankugoyal
Copy link
Contributor Author

vinayakankugoyal commented Jun 21, 2021

as we discussed we can do the following workflow

  • create cluster nodes
  • write rootless test scripts (examples in discovery.yaml)
  • init / join
  • test rootless (examples in discovery.yaml)
  • do kubeadm and k8s e2e suite tests
  • upgrade
    we can try - --upgrade-version={{ .vars.kubernetesVersion }} there
  • test rootless again

Done!

with the new locally committed "rootless" changes in config.yaml does:
./hack/update-workflows.sh work?

Yeah, I think I was missing the template file in testinfra and after adding that it worked.

@neolit123
Copy link
Member

neolit123 commented Jun 21, 2021

https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubeadm/2511/pull-kubeadm-kinder-upgrade-latest/1407070836409503744

can not mix '--config' with arguments [feature-gates]

ok, so my mistake, but we actually do not allow mixing --feature-gates and --config, so the option must be passed via the ClusterConfiguration.

it must be done here:

if err := KubeadmInitConfig(c, kubeadmConfigVersion, copyCertsMode, cp1); err != nil {

and all the way to here:

func getKubeadmConfig(c *status.Cluster, n *status.Node, data kubeadm.ConfigData, options kubeadmConfigOptions) (string, error) {

then the feature gates can be templated in the v1beta2 and v1beta3 config:

templateSource = configTemplateBetaV2
case "v1beta3":
templateSource = configTemplateBetaV3

by converting feature gates Foo=true,Bar=true to:

featureGates:
- Foo: true
- Bar: true

under ClusterConfiguration.

these calls no longer need the featuregates explicitly:

err = kubeadmInitWithPhases(cp1, copyCertsMode, patchesDir, ignorePreflightErrors, featureGates, vLevel)
} else {
err = kubeadmInit(cp1, copyCertsMode, patchesDir, ignorePreflightErrors, featureGates, vLevel)

because the values would be prepared in config.

@vinayakankugoyal vinayakankugoyal force-pushed the featuregate branch 6 times, most recently from 8cc8a01 to d570be3 Compare June 21, 2021 23:04
@vinayakankugoyal
Copy link
Contributor Author

@neolit123 - Thanks! I updated it roughly based on your guidelines, but instead of multiple feature-gates I kept the scope to a single feature-gate for ease of implementation.

Comment on lines 128 to 129
"kubeadm-feature-gate", "",
"the kubeadm feature-gate to be used for init, join and upgrade",
Copy link
Member

Choose a reason for hiding this comment

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

it is a bit limiting in terms of UX.

that said:

  • i don't see having a single test with kinder that tests multiple FGs.
  • we don't have that many FGs in kubeadm anyway, currently.

so supporting a single feature gate for the time being seems fine to me.

kinder/pkg/cluster/manager/actions/actions.go Outdated Show resolved Hide resolved
kinder/cmd/kinder/do/do.go Outdated Show resolved Hide resolved
kinder/pkg/cluster/manager/actions/kubeadm-config.go Outdated Show resolved Hide resolved
kinder/pkg/cluster/manager/actions/kubeadm-config.go Outdated Show resolved Hide resolved
@neolit123 neolit123 added area/kinder Issues to track work in the kinder tool kind/feature Categorizes issue or PR as related to a new feature. labels Jun 22, 2021
@neolit123 neolit123 added this to the v1.22 milestone Jun 22, 2021
@neolit123
Copy link
Member

[preflight] Some fatal errors occurred:
	[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.22.0-alpha.3.379_a3f24e84594654: output: Error response from daemon: manifest for k8s.gcr.io/kube-apiserver:v1.22.0-alpha.3.379_a3f24e84594654 not found
, error: exit status 1
	[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.22.0-alpha.3.379_a3f24e84594654: output: Error response from daemon: manifest for k8s.gcr.io/kube-controller-manager:v1.22.0-alpha.3.379_a3f24e84594654 not found
, error: exit status 1
	[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.22.0-alpha.3.379_a3f24e84594654: output: Error response from daemon: manifest for k8s.gcr.io/kube-scheduler:v1.22.0-alpha.3.379_a3f24e84594654 not found
, error: exit status 1
	[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.22.0-alpha.3.379_a3f24e84594654: output: Error response from daemon: manifest for k8s.gcr.io/kube-proxy:v1.22.0-alpha.3.379_a3f24e84594654 not found
, error: exit status 1

looks unrelated:
kubernetes/kubernetes#103101

@vinayakankugoyal
Copy link
Contributor Author

/retest

@neolit123
Copy link
Member

the test will not pass until we fix the related issue.
i can send a PR and ping you for LGTM.

@@ -0,0 +1,38 @@
- name: ci-kubernetes-e2e-kubeadm-kinder-rootless-{{ dashVer .KubernetesVersion }}
Copy link
Member

Choose a reason for hiding this comment

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

this looks fine to me.
could you please send the kubernetes/test-infra PR as well?

running ./hack/update-workflows.sh would write the new file in the test-infra clone that you have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ill do that once we merge this to avoid having to keep both in sync.

@vinayakankugoyal vinayakankugoyal force-pushed the featuregate branch 2 times, most recently from 568fa59 to 51f37f4 Compare June 23, 2021 00:27
@vinayakankugoyal
Copy link
Contributor Author

/retest

1 similar comment
@vinayakankugoyal
Copy link
Contributor Author

/retest

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.

/lgtm
/approve

thanks, for enduring this review.
now need the test-infra PR and see if it actually works with Prow.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123, vinayakankugoyal

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 23, 2021
@k8s-ci-robot k8s-ci-robot merged commit ebd1ae0 into kubernetes:master Jun 23, 2021
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/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants