@@ -234,14 +234,29 @@ message PodSandboxConfig {
234
234
repeated PortMapping port_mappings = 5 ;
235
235
// Key-value pairs that may be used to scope and select individual resources.
236
236
map <string , string > labels = 6 ;
237
- // Annotations is an unstructured key value map that may be set by external
238
- // tools to store and retrieve arbitrary metadata. There are a few features are
239
- // driven by annotations, Runtimes could support them optionally:
237
+ // Unstructured key-value map that may be set by the kubelet to store and
238
+ // retrieve arbitrary metadata. This will include any annotations set on a
239
+ // pod through the Kubernetes API.
240
+ //
241
+ // Annotations MUST NOT be altered by the runtime; the annotations stored
242
+ // here MUST be returned in the PodSandboxStatus associated with the pod
243
+ // this PodSandboxConfig creates.
244
+ //
245
+ // In general, in order to preserve a well-defined interface between the
246
+ // kubelet and the container runtime, annotations SHOULD NOT influence
247
+ // runtime behaviour. For legacy reasons, there are some annotations which
248
+ // currently explicitly break this rule, listed below; in future versions
249
+ // of the interface these will be promoted to typed features.
250
+ //
251
+ // Annotations can also be useful for runtime authors to experiment with
252
+ // new features that are opaque to the Kubernetes APIs (both user-facing
253
+ // and the CRI). Whenever possible, however, runtime authors SHOULD
254
+ // consider proposing new typed fields for any new features instead.
240
255
//
241
256
// 1. AppArmor
242
257
//
243
258
// key: container.apparmor.security.beta.kubernetes.io/<container_name>
244
- // description: apparmor profile for the container.
259
+ // description: apparmor profile for a container in this pod .
245
260
// value:
246
261
// * runtime/default: equivalent to not specifying a profile.
247
262
// * localhost/<profile_name>: profile loaded on the node
@@ -255,8 +270,8 @@ message PodSandboxConfig {
255
270
// value: see below.
256
271
//
257
272
// key: security.alpha.kubernetes.io/seccomp/container/<container name>
258
- // description: the seccomp profile for the container (overides pod).
259
- // values : see below
273
+ // description: the seccomp profile for the container (overrides pod).
274
+ // value : see below
260
275
//
261
276
// The value of seccomp is runtime agnostic:
262
277
// * runtime/default: the default profile for the container runtime
@@ -348,10 +363,12 @@ message PodSandboxStatus {
348
363
optional PodSandboxNetworkStatus network = 5 ;
349
364
// Linux-specific status to a pod sandbox.
350
365
optional LinuxPodSandboxStatus linux = 6 ;
351
- // Labels are key value pairs that may be used to scope and select individual resources.
366
+ // Labels are key- value pairs that may be used to scope and select individual resources.
352
367
map <string , string > labels = 7 ;
353
- // Annotations is an unstructured key value map that may be set by external
354
- // tools to store and retrieve arbitrary metadata.
368
+ // Unstructured key-value map holding arbitrary metadata.
369
+ // Annotations MUST NOT be altered by the runtime; the value of this field
370
+ // MUST be identical to that of the corresponding PodSandboxConfig used to
371
+ // instantiate the pod sandbox this status represents.
355
372
map <string , string > annotations = 8 ;
356
373
}
357
374
@@ -391,8 +408,10 @@ message PodSandbox {
391
408
optional int64 created_at = 4 ;
392
409
// Labels of the PodSandbox.
393
410
map <string , string > labels = 5 ;
394
- // Annotations is an unstructured key value map that may be set by external
395
- // tools to store and retrieve arbitrary metadata.
411
+ // Unstructured key-value map holding arbitrary metadata.
412
+ // Annotations MUST NOT be altered by the runtime; the value of this field
413
+ // MUST be identical to that of the corresponding PodSandboxConfig used to
414
+ // instantiate this PodSandbox.
396
415
map <string , string > annotations = 6 ;
397
416
}
398
417
@@ -551,8 +570,16 @@ message ContainerConfig {
551
570
// prefix ::= DNS_SUBDOMAIN
552
571
// name ::= DNS_LABEL
553
572
map <string , string > labels = 9 ;
554
- // Annotations is an unstructured key value map that may be set by external
555
- // tools to store and retrieve arbitrary metadata.
573
+ // Unstructured key-value map that may be used by the kubelet to store and
574
+ // retrieve arbitrary metadata.
575
+ //
576
+ // Annotations MUST NOT be altered by the runtime; the annotations stored
577
+ // here MUST be returned in the ContainerStatus associated with the container
578
+ // this ContainerConfig creates.
579
+ //
580
+ // In general, in order to preserve a well-defined interface between the
581
+ // kubelet and the container runtime, annotations SHOULD NOT influence
582
+ // runtime behaviour.
556
583
map <string , string > annotations = 10 ;
557
584
// Path relative to PodSandboxConfig.LogDirectory for container to store
558
585
// the log (STDOUT and STDERR) on the host.
@@ -665,8 +692,10 @@ message Container {
665
692
optional int64 created_at = 7 ;
666
693
// Key-value pairs that may be used to scope and select individual resources.
667
694
map <string , string > labels = 8 ;
668
- // Annotations is an unstructured key value map that may be set by external
669
- // tools to store and retrieve arbitrary metadata.
695
+ // Unstructured key-value map holding arbitrary metadata.
696
+ // Annotations MUST NOT be altered by the runtime; the value of this field
697
+ // MUST be identical to that of the corresponding ContainerConfig used to
698
+ // instantiate this Container.
670
699
map <string , string > annotations = 9 ;
671
700
}
672
701
@@ -708,7 +737,10 @@ message ContainerStatus {
708
737
optional string message = 11 ;
709
738
// Key-value pairs that may be used to scope and select individual resources.
710
739
map <string ,string > labels = 12 ;
711
- // Annotations is an unstructured key value map.
740
+ // Unstructured key-value map holding arbitrary metadata.
741
+ // Annotations MUST NOT be altered by the runtime; the value of this field
742
+ // MUST be identical to that of the corresponding ContainerConfig used to
743
+ // instantiate the Container this status represents.
712
744
map <string ,string > annotations = 13 ;
713
745
// Mounts for the container.
714
746
repeated Mount mounts = 14 ;
0 commit comments