You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -158,8 +160,13 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
158
160
159
161
## Summary
160
162
161
-
The proposed enhancement adds a new `VolumeSource` to Kubernetes that supports OCI images and/or OCI artifacts. This allows users to package files
162
-
and share them among containers in a pod without including a shell in the image, thereby reducing vulnerabilities and simplifying image creation.
163
+
The proposed enhancement adds a new `VolumeSource` to Kubernetes that supports OCI images and/or OCI artifacts.
164
+
This allows users to package files and share them among containers in a pod without including a shell in the image,
165
+
thereby reducing vulnerabilities and simplifying image creation.
166
+
167
+
While OCI images are well-supported by Kubernetes and CRI,
168
+
extending support to OCI artifacts involves recognizing additional media types, implementing custom lifecycle management,
169
+
and ensuring appropriate validation and security measures.
163
170
164
171
## Motivation
165
172
@@ -208,17 +215,37 @@ efficient model deployment.
208
215
- The implementation must handle image pull secrets and other registry authentication mechanisms.
209
216
- Performance considerations must be taken into account, especially for large images or artifacts.
210
217
218
+
### Vocabulary: OCI Images, Artifacts, and Objects
219
+
220
+
**1. OCI Image:**
221
+
- A container image that conforms to the Open Container Initiative (OCI) Image Specification.
222
+
It includes a filesystem bundle and metadata required to run a container.
223
+
- Consists of multiple layers (each layer being a tarball), a manifest (which lists the layers), and a config file
224
+
(which provides configuration data such as environment variables, entry points, etc.).
225
+
-**Use Case:** Used primarily for packaging and distributing containerized applications.
226
+
227
+
**2. OCI Artifact:**
228
+
- An artifact describes any content that is stored and distributed using the OCI image format.
229
+
It includes not just container images but also other types of content like Helm charts, WASM modules, machine learning models, etc.
230
+
- Artifacts use the same image manifest and layer structure but may contain different types of data
231
+
within those layers. The artifact manifest can have media types that differ from those in standard container images.
232
+
-**Use Case:** Allows the distribution of non-container content using the same infrastructure and tools developed for OCI images.
233
+
234
+
**3. OCI Object:**
235
+
- Umbrella term encompassing both OCI images and OCI artifacts. It represents any object that conforms to the OCI specifications for storage and distribution.
236
+
211
237
### Risks and Mitigations
212
238
213
239
-**Security Risks:** Allowing direct mounting of OCI images introduces potential attack vectors. Mitigation includes thorough security reviews and
214
-
limiting access to trusted registries.
240
+
limiting access to trusted registries. Limiting to OCI artifacts (non-runnable content) or read-only mode may lessen the security risk.
215
241
-**Compatibility Risks:** Ensure compatibility with existing features.
216
242
-**Performance Risks:** Large images or artifacts could impact performance. Mitigation includes optimizations in the implementation and providing
217
243
guidance on best practices for users.
218
244
219
245
## Design Details
220
246
221
-
The new `VolumeSource` will be defined in the Kubernetes API, and the implementation will involve updating the Kubernetes control plane components to support this source type. Key design aspects include:
247
+
The new `VolumeSource` will be defined in the Kubernetes API, and the implementation will involve updating components (CRI, Kubelet, Scheduler)
248
+
to support this source type. Key design aspects include:
222
249
223
250
- API changes to introduce the new `VolumeSource` type.
224
251
- Modifications to the Kubelet to handle mounting OCI images and artifacts.
@@ -249,6 +276,29 @@ spec:
249
276
name: oci-volume
250
277
```
251
278
279
+
### Kubelet and CRI support for OCI artifacts
280
+
281
+
Kubelet and the Container Runtime Interface (CRI) currently handle OCI images. To support OCI artifacts,
282
+
potential enhancements may be required:
283
+
284
+
**1. Extended Media Type Handling:**
285
+
- Update Kubelet and CRI to recognize and handle new media types associated with OCI artifacts.
286
+
- Ensure that pulling and storing these artifacts is as efficient and secure as with OCI images.
287
+
288
+
**2. Lifecycling and garbage collection:**
289
+
- Implement custom logic for managing the lifecycle of various OCI artifacts (e.g., loading a model into memory,
290
+
preparing a Helm chart for deployment).
291
+
292
+
**3. Artifact-Specific Configuration:**
293
+
- Introduce new configuration options or CRD to handle the unique requirements of different types of OCI artifacts.
294
+
295
+
**4. Validation:**
296
+
- Extend validation and security checks to cover new artifact types.
297
+
298
+
**5. Storage Optimization:**
299
+
- Develop optimized storage solutions tailored for different artifact types,
300
+
potentially integrating with existing storage solutions or introducing new mechanisms.
301
+
252
302
### Test Plan
253
303
254
304
<!--
@@ -812,11 +862,10 @@ An out-of-tree CSI plugin can provide flexibility and modularity, but there are
812
862
### Advantages of In-Tree OCI VolumeSource
813
863
814
864
1. **Leverage Existing Mechanisms:**
815
-
- **No New Data Types or Objects:** The OCI VolumeSource leverages OCI objects, which are already a core part of the Kubernetes ecosystem.
816
-
This ensures consistency and reduces complexity, as no new data types or objects are introduced.
865
+
- **No New Data Types or Objects:** OCI images are already a core part of the Kubernetes ecosystem. Extending support for OCI artifacts, many of
866
+
the same mechanisms will be reused. This ensures consistency and reduces complexity, as both adhere to the same OCI image format.
817
867
- **Existing Lifecycle Management and Garbage Collection:** Kubernetes has efficient lifecycle management and garbage collection mechanisms for
818
-
volumes and container images. The in-tree OCI VolumeSource will utilizes these existing mechanisms, ensuring robust and reliable management
819
-
without re-implementing these features.
868
+
volumes and container images. The in-tree OCI VolumeSource will utilize these existing mechanisms.
820
869
821
870
2. **Integration with Kubernetes:**
822
871
- **Optimal Performance:** Deep integration with the scheduler and kubelet ensures optimal performance and
0 commit comments