• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. Common Parameters
  5. Common Request Parameters

Common Request Parameters

Table 1 Request parameters of v1.ReplicationController

Name

Mandatory

Type

Description

kind

Yes

String

A string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.

The value of this parameter is ReplicationController.

apiVersion

Yes

String

Versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

The value of this parameter is v1.

metadata

Yes

Table 11

-

spec

Yes

Table 19

-

status

No

Table 20

-

Table 2 Request parameters of v1.PodTemplate

Name

Mandatory

Type

Description

kind

Yes

String

A string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.

The value of this parameter is PodTemplate.

apiVersion

Yes

String

Versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

The value of this parameter is v1.

metadata

Yes

Table 11

-

template

Yes

Table 21

-

Table 3 Request parameters of v1.Pod

Name

Mandatory

Type

Description

kind

Yes

String

A string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.

The value of this parameter is Pod.

apiVersion

Yes

String

Versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

The value of this parameter is v1.

metadata

Yes

Table 11

-

spec

Yes

Table 23

-

status

No

Table 4

-

Table 4 Data structure of the status field

Name

Mandatory

Type

Description

phase

No

String

Current condition of the pod.

conditions

No

Table 5

Current service state of the pod.

message

No

String

A human readable message indicating details about why the pod is in this condition.

reason

No

String

A brief CamelCase message indicating details about why the pod is in this state. For example, 'OutOfDisk'.

hostIP

No

String

IP address of the host to which the pod is assigned. Empty if not yet scheduled.

podIP

No

String

IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.

startTime

No

String

RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.

containerStatuses

No

Table 6

The list has one entry per container in the manifest. Each entry is currently the output of docker inspect.

Table 5 Data structure of the conditions field

Name

Mandatory

Type

Description

type

No

String

Type of the condition. Currently only Ready.

status

No

String

Status of the condition. Can be True, False, or Unknown.

lastProbeTime

No

String

Last time we probed the condition.

lastTransitionTime

No

String

Last time the condition transitioned from one status to another.

reason

No

String

Unique, one-word, CamelCase reason for the condition's last transition.

message

No

String

Human-readable message indicating details about last transition.

Table 6 Data structure of the containerStatuses field

Name

Mandatory

Type

Description

name

Yes

String

This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.

state

No

Table 7

-

lastState

No

Table 7

-

ready

No

Boolean

Whether the container has passed its readiness probe.

restartCount

No

Integer

The number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed. Note that this is calculated from dead containers. However, those containers are subject to garbage collection. This value will get capped at 5 by GC.

image

No

String

The image the container is running.

imageID

No

String

ID of the container's image.

containerID

No

String

Container's ID in the format 'docker://'.

Table 7 Data structure of the state/lastState field

Name

Mandatory

Type

Description

waiting

No

Table 8

-

running

No

Table 9

-

terminated

No

Table 10

-

Table 8 Data structure of the waiting field

Name

Mandatory

Type

Description

reason

No

String

(Brief) Reason the container is not yet running.

message

No

String

Message regarding why the container is not yet running.

Table 9 Data structure of the running field

Name

Mandatory

Type

Description

startedAt

No

String

Time at which the container was last (re-)started.

Table 10 Data structure of the terminated field

Name

Mandatory

Type

Description

startedAt

No

Integer

Exit status from the last termination of the container.

signal

No

Integer

Signal from the last termination of the container.

reason

No

String

(Brief) reason from the last termination of the container.

message

No

String

Message regarding the last termination of the container.

startedAt

No

String

Time at which previous execution of the container started.

finishedAt

No

String

Time at which the container last terminated.

containerID

No

String

Container's ID in the format 'docker://'

Table 11 Data structure of the metadata field

Name

Mandatory

Type

Description

name

Yes

String

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated.

0 characters < name length ≤ 253 characters.

The name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

clusterName

No

String

The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.

initializers

No

Table 12

An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects. When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user.

enable

No

Boolean

Enable identify whether the resource is available.

generateName

No

String

An optional prefix used by the server to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.

If this field is specified and the generated name exists, the server will NOT return a 409. Instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).

Applied only if Name is not specified.

0 characters < generated name length ≤ 253 characters.

The generated name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

namespace

No

String

Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.

0 characters < namespace length ≤ 63 characters.

The namespace must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

selfLink

No

String

A URL representing this object. Populated by the system. Read-only.

NOTE:

This field is automatically generated. Do not assign any value to this field. Otherwise, API calls would fail.

uid

No

String

UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. Populated by the system. Read-only.

NOTE:

This field is automatically generated. Do not assign any value to this field. Otherwise, API calls would fail.

resourceVersion

No

String

An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. Populated by the system. Read-only. Value must be treated as opaque by clients.

NOTE:

This field is automatically generated. Do not assign any value to this field. Otherwise, API calls would fail.

generation

No

Integer

A sequence number representing a specific generation of the desired state. Currently only implemented by replication controllers. Populated by the system. Read-only.

creationTimestamp

No

String

A timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists.

NOTE:

This field is automatically generated. Do not assign any value to this field. Otherwise, API calls would fail.

deletionTimestamp

No

String

RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource will be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet will send a hard termination signal to the container. If not set, graceful deletion of the object has not been requested. Populated by the system when a graceful deletion is requested. Read-only.

deletionGracePeriodSeconds

No

Integer

Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.

labels

Yes

Map[string]string

Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services.

annotations

No

Map[string]string

An unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.

ownerReferences

No

Table 18

List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.

finalizers

No

String array

Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.

Table 12 Data structure of the initializers field

Parameter

Mandatory

Type

Description

pending

No

Table 13

Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients.

result

No

Table 14

If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion.

Table 13 Data structure of the pending field

Parameter

Mandatory

Type

Description

name

No

String

name of the process that is responsible for initializing this object.

Table 14 Data structure of the result field

Parameter

Mandatory

Type

Description

apiVersion

Yes

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

code

No

Integer

Suggested HTTP return code for this status, 0 if not set.

details

No

Table 15

Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.

kind

Yes

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.

message

No

String

A human-readable description of the status of this operation.

metadata

Yes

Table 16

Standard list metadata.

reason

No

String

A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.

status

No

String

Status of the operation. One of: "Success" or "Failure".

Table 15 Data structure of the details field

Parameter

Mandatory

Type

Description

causes

No

Table 17

The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.

group

No

String

The group attribute of the resource associated with the status StatusReason.

kind

No

String

The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind.

name

No

String

The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).

retryAfterSeconds

No

Integer

If specified, the time in seconds before the operation should be retried.

uid

No

String

UID of the resource. (when there is a single resource which can be described).

Table 16 Data structure of the metadata field

Parameter

Mandatory

Type

Description

resourceVersion

No

String

String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only.

selfLink

No

String

SelfLink is a URL representing this object. Populated by the system. Read-only.

Table 17 Data structure of the causes field

Parameter

Mandatory

Type

Description

field

No

String

The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: "name" - the field "name" on the current resource "items[0].name" - the field "name" on the first array entry in "items"

message

No

String

A human-readable description of the cause of the error. This field may be presented as-is to a reader.

reason

No

String

A machine-readable description of the cause of the error. If this value is empty there is no information available.

Table 18 Data structure of the ownerReferences field

Name

Mandatory

Type

Description

apiVersion

Yes

String

API version of the referent.

blockOwnerDeletion

No

Boolean

If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.

kind

Yes

String

Kind of the referent.

name

Yes

String

Name of the referent.

uid

No

String

UID of the referent.

controller

No

Boolean

If true, this reference points to the managing controller.

Table 19 Data structure of the spec field

Name

Mandatory

Type

Description

replicas

No

Integer

The number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified.

Value range: ≥ 0.

Default: 1

minReadySeconds

No

Integer

Minimum number of seconds for which a newly created pod should be ready without any of its containers crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)

template

Yes

Table 21

-

selector

Yes

Map[string]string

A label query over pods that should match the Replicas count. If Selector is empty, it is defaulted to the labels present on the Pod template. Label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template.

Table 20 Data structure of the status field

Name

Mandatory

Type

Description

replicas

No

int32

The most recently observed number of replicas.

availableReplicas

No

Integer

The number of available replicas (ready for at least minReadySeconds) for this replication controller.

readyReplicas

No

Integer

The number of ready replicas for this replication controller.

conditions

No

Table 22

Represents the latest available observations of a replication controller's current state.

observedGeneration

No

int64

Reflects the generation of the most recently observed replication controller.

FullylabeledReplicas

No

Map[string]string

-

Table 21 Data structure of the template field

Name

Mandatory

Type

Description

metadata

Yes

Table 11

-

spec

Yes

Table 23

-

Table 22 Data structure of the condition field

Name

Mandatory

Type

Description

lastTransitionTime

No

Time

The last time the condition transitioned from one status to another.

message

No

String

A human readable message indicating details about the transition.

reason

No

String

The reason for the condition's last transition.

status

No

String

Status of the condition, one of True, False, Unknown.

type

No

String

Type of replication controller condition.

Table 23 Data structure of the spec field

Name

Mandatory

Type

Description

volumes

No

Table 24

List of volumes that can be mounted by containers belonging to the pod.

affinity

No

Table 52

If specified, the pod's scheduling constraints

containers

Yes

Table 25

List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a pod. Cannot be updated.

restartPolicy

No

String

Restart policy for all containers within the pod.

Value:

  • Always
  • OnFailure
  • Never

Default: Always.

terminationGracePeriodSeconds

No

Integer

Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be a non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.

activeDeadlineSeconds

No

Integer

Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.

Value range of this parameter: > 0.

dnsPolicy

No

String

Set DNS policy for containers within the pod.

Value:

  • ClusterFirst
  • Default

Default: ClusterFirst.

hostAliases

No

Table 63

HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.

serviceAccountName

No

String

Name of the ServiceAccount used to run this pod.

0 characters < service account name length ≤ 253 characters.

The service account name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

serviceAccount

No

String

DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.

schedulerName

No

String

If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.

nodeName

No

String

A request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.

0 characters < node name length ≤ 253 characters.

The node name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

nodeSelector

No

Object

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node.

automountServiceAccountToken

No

Boolean

AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.

hostNetwork

No

Boolean

Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default: false.

NOTE:

The hostport of the hostNetwork must be different from the containerport.

hostPID

No

Boolean

A flag indicating whether to use the host's pid namespace. Optional: Default: false.

hostIPC

No

Boolean

A flag indicating whether to use the host's ipc namespace. Optional: Default: false.

securityContext

No

Table 26

-

imagePullSecrets

No

Table 27

An optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored.

initContainers

No

Table 25

List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed.

hostname

No

String

Specifies the hostname of the Pod. If not specified, the pod's hostname will be set to a system-defined value.

subdomain

No

String

If specified, the fully qualified Pod hostname will be"<hostname>.<subdomain>.<pod namespace>.svc<cluster domain>". If not specified, the pod will not have a domainname at all.

tolerations

No

Table 67

If specified, the pod's tolerations.

Table 24 Data structure of the volumes field

Name

Mandatory

Type

Description

name

Yes

String

Volume name. Must be a DNS_LABEL and unique within the pod.

0 characters < volume name length ≤ 63 characters.

The volume name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

hostPath

No

Table 28

-

emptyDir

No

Table 29

-

secret

No

Table 30

-

nfs

No

Table 31

-

persistentVolumeClaim

No

Table 32

-

Table 25 Data structure of the containers field

Name

Mandatory

Type

Description

name

Yes

String

Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.

0 characters < container name length ≤ 63 characters.

The container name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

image

Yes

String

Docker image name.

command

No

Array[string]

Entrypoint array. Not executed within a shell. The docker image's entrypoint is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, for example, $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated.

args

No

Array[string]

Arguments to the entrypoint. The docker image's cmd is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, for example, $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated.

workingDir

No

String

Container's working directory. Defaults to Docker's default. Defaults to image's default. Cannot be updated.

ports

No

Table 34

List of ports to expose from the container. Cannot be updated.

env

No

Table 35

List of environment variables to set in the container. Cannot be updated.

envFrom

No

Table 64

List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

resources

No

Table 36

Minimum resources the volume should have.

volumeMounts

No

Table 37

Pod volumes to mount into the container's filesystem. Cannot be updated.

livenessProbe

No

Table 38

-

readinessProbe

No

Table 38

-

lifecycle

No

Table 39

-

terminationMessagePath

No

String

Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Defaults to /dev/termination-log. Cannot be updated.

imagePullPolicy

No

String

Image pull policy. Defaults to Always if the :latest tag is specified, or IfNotPresent otherwise. Cannot be updated.

Value:

  • Always
  • Never
  • IfNotPresent

securityContext

No

Table 40

-

stdin

No

Boolean

A flag indicating whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.

stdinOnce

No

Boolean

A flag indicating whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true, the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container process that reads from stdin will never receive an EOF. Default is false.

tty

No

Boolean

A flag indicating whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.

Table 26 Data structure of the securityContext field

Name

Mandatory

Type

Description

seLinuxOptions

No

Table 41

-

runAsUser

No

Integer

The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

Value length: > 0 characters.

runAsNonRoot

No

Boolean

Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

supplementalGroups

No

Array[int32]

A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.

fsGroup

No

int32

A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:

The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw.

Table 27 Data structure of the imagePullSecrets field

Name

Mandatory

Type

Description

name

No

String

Name of the referent.

Table 28 Data structure of the hostPath field

Name

Mandatory

Type

Description

path

No

String

Path of the directory on the host.

Table 29 Data structure of the emptyDir field

Name

Mandatory

Type

Description

medium

No

String

What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be an empty string (default) or Memory.

Table 30 Data structure of the secret field

Name

Mandatory

Type

Description

secretName

No

String

Name of a secret in the pod's namespace.

items

No

Table 33

If unspecified, each key-value pair in the Data field of the referenced. Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.

Table 31 Data structure of the nfs field

Name

Mandatory

Type

Description

server

No

String

Hostname or IP address of the NFS server.

path

No

String

Path that is exported by the NFS server.

readOnly

No

Boolean

readOnly here will force the NFS export to be mounted with read-only permissions.

Value:

  • true
  • false

Default: false.

Table 32 Data structure of the persistentVolumeClaim field

Name

Mandatory

Type

Description

claimName

No

String

Name of a PersistentVolumeClaim in the same namespace as the pod using this volume.

readOnly

No

Boolean

readOnly here will force the ReadOnly setting in VolumeMounts.

Value:

  • true
  • false

Default: false.

Table 33 Data structure of the items(KeyToPath) field

Name

Mandatory

Type

Description

key

No

String

The key to project.

path

No

String

The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.

Table 34 Data structure of the ports field

Name

Mandatory

Type

Description

name

No

String

If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.

0 characters < name length ≤ 15 characters.

The name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

hostPort

No

Integer

Number of the port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.

Value range: [1, 65535].

containerPort

No

Integer

Number of the port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.

Value range: [1, 65535].

protocol

No

String

Protocol for port.

Value:

  • TCP
  • UDP

Default: TCP.

hostIP

No

String

What host IP to bind the external port to.

Table 35 Data structure of the env field

Name

Mandatory

Type

Description

name

Yes

String

Name of the environment variable. Must be a C_IDENTIFIER.

value

No

String

Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, for example, $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".

valueFrom

No

Table 43

-

Table 36 Data structure of the resources field

Name

Mandatory

Type

Description

limits

No

object

Maximum amount of compute resources allowed.

requests

No

object

Minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value.

Table 37 Data structure of the volumeMounts field

Name

Mandatory

Type

Description

name

Yes

String

This must match the Name of a Volume.

0 characters < name length ≤ 253 characters.

The name must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?.

readOnly

No

Boolean

Mounted read-only if true, read-write otherwise (false or unspecified).

Value:

  • true
  • false

Default: false.

mountPath

No

String

Path within the container at which the volume should be mounted.

Value length: > 0 characters.

subPath

No

String

Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root).

Table 38 Data structure of the livenessProbe field

Name

Mandatory

Type

Description

exec

No

Table 44

-

httpGet

No

Table 45

-

tcpSocket

No

Table 46

-

initialDelaySeconds

No

Integer

Number of seconds after the container has started before liveness probes are initiated.

Value range: ≥ 0.

timeoutSeconds

No

Integer

Number of seconds after which the probe times out.

Value range: ≥ 0.

Default: 1.

periodSeconds

No

Integer

How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.

Value range: ≥ 0.

Default: 10.

successThreshold

No

Integer

Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness. Minimum value is 1.

Value range: ≥ 0.

Default: 1.

failureThreshold

No

Integer

Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.

Value range: ≥ 0.

Default: 3.

Table 39 Data structure of the lifecycle field

Name

Mandatory

Type

Description

postStart

No

Table 47

-

preStop

No

Table 47

-

Table 40 Data structure of the securityContext field

Name

Mandatory

Type

Description

capabilities

No

Table 48

-

privileged

No

Boolean

Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host.

Value:

  • true
  • false

Default: false.

seLinuxOptions

No

Table 41

-

runAsUser

No

Integer

The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

runAsNonRoot

No

Boolean

Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

Value:

  • true
  • false
Table 41 Data structure of the seLinuxOptions field

Name

Mandatory

Type

Description

user

No

String

SELinux user label that applies to the container.

role

No

String

SELinux role label that applies to the container.

type

No

String

SELinux type label that applies to the container.

level

No

String

SELinux level label that applies to the container.

Table 42 Data structure of the items field

Name

Mandatory

Type

Description

path

No

String

Relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'

fieldRef

No

Table 49

-

resourceFieldRef

No

Table 50

Selects a resource of the container: only resources limits and requests. (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.

Table 43 Data structure of the valueFrom field

Name

Mandatory

Type

Description

fieldRef

No

Table 49

-

resourceFieldRef

No

Table 50

Selects a resource of the container: only resources limits and requests. (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.

Table 44 Data structure of the exec field

Name

Mandatory

Type

Description

command

No

Array[string]

Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) do not work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.

Table 45 Data structure of the httpGet field

Name

Mandatory

Type

Description

path

No

String

Path to access on the HTTP server.

port

No

String

Name or number of the port to access on the container. The port number must be in the range 1 to 65535. The port name must be an IANA_SVC_NAME.

host

No

String

Host name to connect to. Defaults to the pod IP address.

scheme

No

String

Scheme to use for connecting to the host. Defaults to HTTP.

Table 46 Data structure of the tcpSocket field

Name

Mandatory

Type

Description

port

No

String

Number or name of the port to access on the container. The port number must be in the range 1 to 65535. The port name must be an IANA_SVC_NAME.

Table 47 Data structure of the postStart/preStop field

Name

Mandatory

Type

Description

exec

No

Table 44

-

httpGet

No

Table 45

-

tcpSocket

No

Table 46

TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.

Table 48 Data structure of the capabilities field

Name

Mandatory

Type

Description

add

No

Table 51

Added capabilities.

drop

No

Table 51

Removed capabilities.

Table 49 Data structure of the fieldRef field

Name

Mandatory

Type

Description

apiVersion

No

String

Version of the schema the FieldPath is written in terms of. Defaults to "v1".

fieldPath

No

String

Path of the field to select in the specified API version.

Table 50 Data structure of the resourceFieldRef field

Name

Mandatory

Type

Description

containerName

No

String

Container name: required for volumes, optional for env vars.

resource

Yes

String

Required: resource to select.

divisor

No

Resource.Quantity

Specifies the output format of the exposed resources, defaults to "1".

Table 51 Data structure of the add field

Name

Mandatory

Type

Description

name

Yes

String

Name of the resource.

namespaced

No

Boolean

A flag indicating whether a resource is namespaced or not.

Default: false.

kind

No

String

kind of the resource.

Table 52 Data structure of the affinity field

Name

Mandatory

Type

Description

nodeAffinity

No

Table 53

Describes node affinity scheduling rules for the pod.

podAffinity

No

Table 54

Describes pod affinity scheduling rules (for example, co-locate this pod in the same node or zone as some other pod(s)).

podAntiAffinity

No

Table 54

Describes pod anti-affinity scheduling rules (for example, avoid putting this pod in the same node or zone as some other pod(s)).

Table 53 Data structure of the nodeAffinity field

Name

Mandatory

Type

Description

preferredDuringSchedulingIgnoredDuringExecution

No

Table 55

The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, that is, for each node that meets all of the scheduling requirements (resource request and requiredDuringScheduling affinity expressions), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the nodes with the highest sum are the most preferred.

requiredDuringSchedulingIgnoredDuringExecution

No

Table 56

If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (for example, due to an update), the system may or may not try to eventually evict the pod from its node.

Table 54 Data structure of the podAffinity field

Name

Mandatory

Type

Description

preferredDuringSchedulingIgnoredDuringExecution

No

Table 59

The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, that is, for each node that meets all of the scheduling requirements (resource request and requiredDuringScheduling affinity expressions), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which match the corresponding podAffinityTerm; the nodes with the highest sum are the most preferred.

requiredDuringSchedulingIgnoredDuringExecution

No

Table 60

NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (for example, due to a pod label update), the system will try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, that is, all terms must be satisfied. RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm json:"requiredDuringSchedulingRequiredDuringExecution,omitempty" If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (for example, due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, that is, all terms must be satisfied.

Table 55 Data structure of the preferredDuringSchedulingIgnoredDuringExecution field

Name

Mandatory

Type

Description

preference

No

Table 57

A node selector term, associated with the corresponding weight.

weight

No

Integer

Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.

Table 56 Data structure of the requiredDuringSchedulingIgnoredDuringExecution field

Name

Mandatory

Type

Description

nodeSelectorTerms

No

Table 57

Required. A list of node selector terms. The terms are ORed.

Table 57 Data structure of the preference field

Name

Mandatory

Type

Description

matchExpressions

No

Table 58

Required. A list of node selector requirements. The requirements are ANDed.

Table 58 Data structure of the matchExpressions field

Name

Mandatory

Type

Description

key

No

String

The label key that the selector applies to.

operator

No

String

Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.

values

No

String

An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.

Table 59 Data structure of the preferredDuringSchedulingIgnoredDuringExecution field

Name

Mandatory

Type

Description

podAffinityTerm

No

Table 60

Required. A pod affinity term, associated with the corresponding weight.

weight

No

Integer

weight associated with matching the corresponding podAffinityTerm, in the range 1-100.

Table 60 Data structure of the podAffinityTerm field

Name

Mandatory

Type

Description

labelSelector

No

Table 61

A label query over a set of resources, in this case pods.

namespaces

No

Array[string]

namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means "this pod's namespace"

topologyKey

No

String

This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as "all topologies" ("all topologies" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains); for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed.

Table 61 Data structure of the labelSelector field

Name

Mandatory

Type

Description

matchExpressions

No

Table 62

matchExpressions is a list of label selector requirements. The requirements are ANDed.

matchLabels

No

Object

matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.

Table 62 Data structure of the matchExpressions field

Name

Mandatory

Type

Description

key

No

String

key is the label key that the selector applies to.

operator

No

String

operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.

values

No

Array[string]

values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.

Table 63 Data structure of the hostAliases field

Name

Mandatory

Type

Description

hostnames

No

Array[string]

Hostnames for the above IP address.

ip

No

String

IP address of the host file entry.

Table 64 Data structure of the envFrom field

Name

Mandatory

Type

Description

configMapRef

No

Table 65

The ConfigMap to select from.

prefix

No

String

An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.

secretRef

No

Table 66

-

Table 65 Data structure of the configMapRef field

Name

Mandatory

Type

Description

name

No

String

Name of the referent.

optional

No

Boolean

Specify whether the ConfigMap must be defined.

Table 66 Data structure of the secretRef field

Name

Mandatory

Type

Description

name

No

String

Name of the referent.

optional

No

Boolean

Specify whether the ConfigMap must be defined.

Table 67 Data structure of the tolerations field

Name

Mandatory

Type

Description

effect

No

String

Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.

key

No

String

Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.

operator

No

String

Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.

tolerationSeconds

No

Integer

TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.

value

No

String

Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.