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

Skip metallb PodSecurityPolicy object for kubernetes 1.25+ #14903

Merged
merged 3 commits into from Sep 14, 2022

Conversation

Jancis
Copy link
Contributor

@Jancis Jancis commented Sep 2, 2022

Minikube MetalLB addon can't be installed on kubernetes cluster 1.25.0, because it installs PodSecurityPolicy policy/v1beta1 object that is deprecated with kubernetes 1.25.
MetalLB solves this by removing object altogether: metallb/metallb#1569
I made PR that exposes Kubernetes version and conditionally enables psp object for <1.25. Project uses older templating library so semver and semverCompare can't be used.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 2, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @Jancis!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 2, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @Jancis. 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 2, 2022
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@spowelljr
Copy link
Member

Hi @Jancis, can you follow the instructions in #14903 (comment) to sign the CLA so we can continue with the PR, thanks

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 5, 2022
@Jancis
Copy link
Contributor Author

Jancis commented Sep 6, 2022

@spowelljr I signed it, anything else I can do?

@spowelljr
Copy link
Member

@spowelljr I signed it, anything else I can do?

I'm working on the PR that enables minikube to support k8s v1.25 (#14848).. Once that's merged you can rebase this PR on master and then test it out to make sure if works.

@spowelljr
Copy link
Member

/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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 13, 2022
@spowelljr
Copy link
Member

spowelljr commented Sep 13, 2022

@Jancis I need to leverage your logic exposing the Kubernetes version for the Gvisor addon in regard to RuntimeClass. So I'm running the tests on your PR and if everything looks good I'll merge it

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14903) |
+----------------+----------+---------------------+
| minikube start | 56.7s    | 55.9s               |
| enable ingress | 26.8s    | 27.7s               |
+----------------+----------+---------------------+

Times for minikube start: 60.0s 55.5s 56.2s 56.3s 55.4s
Times for minikube (PR 14903) start: 55.9s 57.0s 55.8s 55.6s 55.3s

Times for minikube ingress: 25.1s 25.1s 24.6s 29.6s 29.6s
Times for minikube (PR 14903) ingress: 29.6s 30.1s 25.6s 25.1s 28.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14903) |
+----------------+----------+---------------------+
| minikube start | 28.4s    | 28.7s               |
| enable ingress | 22.5s    | 23.0s               |
+----------------+----------+---------------------+

Times for minikube (PR 14903) start: 29.1s 26.7s 28.2s 31.4s 27.8s
Times for minikube start: 28.8s 26.9s 28.0s 27.8s 30.3s

Times for minikube ingress: 20.4s 23.4s 22.9s 22.0s 23.9s
Times for minikube (PR 14903) ingress: 22.4s 22.5s 22.0s 25.9s 22.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14903) |
+----------------+----------+---------------------+
| minikube start | 23.5s    | 23.7s               |
| enable ingress | 27.0s    | 27.1s               |
+----------------+----------+---------------------+

Times for minikube start: 23.2s 23.3s 23.8s 23.5s 23.7s
Times for minikube (PR 14903) start: 23.5s 24.0s 24.1s 23.7s 23.3s

Times for minikube ingress: 26.5s 27.4s 27.4s 26.9s 26.9s
Times for minikube (PR 14903) ingress: 27.4s 27.0s 26.9s 27.4s 26.9s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Hyper-V_Windows TestErrorSpam/setup (gopogh) 5.97 (chart)
Hyperkit_macOS TestFunctional/parallel/DashboardCmd (gopogh) 11.56 (chart)
Docker_Windows TestAddons/Setup (gopogh) 47.86 (chart)
Docker_Windows TestCertExpiration (gopogh) 47.86 (chart)
Docker_Windows TestCertOptions (gopogh) 47.86 (chart)
Docker_Windows TestDockerFlags (gopogh) 47.86 (chart)
Docker_Windows TestErrorSpam/setup (gopogh) 47.86 (chart)
Docker_Windows TestForceSystemdEnv (gopogh) 47.86 (chart)
Docker_Windows TestForceSystemdFlag (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/CertSync (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/CpCmd (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/DockerEnv/powershell (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/FileSync (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageBuild (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListJson (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListShort (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListTable (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListYaml (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageLoadDaemon (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageLoadFromFile (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageReloadDaemon (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageSaveDaemon (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageSaveToFile (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageTagAndLoadDaemon (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/Setup (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/MySQL (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/NodeLabels (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/NonActiveRuntimeDisabled (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/PersistentVolumeClaim (gopogh) 47.86 (chart)
Docker_Windows TestFunctional/parallel/SSHCmd (gopogh) 47.86 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@Jancis
Copy link
Contributor Author

Jancis commented Sep 13, 2022

Sure @spowelljr , btw I can convert this one to implement LegacyPodSecurityPolicy to follow the the code style and do less processing in template if You prefer that.
I briefly scrolled over couple test outputs, does not seem like it gets stuck on metallb in particular, so i guess this requires #14848 to succeed first.

@spowelljr
Copy link
Member

spowelljr commented Sep 13, 2022

If you could convert it to LegacyPodSecurityPolicy that would be great. If someone unfamiliar is looking though the yaml file LegacyPodSecurityPolicy gives them more context on why the conditional is there over Kubernetes version conditionals.

I don't believe we have any MetalLB integration tests so that's likely why you're not seeing failures related to MetalLB in the test outputs.

We want to release minikube v1.27 this week, and we're just waiting for my k8s v1.25 PR to be merged before releasing, so if you could implement the above at your earliest convenience that would be awesome, thanks!

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 14, 2022
@spowelljr
Copy link
Member

We want to go for release today so I pushed the talked about changes to this PR

Copy link
Contributor

@klaases klaases left a comment

Choose a reason for hiding this comment

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

Great way to improve security with backwards compatibility.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Jancis, klaases
Once this PR has been reviewed and has the lgtm label, please assign medyagh for approval by writing /assign @medyagh in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@spowelljr spowelljr merged commit faed0ec into kubernetes:master Sep 14, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14903) |
+----------------+----------+---------------------+
| minikube start | 56.0s    | 57.2s               |
| enable ingress | 28.4s    | 27.7s               |
+----------------+----------+---------------------+

Times for minikube start: 54.1s 56.1s 56.8s 57.8s 55.3s
Times for minikube (PR 14903) start: 58.4s 57.0s 57.4s 56.9s 56.4s

Times for minikube ingress: 29.1s 28.7s 25.1s 28.6s 30.6s
Times for minikube (PR 14903) ingress: 29.2s 26.2s 28.6s 28.6s 26.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14903) |
+----------------+----------+---------------------+
| minikube start | 28.3s    | 27.5s               |
| enable ingress | 22.8s    | 22.7s               |
+----------------+----------+---------------------+

Times for minikube ingress: 22.5s 23.4s 23.5s 22.5s 22.0s
Times for minikube (PR 14903) ingress: 22.5s 21.5s 23.0s 22.5s 24.0s

Times for minikube start: 27.2s 27.7s 28.0s 28.1s 30.7s
Times for minikube (PR 14903) start: 27.0s 28.1s 27.3s 28.3s 26.9s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14903) |
+----------------+----------+---------------------+
| minikube start | 26.8s    | 24.3s               |
| enable ingress | 27.0s    | 27.3s               |
+----------------+----------+---------------------+

Times for minikube (PR 14903) start: 23.9s 26.7s 23.6s 24.1s 23.5s
Times for minikube start: 26.3s 23.4s 26.5s 34.7s 23.4s

Times for minikube ingress: 27.4s 27.0s 26.9s 27.0s 26.9s
Times for minikube (PR 14903) ingress: 27.5s 27.5s 27.0s 27.0s 27.5s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux TestMultiNode/serial/RestartMultiNode (gopogh) 50.00 (chart)
Docker_Linux TestNetworkPlugins/group/calico/NetCatPod (gopogh) 70.00 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/bridge/DNS (gopogh) 81.10 (chart)
Docker_Linux TestNetworkPlugins/group/kubenet/DNS (gopogh) 90.97 (chart)
Docker_macOS TestDownloadOnly/v1.16.0/preload-exists (gopogh) 98.69 (chart)
Docker_Linux_containerd TestKubernetesUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddons (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressDNSAddonActivation (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 100.00 (chart)
Docker_macOS TestKubernetesUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestMissingContainerUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestNetworkPlugins/group/kubenet/HairPin (gopogh) 100.00 (chart)
Docker_macOS TestPause/serial/VerifyStatus (gopogh) 100.00 (chart)
Docker_macOS TestPreload (gopogh) 100.00 (chart)
Docker_macOS TestRunningBinaryUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/Pause (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/Pause (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/newest-cni/serial/Pause (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/no-preload/serial/Pause (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/AddonExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/DeployApp (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/EnableAddonWhileActive (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/FirstStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/SecondStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/UserAppExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStoppedBinaryUpgrade/Upgrade (gopogh) 100.00 (chart)
Hyperkit_macOS TestNetworkPlugins/group/kubenet/HairPin (gopogh) 100.00 (chart)
KVM_Linux_containerd TestStoppedBinaryUpgrade/Upgrade (gopogh) 100.00 (chart)
KVM_Linux TestNetworkPlugins/group/kubenet/HairPin (gopogh) 100.00 (chart)

To see the flake rates of all tests by environment, click here.

@Jancis
Copy link
Contributor Author

Jancis commented Sep 15, 2022

Thanks @spowelljr for adjusting the code and getting the fix in. 1.27 is going to be awesome!

@klaases
Copy link
Contributor

klaases commented Sep 16, 2022

Hi @Jancis minikube v.1.27.0 is now available!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants