Skip to content

HostPID integration - #4712

Merged
openshift-bot merged 7 commits into
openshift:masterfrom
pweil-:scc-pid
Oct 14, 2015
Merged

openshift-bot merged 7 commits into
openshift:masterfrom
pweil-:scc-pid

Conversation

@pweil-

@pweil- pweil- commented Sep 17, 2015

Copy link
Copy Markdown

Contains:

  1. upstream patch for the HostPID support
  2. v1beta3 carry for adding HostPID to v1beta3 api
  3. the basic integration of the new admission controller
  4. integration with old school SCCs - pending movement on the upstream PSP proposal

@liggitt @deads2k @pmorie @smarterclayton PTAL

@Kargakis - FYI, hope this does mess up the rebase too bad if it goes in first, just didn't want to sit on it. Let me know if you need assistance with anything that comes up related to HostPID or the DenyEscalatingExec admission controller.

@deads2k

deads2k commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

@Kargakis - FYI, hope this does mess up the rebase too bad if it goes in first, just didn't want to sit on it. Let me know if you need assistance with anything that comes up related to HostPID or the DenyEscalatingExec admission controller.

Is this important enough to get in ahead of the rebase? We only did #4703 because it prevented making connections to the server.

@pweil-

pweil- commented Sep 17, 2015

Copy link
Copy Markdown
Author

Is this important enough to get in ahead of the rebase? We only did #4703 because it prevented making connections to the server.

No, and I'm happy to rebase it after the rebase. Just didn't want to sit on it while it was fresh in my head. Reviews still welcome, not much will change in the Origin pieces.

@liggitt

liggitt commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

I wouldn't want this halfway in (exposed but not protected by SCC)

@pweil-

pweil- commented Sep 17, 2015

Copy link
Copy Markdown
Author

I wouldn't want this halfway in (exposed but not protected by SCC)

fine by me. I need to work out the SCC piece anyway, I'll just lump it in here. It will be fairly small since it's just a boolean field.

If the upstream commit doesn't move for PSP I'll have to integrate it into that PR as well anyways but it's already huge.

@liggitt

liggitt commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

Keep the SCC bit in a separate commit, but in this PR is fine

@pweil-

pweil- commented Sep 17, 2015

Copy link
Copy Markdown
Author
[vagrant@openshiftdev pidtests]$ oc whoami
system:admin
[vagrant@openshiftdev pidtests]$ oc create -f pid.yaml 
pod "pid" created

[vagrant@openshiftdev pidtests]$ docker inspect 50c7 | grep Pid
        "PidMode": "host",
        "Pid": 31264,

[vagrant@openshiftdev pidtests]$ oc exec pid -- ps -ef | grep openshift
Error from server: Pod "Unknown" is forbidden: Cannot exec into or attach to a container using host pid

[vagrant@openshiftdev pidtests]$ docker exec 50c7 ps -ef | grep openshift
root     30776  1467  0 18:54 ?        00:00:00 sudo /data/src/github.com/openshift/origin/_output/local/go/bin/openshift --loglevel=4 start --latest-images=true --volume-dir=/tmp/origin.local.volumes
root     30777 30776 13 18:54 ?        00:00:24 /data/src/github.com/openshift/origin/_output/local/go/bin/openshift --loglevel=4 start --latest-images=true --volume-dir=/tmp/origin.local.volumes
1000     31335  9985  0 18:57 ?        00:00:00 grep --color=auto openshift

[vagrant@openshiftdev pidtests]$ oc whoami
test
[vagrant@openshiftdev pidtests]$ oc create -f pid.yaml 
Error from server: error when creating "pid.yaml": Pod "pid" is forbidden: unable to validate against any security context constraint: [provider restricted: .spec.containers[0].securityContext.hostPID: invalid value 'true', Details: Host PID is not allowed to be used]

@pmorie

pmorie commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

provider restricted: .spec.containers[0].securityContext.hostPID

@pweil- Why is this on a container's security context?

@pweil-

pweil- commented Sep 17, 2015

Copy link
Copy Markdown
Author

@pweil- Why is this on a container's security context?

The admission controller is receiving an error from the provider lumping them all together with:

append(errs, provider.ValidateSecurityContext(pod, &c).Prefix(fmt.Sprintf("spec.containers[%d].securityContext", i))...)

It would have to inspect the error to determine whats in the SC vs. what isn't. Or perhaps it shouldn't even try and just return whatever it gets.

@pweil-

pweil- commented Sep 17, 2015

Copy link
Copy Markdown
Author

Yes, I like the idea of letting the admission controller not worry about it after giving it a quick test. I'll take that as a follow up since it is related more to the overall SCC/PSP provider. I'll want to make all the errors in there a bit more specific as to where the field comes from.

@smarterclayton

Copy link
Copy Markdown
Contributor

Can we land your downstream PSP and mark it experimental? We can always
drop it prior to 1.1

On Sep 17, 2015, at 2:29 PM, Paul Weil [email protected] wrote:

I wouldn't want this halfway in (exposed but not protected by SCC)

fine by me. I need to work out the SCC piece anyway, I'll just lump it in
here. It will be fairly small since it's just a boolean field.

If the upstream commit doesn't move for PSP I'll have to integrate it into
that PR as well anyways but it's already huge.

—
Reply to this email directly or view it on GitHub
#4712 (comment).

@pweil-

pweil- commented Sep 17, 2015

Copy link
Copy Markdown
Author

Can we land your downstream PSP and mark it experimental? We can always
drop it prior to 1.1

I guess it depends on what you mean by marking it experimental. SCC is not experimental now so that seems like a regression.

I'm mostly worried about maintaining backwards compatibility if we move SCC -> PSP downstream. In the current PR I'm doing a conversion from SCC->PSP in a proxy storage impl. If the PSP api upstream changes then we'll need PSP (OS) -> PSP (Kube) as well if we want 100% backwards compat.

The other option is to continue to carry SCC until PSP lands upstream. We'll still need the SCC->PSP conversion anyway but it would eliminate the possibility of a second conversion. I really have my fingers crossed that upstream will accept the current proposal in their exp api.

@smarterclayton

Copy link
Copy Markdown
Contributor

SCC would be converted and not experimental. We have to carry SCC for a
while now, so your code is going to be required for a long time. I just
want to ensure that we have a path forward before the end of this sprint.

On Thu, Sep 17, 2015 at 3:55 PM, Paul Weil [email protected] wrote:

Can we land your downstream PSP and mark it experimental? We can always
drop it prior to 1.1

I guess it depends on what you mean by marking it experimental. SCC is not
experimental now so that seems like a regression.

I'm mostly worried about maintaining backwards compatibility if we move
SCC -> PSP downstream. In the current PR I'm doing a conversion from
SCC->PSP in a proxy storage impl. If the PSP api upstream changes then
we'll need PSP (OS) -> PSP (Kube) as well if we want 100% backwards compat.

The other option is to continue to carry SCC until PSP lands upstream.
We'll still need the SCC->PSP conversion anyway but it would eliminate the
possibility of a second conversion. I really have my fingers crossed that
upstream will accept the current proposal in their exp api.

—
Reply to this email directly or view it on GitHub
#4712 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@smarterclayton

Copy link
Copy Markdown
Contributor

The experimental PSP in origin we could nuke without warning if it was so
marked

On Thu, Sep 17, 2015 at 5:09 PM, Clayton Coleman [email protected]
wrote:

SCC would be converted and not experimental. We have to carry SCC for a
while now, so your code is going to be required for a long time. I just
want to ensure that we have a path forward before the end of this sprint.

On Thu, Sep 17, 2015 at 3:55 PM, Paul Weil [email protected]
wrote:

Can we land your downstream PSP and mark it experimental? We can always
drop it prior to 1.1

I guess it depends on what you mean by marking it experimental. SCC is
not experimental now so that seems like a regression.

I'm mostly worried about maintaining backwards compatibility if we move
SCC -> PSP downstream. In the current PR I'm doing a conversion from
SCC->PSP in a proxy storage impl. If the PSP api upstream changes then
we'll need PSP (OS) -> PSP (Kube) as well if we want 100% backwards compat.

The other option is to continue to carry SCC until PSP lands upstream.
We'll still need the SCC->PSP conversion anyway but it would eliminate the
possibility of a second conversion. I really have my fingers crossed that
upstream will accept the current proposal in their exp api.

—
Reply to this email directly or view it on GitHub
#4712 (comment).

Clayton Coleman | Lead Engineer, OpenShift

Clayton Coleman | Lead Engineer, OpenShift

@pweil-

pweil- commented Sep 18, 2015

Copy link
Copy Markdown
Author

Ok, I think I'm on the same page. I think what I have in the other PR works then. I'll try to break it up to reduce the eye bleeding reviews into PRs for

  1. straight conversion from kube SCC -> OS SCC
  2. OS PSP type with conversion to SCC (all components still working with SCC but PSP api is introduced)
  3. Change of the admission/bootstrap/etc to use the OS PSP type

@pweil-

pweil- commented Oct 6, 2015

Copy link
Copy Markdown
Author

This is cleaned up and rebased with support for host ipc and host pid. I would like to get this reviewed and merged regardless of the state of an experimental PSP object. This provides functionality while the PSP object just gets us closer to the proposal upstream and isn't crucial.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this being removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

deprecated upstream in favor of DenyEscalatingExec which is covered by the line below (which also registers itself under the old plugin name)

@pmorie

pmorie commented Oct 6, 2015

Copy link
Copy Markdown
Contributor

LGTM

@pmorie

pmorie commented Oct 6, 2015

Copy link
Copy Markdown
Contributor

[test]

@openshift-bot

Copy link
Copy Markdown
Contributor

@pweil-
pweil- force-pushed the scc-pid branch 3 times, most recently from 10cee5a to 8384736 Compare October 7, 2015 16:46
@deads2k

deads2k commented Oct 7, 2015

Copy link
Copy Markdown
Contributor

jenkins issue re[test]

@pweil-

pweil- commented Oct 8, 2015

Copy link
Copy Markdown
Author

bump for reviews. I'd like to get this in since the PSP types is still under heavy review. Travis seemed to be failing on an unrelated command in test-cmd. Rebased to see if that fixes.

[test]

@smarterclayton

Copy link
Copy Markdown
Contributor

API changes arenapproved

@pweil-

pweil- commented Oct 8, 2015

Copy link
Copy Markdown
Author

@pmorie @deads2k - please take another pass? The commits are in pretty digestible chunks

@pweil-

pweil- commented Oct 9, 2015

Copy link
Copy Markdown
Author

tagging some extra reviewers @soltysh @miminar

@smarterclayton

Copy link
Copy Markdown
Contributor

This is LGTM [merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3614/) (Image: devenv-fedora_2464)

@pmorie

pmorie commented Oct 9, 2015

Copy link
Copy Markdown
Contributor

Looks like jenkins flaked and this LGTM

[merge]

@pweil-

pweil- commented Oct 12, 2015

Copy link
Copy Markdown
Author

This appears to have flaked again. I am going to rebase it and re-run the tests locally, I have been unable to reproduce the failures.

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 7b91814

@pweil-

pweil- commented Oct 13, 2015

Copy link
Copy Markdown
Author

@pmorie another unrelated k8s flake, seen this one before:

2015/10/13 05:00:43 http: panic serving 127.0.0.1:60159: bad read
goroutine 52 [running]:
net/http.func·011()
    /usr/local/go/src/net/http/server.go:1130 +0xcc
github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream.(*errorReader).Read(0xc2080882c0, 0xc20813c800, 0x800, 0x800, 0xc208086ae0, 0x0, 0x0)
    /home/travis/gopath/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream/stream_test.go:151 +0x129
github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream.messageCopy(0xc208084090, 0x2aba79740200, 0xc2080882c0, 0xc208080000, 0x0, 0x0, 0x0)
    github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream/_test/_obj_test/stream.go:105 +0x2aa
github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream.(*Reader).handle(0xc208044ff0, 0xc208084090)
    github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream/_test/_obj_test/stream.go:79 +0x2c6
github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream.func·009(0xc208084090)
    /home/travis/gopath/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream/stream_test.go:171 +0x1aa
golang.org/x/net/websocket.Server.serveWebSocket(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa2fcc8, ...)
    /home/travis/gopath/src/github.com/openshift/origin/Godeps/_workspace/src/golang.org/x/net/websocket/server.go:89 +0x2db
golang.org/x/net/websocket.Handler.ServeHTTP(0xc2080866a0, 0x2aba7973fd28, 0xc208075040, 0xc20801e680)
    /home/travis/gopath/src/github.com/openshift/origin/Godeps/_workspace/src/golang.org/x/net/websocket/server.go:112 +0x9b
net/http/httptest.(*waitGroupHandler).ServeHTTP(0xc208086820, 0x2aba7973fd28, 0xc208075040, 0xc20801e680)
    /usr/local/go/src/net/http/httptest/server.go:200 +0xf8
net/http.serverHandler.ServeHTTP(0xc2080306c0, 0x2aba7973fd28, 0xc208075040, 0xc20801e680)
    /usr/local/go/src/net/http/server.go:1703 +0x1f7
net/http.(*conn).serve(0xc208074e60)
    /usr/local/go/src/net/http/server.go:1204 +0x1088
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:1751 +0x3cd
--- FAIL: TestStreamClosedDuringRead-2 (0.24s)
    stream_test.go:131: unexpected server read: []
FAIL
coverage: 70.5% of statements
FAIL    github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/wsstream   0.729s

@pweil- pweil- closed this Oct 13, 2015
@pweil- pweil- reopened this Oct 13, 2015
@pmorie

pmorie commented Oct 14, 2015

Copy link
Copy Markdown
Contributor

Light is green, trap is clean, I ain't afraid of no 👻

[merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 7b91814

openshift-bot pushed a commit that referenced this pull request Oct 14, 2015
Merged by openshift-bot
@openshift-bot
openshift-bot merged commit 825dfc8 into openshift:master Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants