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

[WIP] admission/podsecuritypolicy: externalize podsecuritypolicy admission controller #67846

Closed
wants to merge 1 commit into from

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Aug 24, 2018

What this PR does / why we need it:

This PR is Work-in-Progress. Do not merge.

This PR addresses portion of #66680, by externalizing PodSecurityPolicy Admission controller.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Addresses portion of #66680.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 24, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xmudrii
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: liggitt

If they are not already assigned, you can assign the PR to them by writing /assign @liggitt in a comment when ready.

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

@@ -20,24 +20,24 @@ import (
"fmt"
"strings"

policyv1beta1 "k8s.io/api/policy/v1beta1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really required to move also PSP-related things to external API? Is it possible to move admission plugin alone?

Copy link
Member Author

@xmudrii xmudrii Aug 24, 2018

Choose a reason for hiding this comment

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

I may be wrong, but I think this is required. If I'm mistaken, please correct me.

For example, one of problems I had is this function. As lister is changed to external one, it now must take policyv1beta1 external type instead of internal type.

However, that function invokes psp.NewSimpleProvider, which takes internal policy type. Invoking this function with external policy causes type mismatch.

If I update psp.NewSimpleProvider to use external type, I must update all other related functions to use external type, or otherwise I'll run into a big number of issues and errors. And therefore, most of PSP-related things are moved to external type in this PR.

My guess is that this is okay. I'm unsure is there a better way.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sttts ^^^ Is it ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why should it be bad? As a rule of thumb: internal types should only be used in the registries, i.e. the serving part of the API server. The admission plugin though are normal consumers and should use the external types.

@sttts
Copy link
Contributor

sttts commented Aug 26, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 26, 2018
@k8s-ci-robot
Copy link
Contributor

@xmudrii: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-bazel-build ee8fd63 link /test pull-kubernetes-bazel-build
pull-kubernetes-e2e-gce ee8fd63 link /test pull-kubernetes-e2e-gce
pull-kubernetes-bazel-test ee8fd63 link /test pull-kubernetes-bazel-test
pull-kubernetes-e2e-gce-device-plugin-gpu ee8fd63 link /test pull-kubernetes-e2e-gce-device-plugin-gpu
pull-kubernetes-e2e-kops-aws ee8fd63 link /test pull-kubernetes-e2e-kops-aws
pull-kubernetes-typecheck ee8fd63 link /test pull-kubernetes-typecheck
pull-kubernetes-node-e2e ee8fd63 link /test pull-kubernetes-node-e2e
pull-kubernetes-kubemark-e2e-gce-big ee8fd63 link /test pull-kubernetes-kubemark-e2e-gce-big
pull-kubernetes-e2e-gce-100-performance ee8fd63 link /test pull-kubernetes-e2e-gce-100-performance
pull-kubernetes-integration ee8fd63 link /test pull-kubernetes-integration
pull-kubernetes-verify ee8fd63 link /test pull-kubernetes-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@php-coder
Copy link
Contributor

@stlaz JFYI

string(policyv1beta1.DownwardAPI),
string(policyv1beta1.FC),
string(policyv1beta1.ConfigMap),
//string(policyv1beta1.VsphereVolume),
Copy link
Member

Choose a reason for hiding this comment

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

obviously internal psp has some definitions which the external doesn't have. can we straightly copy these missing ones instead of commenting like this?

@php-coder is it intended? i think it should have been done in #61608 #54933.

Copy link
Member Author

Choose a reason for hiding this comment

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

The commenting here is just a workaround for test failures. 🙂

I'm not sure what to do with those, so I would appreciate any ideas. I think copying those to external could work, but I would like to get some approval first.

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I see the list of volumes types is just incomplete. Please create a commit filling it up with everything that is missing.

case v.ScaleIO != nil:
return policy.ScaleIO, nil
return policyv1beta1.AzureDisk, nil
//case v.PhotonPersistentDisk != nil:
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@xmudrii
Copy link
Member Author

xmudrii commented Oct 11, 2018

I will leave this PR on @yue9944882.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. 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.

5 participants