Help Center/ Cloud Container Instance/ API Reference/ Data Structure/ Request Data Structure (Discarded)
Updated on 2023-12-21 GMT+08:00

Request Data Structure (Discarded)

Table 1 Data structure of v1.PodTemplate

Parameter

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

metadata object

-

template

Yes

template object

-

Table 2 Request parameters of v1.Pod

Parameter

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

metadata object

-

spec

Yes

spec object

-

status

No

status object

-

Table 3 Data structure of the status field

Parameter

Mandatory

Type

Description

phase

No

String

Current condition of the pod.

conditions

No

conditions object

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. e.g. '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

containerStatuses object

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

Table 4 Data structure of the conditions field

Parameter

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 5 Data structure of the containerStatuses field

Parameter

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

state/lastState object

-

lastState

No

state/lastState object

-

ready

No

Boolean

Specifies 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

Yes

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 6 Data structure of the state or lastState field

Parameter

Mandatory

Type

Description

waiting

No

waiting object

-

running

No

running object

-

terminated

No

terminated object

-

Table 7 Data structure of the waiting field

Parameter

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 8 Data structure of the running field

Parameter

Mandatory

Type

Description

startedAt

No

String

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

Table 9 Data structure of the terminated field

Parameter

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 10 Data structure of the metadata field

Parameter

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.

NOTE:

Only EVS volumes are supported.

initializers

No

initializers object

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.

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 from 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

ownerReferences object

(A newly added parameter in Kubernetes 1.3)

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

Array of strings

(A newly added parameter in Kubernetes 1.3)

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 11 Data structure of the initializers field

Parameter

Mandatory

Type

Description

pending

No

pending object

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

result object

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 12 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 13 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

details object

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

metadata object

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 14 Data structure of the details field

Parameter

Mandatory

Type

Description

causes

No

causes object

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 15 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 16 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 17 Data structure of the ownerReferences field

Parameter

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. Default 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 18 Data structure of the spec field

Parameter

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

template object

-

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 19 Data structure of the status field

Parameter

Mandatory

Type

Description

replicas

No

Integer

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

condition object

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

observedGeneration

No

Integer

Reflects the generation of the most recently observed replication controller.

FullylabeledReplicas

No

Map[string]string

-

Table 20 Data structure of the template field

Parameter

Mandatory

Type

Description

metadata

No

metadata object

-

spec

Yes

spec object

-

Table 21 Data structure of the condition field

Parameter

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 22 Data structure of the spec field

Parameter

Mandatory

Type

Description

volumes

No

-

Not supported now.

affinity

No

affinity object

If specified, the pod's scheduling constraints

NOTE:

Affinity settings cannot be configured. By default, the soft anti-affinity settings are used.

containers

Yes

containers object

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.

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

hostAliases object

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])?.

NOTE:

This field cannot be set because serviceaccount is not supported.

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.

NOTE:

The scheduler name cannot be specified.

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])?.

NOTE:

The node name cannot be specified.

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.

NOTE:

The node selector cannot be configured.

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 to false.

NOTE:

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

The host network cannot be used when you create or update pods.

hostPID

No

Boolean

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

NOTE:

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

The host PID namespaces cannot be used when you create or update pods.

hostIPC

No

Boolean

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

NOTE:

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

The host IPC namespaces cannot be used when you create or update pods.

securityContext

No

securityContext object

-

imagePullSecrets

No

imagePullSecrets object

A 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.

NOTE:

If you select an image from the My Images tab page of the SWR console, this parameter is required.

initContainers

No

containers object

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 is taken into account during scheduling by finding the highest request/limit for each resource type, and then using the maximum 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

tolerations object

If specified, the pod's tolerations.

Table 23 Data structure of the containers field

Parameter

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

Container image name.

command

No

Array of strings

Entrypoint array. Not executed within a shell. The container 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 of strings

Arguments to the entrypoint. The container 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 Container's default. Defaults to image's default. Cannot be updated.

ports

No

ports object

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

env

No

env object

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

envFrom

No

envFrom object

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

resources object

Minimum resources the volume should have.

volumeMounts

No

volumeMounts object

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

livenessProbe

No

livenessProbe object

-

readinessProbe

No

livenessProbe object

-

lifecycle

No

lifecycle object

-

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

securityContext object

-

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 24 Data structure of the securityContext field

Parameter

Mandatory

Type

Description

seLinuxOptions

No

seLinuxOptions object

-

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 of integers

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

Integer

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 25 Data structure of the imagePullSecrets field

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the referent.

NOTICE:

If you select an image from the My Images tab page of the SWR console, the value of this parameter must be set to imagepull-secret.

Table 26 Data structure of the hostPath field

Parameter

Mandatory

Type

Description

path

No

String

Path of the directory on the host.

Table 27 Data structure of the emptyDir field

Parameter

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 28 Data structure of the gitRepo field

Parameter

Mandatory

Type

Description

repository

No

String

Repository URL.

revision

No

String

Commit hash for the specified revision.

Table 29 Data structure of the ports field

Parameter

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 30 Data structure of the env field

Parameter

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

valueFrom object

-

Table 31 Data structure of the resources field

Parameter

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.

Cloud Container Instance (CCI) has limitation on pod specifications. For details, see Pod Specifications in Usage Constraints.

Table 32 Data structure of the volumeMounts field

Parameter

Mandatory

Type

Description

name

Yes

String

This must match the name of a volume.

0 character < 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 33 Data structure of the livenessProbe field

Parameter

Mandatory

Type

Description

exec

No

exec object

-

httpGet

No

httpGet object

-

tcpSocket

No

tcpSocket object

-

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 34 Data structure of the lifecycle field

Parameter

Mandatory

Type

Description

postStart

No

postStart/preStop object

-

preStop

No

postStart/preStop object

-

Table 35 Data structure of the securityContext field

Parameter

Mandatory

Type

Description

capabilities

No

capabilities object

-

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.

NOTE:

Run container in privileged mode.

seLinuxOptions

No

seLinuxOptions object

-

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 36 Data structure of the seLinuxOptions field

Parameter

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 37 Data structure of the items field

Parameter

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

fieldRef object

-

resourceFieldRef

No

resourceFieldRef object

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

Table 38 Data structure of the valueFrom field

Parameter

Mandatory

Type

Description

fieldRef

No

fieldRef object

-

resourceFieldRef

No

resourceFieldRef object

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

Table 39 Data structure of the exec field

Parameter

Mandatory

Type

Description

command

No

Array of strings

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 executed, 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 40 Data structure of the httpGet field

Parameter

Mandatory

Type

Description

path

No

String

Path to access on the HTTP server.

port

Yes

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 41 Data structure of the tcpSocket field

Parameter

Mandatory

Type

Description

port

Yes

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 42 Data structure of the postStart/preStop field

Parameter

Mandatory

Type

Description

exec

No

exec object

-

httpGet

No

httpGet object

-

tcpSocket

No

tcpSocket object

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

Table 43 Data structure of the capabilities field

Parameter

Mandatory

Type

Description

add

No

add object

Added capabilities.

drop

No

add object

Removed capabilities.

Table 44 Data structure of the fieldRef field

Parameter

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 45 Data structure of the resourceFieldRef field

Parameter

Mandatory

Type

Description

containerName

No

String

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

resource

Yes

String

Required: resource to select.

divisor

No

Integer

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

Table 46 Data structure of the add field

Parameter

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 47 Data structure of the affinity field

Parameter

Mandatory

Type

Description

nodeAffinity

No

nodeAffinity object

Describes node affinity scheduling rules for the pod.

podAffinity

No

podAffinity object

Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).

podAntiAffinity

No

podAffinity object

Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).

Table 48 Data structure of the nodeAffinity field

Parameter

Mandatory

Type

Description

preferredDuringSchedulingIgnoredDuringExecution

No

preferredDuringSchedulingIgnoredDuringExecution object

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, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), 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 node(s) with the highest sum are the most preferred.

requiredDuringSchedulingIgnoredDuringExecution

No

requiredDuringSchedulingIgnoredDuringExecution object

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 (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.

Table 49 Data structure of the podAffinity field

Parameter

Mandatory

Type

Description

preferredDuringSchedulingIgnoredDuringExecution

No

preferredDuringSchedulingIgnoredDuringExecution object

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, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods that match the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.

requiredDuringSchedulingIgnoredDuringExecution

No

podAffinityTerm object

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 (e.g. 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, i.e. 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 (e.g. 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, i.e. all terms must be satisfied.

Table 50 Data structure of the preferredDuringSchedulingIgnoredDuringExecution field

Parameter

Mandatory

Type

Description

preference

No

preference object

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 51 Data structure of the requiredDuringSchedulingIgnoredDuringExecution field

Parameter

Mandatory

Type

Description

nodeSelectorTerms

No

preference object

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

Table 52 Data structure of the preference field

Parameter

Mandatory

Type

Description

matchExpressions

No

matchExpressions object

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

Table 53 Data structure of the matchExpressions field

Parameter

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 54 Data structure of the preferredDuringSchedulingIgnoredDuringExecution field

Parameter

Mandatory

Type

Description

podAffinityTerm

No

podAffinityTerm object

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 55 Data structure of the podAffinityTerm field

Parameter

Mandatory

Type

Description

labelSelector

No

labelSelector object

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 56 Data structure of the labelSelector field

Parameter

Mandatory

Type

Description

matchExpressions

No

matchExpressions object

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

matchLabels

No

Object

(A newly added parameter in Kubernetes 1.7)

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 57 Data structure of the matchExpressions field

Parameter

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 of strings

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 58 Data structure of the hostAliases field

Parameter

Mandatory

Type

Description

hostnames

No

Array of strings

Hostnames for the above IP address.

ip

No

String

IP address of the host file entry.

Table 59 Data structure of the envFrom field

Parameter

Mandatory

Type

Description

configMapRef

No

configMapRef object

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

secretRef object

-

Table 60 Data structure of the configMapRef field

Parameter

Mandatory

Type

Description

name

No

String

Name of the referent.

optional

No

Boolean

Specify whether the ConfigMap must be defined

Table 61 Data structure of the secretRef field

Parameter

Mandatory

Type

Description

name

No

String

Name of the referent.

optional

No

Boolean

Specify whether the ConfigMap must be defined

Table 62 Data structure of the tolerations field

Parameter

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.

Table 63 Data structure of DeleteOptions

Parameter

Mandatory

Type

Description

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. In CamelCase.

The value of this parameter is DeleteOptions.

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.

The value of this parameter is v1.

gracePeriodSeconds

No

Integer

The duration in seconds before the object should be deleted. Value must be a non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. The value 0 indicates to delete immediately.

orphanDependents

No

Boolean

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.

propagationPolicy

No

String

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

preconditions

No

Preconditions object

Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.

Table 64 Data structure of the preconditions field

Parameter

Mandatory

Type

Description

uid

No

String

Specifies the target UID.