-
Notifications
You must be signed in to change notification settings - Fork 881
Writable API proposal #2879
Comments
Something like this would make implementing something like docker for mac or boot2docker but for rkt much easier! |
I'm not sure that a global config object should accompany each request. For this like auth for fetch and stage1 for prepare, it does make sense to provide those optoins, but I don't think they have to be part of the same larger config struct. Some options, like data dir, I don't think there's really a need to vary per api-service instance. It also might be nice to have some discussion about how the service will behave with respect to privileges; could I run it with user privileges and a data-dir I own, and then only be able to fetch, but not run? |
This will probably deserve its own issue but I'd like to use this as a starting point. I think this will actually map to the current rkt command line in this way:
I think that in future the current semantic will change (how to handle backward compatibility?), some examples:
In future the idea will be to directly fetch oci refs and blobs (and docker v2.1 and v2.2 formats can be converted to this) in a dedicated oci local store (that's is quite different than the current aci store given the differences between the two specs), render to an oci runtime bundle and execute (or as a first step convert it to a rendered aci converting the oci config to an aci manifest) (#2541), this won't probably work with v1 registries (so docker2aci will be needed for these) since they aren't content addressable but uses imageID for every layer. The main question is that oci image spec doesn't cover distribution but only image format since in future there may be different kind of distributions (not only the docker registry) for oci images. I'm not sure if using specific shemes ( This choice will reflect on the rkt command line and this API.
That's a good point. I can't say if the required work is worth the effort but at least it can be useful to clarify some questions like the above. |
This looks like a major design point, departing quite a bit from the current status quo. Where do you plan to expose this interface? I see a comment related to TLS, so I guess some kind of network socket; if so how do you plan to do authn/authz there? And how should we map it to the current POSIX permissions model we are using? |
This really troubles me - I don't understand the win here. We shouldn't design and implement an API knowing it's imminently going to be deprecated.
Is there evidence that this is causing issues today?
Can you explain how this would simplify kubelet_wrapper?
How does a writeable API help with this? |
I agree, the argument is those APIs can be usable by other systems as well (true?), although in this proposal, I suggest we implement the onces used by k8s first.
See below.
See #2878
If all the commands go through API service, then we can just profile the API service to get the CPU / memory metrics. Otherwise, say 100 pods is launched, then it will at least generate 100 profiles. |
This is a good concern, we will need to face it anyway when a writable API (either pod level or container level) is going to be implemented. On the realistic side, the kubelet is running as root today anyway, so in practice we don't lose much, and I am not sure we should dig into the authn/authz rabbit hole at this point? |
@sgotti Thanks for the input! So my understand of your concern is that only |
Yeah, basically I'm not sure which is the best way to define what image format/type and distribution to use, so I'm not sure if just a string (with specific scheme) will be enough for both. Will open a new issue on this. IMHO ImageFormat sound strange to define both format and distribution but I'm not sure about a better name. |
@sgotti Or ImageSpec. But that will break current API. |
If we expect this API to be used by anything other than rktnetes, we shouldn't add and deprecate things based on k8s needs. However, if we expect this API to be a rktnetes specific api, we should develop it in a separate repository (probably a k8s one) and feel free to do whatever adding/removing as is needed in the k8s code, and tie it closely to k8s releases. Are we trying to make:
Based on the goals, it looks more like 2, and it's possible this should live as part of the k8s project instead. I'd personally prefer to do 1 if we can, though 1 I think also implies we need to consider what this API looks like a little bit more. Opinions? |
For more context: The goal of having this API is to implement the Kubernetes CRI. Essentially the Kubelet wants a way of separating itself from the details of the container fetching and execution and instead focus on a handful of things like: log curation, pod cgroup setup, managing volumes, and managing networking (maybe). This is in-line with the overall goal of making Kubernetes less of a monolith and easier to hack on. Some alternative ways of tackling this that could be considered:
Overall, rkt is doing two things:
Hope that helps set the stage. |
@philips Sorry for not being clear. The writable API proposed here (which is still on pod level that aligns with the rkt cli) is not targeted for the k8s CRI (operated on container level). The benefits for this pod level API would be:
|
Can we add some field in the |
Uh oh!
There was an error while loading. Please reload this page.
Goals
Non-goals
Implement container runtime level interface
Design
First, take a look at the rkt shell-outs we currently have:
rkt fetch
rkt prepare --pod-manifest
rkt rm
rkt image rm
rkt enter
These are the commands we want in short term, other APIs we probably want to have are:
rkt gc
rkt run
rkt trust
Besides, since we would want systemd to parent the rkt process (by
rkt run-prepared
today), sorkt run-prepared
can be left out in the first pass as well.Also for
rkt prepare
, we could just implement the--pod-manifest
for now.Here is a draft for the protobuf definition we will add.
Consideration
Plan
cc @coreos/rkt-maintainers @coreos/rkt-engineering
The text was updated successfully, but these errors were encountered: