Class: Google::Apis::RunV1alpha1::Container
- Inherits:
-
Object
- Object
- Google::Apis::RunV1alpha1::Container
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/run_v1alpha1/classes.rb,
generated/google/apis/run_v1alpha1/representations.rb,
generated/google/apis/run_v1alpha1/representations.rb
Overview
A single application container. This specifies both the container to run, the command to run in the container and the arguments to supply to it. Note that additional arguments may be supplied by the system to the container at runtime.
Instance Attribute Summary collapse
-
#args ⇒ Array<String>
Arguments to the entrypoint.
-
#command ⇒ Array<String>
Entrypoint array.
-
#env ⇒ Array<Google::Apis::RunV1alpha1::EnvVar>
List of environment variables to set in the container.
-
#env_from ⇒ Array<Google::Apis::RunV1alpha1::EnvFromSource>
List of sources to populate environment variables in the container.
-
#image ⇒ String
Docker image name.
-
#image_pull_policy ⇒ String
Image pull policy.
-
#lifecycle ⇒ Google::Apis::RunV1alpha1::Lifecycle
Lifecycle describes actions that the management system should take in response to container lifecycle events.
-
#liveness_probe ⇒ Google::Apis::RunV1alpha1::Probe
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
-
#name ⇒ String
Name of the container specified as a DNS_LABEL.
-
#ports ⇒ Array<Google::Apis::RunV1alpha1::ContainerPort>
List of ports to expose from the container.
-
#readiness_probe ⇒ Google::Apis::RunV1alpha1::Probe
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
-
#resources ⇒ Google::Apis::RunV1alpha1::ResourceRequirements
ResourceRequirements describes the compute resource requirements.
-
#security_context ⇒ Google::Apis::RunV1alpha1::SecurityContext
SecurityContext holds security configuration that will be applied to a container.
-
#stdin ⇒ Boolean
(also: #stdin?)
Whether this container should allocate a buffer for stdin in the container runtime.
-
#stdin_once ⇒ Boolean
(also: #stdin_once?)
Whether the container runtime should close the stdin channel after it has been opened by a single attach.
-
#termination_message_path ⇒ String
Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem.
-
#termination_message_policy ⇒ String
Indicate how the termination message should be populated.
-
#tty ⇒ Boolean
(also: #tty?)
Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
-
#volume_devices ⇒ Array<Google::Apis::RunV1alpha1::VolumeDevice>
volumeDevices is the list of block devices to be used by the container.
-
#volume_mounts ⇒ Array<Google::Apis::RunV1alpha1::VolumeMount>
Pod volumes to mount into the container's filesystem.
-
#working_dir ⇒ String
Container's working directory.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Container
constructor
A new instance of Container.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Container
Returns a new instance of Container.
1415 1416 1417 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1415 def initialize(**args) update!(**args) end |
Instance Attribute Details
#args ⇒ 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 $
$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of
whether the variable exists or not. Cannot be updated. More info: https://
kubernetes.io/docs/tasks/inject-data-application/define-command-argument-
container/#running-a-command-in-a-shell +optional
Corresponds to the JSON property args
1255 1256 1257 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1255 def args @args end |
#command ⇒ 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 $$, ie: $$(VAR_NAME). Escaped references will never be
expanded, regardless of whether the variable exists or not. Cannot be updated.
More info: https://kubernetes.io/docs/tasks/inject-data-application/define-
command-argument-container/#running-a-command-in-a-shell +optional
Corresponds to the JSON property command
1267 1268 1269 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1267 def command @command end |
#env ⇒ Array<Google::Apis::RunV1alpha1::EnvVar>
List of environment variables to set in the container. Cannot be updated. +
optional
Corresponds to the JSON property env
1273 1274 1275 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1273 def env @env end |
#env_from ⇒ Array<Google::Apis::RunV1alpha1::EnvFromSource>
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. +optional
Corresponds to the JSON property envFrom
1283 1284 1285 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1283 def env_from @env_from end |
#image ⇒ String
Docker image name. More info: https://kubernetes.io/docs/concepts/containers/
images
Corresponds to the JSON property image
1289 1290 1291 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1289 def image @image end |
#image_pull_policy ⇒ String
Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :
latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More
info: https://kubernetes.io/docs/concepts/containers/images#updating-images +
optional
Corresponds to the JSON property imagePullPolicy
1297 1298 1299 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1297 def image_pull_policy @image_pull_policy end |
#lifecycle ⇒ Google::Apis::RunV1alpha1::Lifecycle
Lifecycle describes actions that the management system should take in response
to container lifecycle events. For the PostStart and PreStop lifecycle
handlers, management of the container blocks until the action is complete,
unless the container process fails, in which case the handler is aborted.
Corresponds to the JSON property lifecycle
1305 1306 1307 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1305 def lifecycle @lifecycle end |
#liveness_probe ⇒ Google::Apis::RunV1alpha1::Probe
Probe describes a health check to be performed against a container to
determine whether it is alive or ready to receive traffic.
Corresponds to the JSON property livenessProbe
1311 1312 1313 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1311 def liveness_probe @liveness_probe end |
#name ⇒ String
Name of the container specified as a DNS_LABEL. Each container must have a
unique name (DNS_LABEL). Cannot be updated.
Corresponds to the JSON property name
1317 1318 1319 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1317 def name @name end |
#ports ⇒ Array<Google::Apis::RunV1alpha1::ContainerPort>
List of ports to expose from the container. Exposing a port here gives the
system additional information about the network connections a container uses,
but is primarily informational. Not specifying a port here DOES NOT prevent
that port from being exposed. Any port which is listening on the default "0.0.
0.0" address inside a container will be accessible from the network. Cannot be
updated. +optional
Corresponds to the JSON property ports
1327 1328 1329 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1327 def ports @ports end |
#readiness_probe ⇒ Google::Apis::RunV1alpha1::Probe
Probe describes a health check to be performed against a container to
determine whether it is alive or ready to receive traffic.
Corresponds to the JSON property readinessProbe
1333 1334 1335 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1333 def readiness_probe @readiness_probe end |
#resources ⇒ Google::Apis::RunV1alpha1::ResourceRequirements
ResourceRequirements describes the compute resource requirements.
Corresponds to the JSON property resources
1338 1339 1340 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1338 def resources @resources end |
#security_context ⇒ Google::Apis::RunV1alpha1::SecurityContext
SecurityContext holds security configuration that will be applied to a
container. Some fields are present in both SecurityContext and
PodSecurityContext. When both are set, the values in SecurityContext take
precedence.
Corresponds to the JSON property securityContext
1346 1347 1348 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1346 def security_context @security_context end |
#stdin ⇒ Boolean Also known as: stdin?
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. +optional
Corresponds to the JSON property stdin
1353 1354 1355 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1353 def stdin @stdin end |
#stdin_once ⇒ Boolean Also known as: stdin_once?
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 processes that reads from stdin will never
receive an EOF. Default is false +optional
Corresponds to the JSON property stdinOnce
1366 1367 1368 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1366 def stdin_once @stdin_once end |
#termination_message_path ⇒ String
Optional: 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. Will
be truncated by the node if greater than 4096 bytes. The total message length
across all containers will be limited to 12kb. Defaults to /dev/termination-
log. Cannot be updated. +optional
Corresponds to the JSON property terminationMessagePath
1377 1378 1379 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1377 def @termination_message_path end |
#termination_message_policy ⇒ String
Indicate how the termination message should be populated. File will use the
contents of terminationMessagePath to populate the container status message on
both success and failure. FallbackToLogsOnError will use the last chunk of
container log output if the termination message file is empty and the
container exited with an error. The log output is limited to 2048 bytes or 80
lines, whichever is smaller. Defaults to File. Cannot be updated. +optional
Corresponds to the JSON property terminationMessagePolicy
1387 1388 1389 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1387 def @termination_message_policy end |
#tty ⇒ Boolean Also known as: tty?
Whether this container should allocate a TTY for itself, also requires 'stdin'
to be true. Default is false. +optional
Corresponds to the JSON property tty
1393 1394 1395 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1393 def tty @tty end |
#volume_devices ⇒ Array<Google::Apis::RunV1alpha1::VolumeDevice>
volumeDevices is the list of block devices to be used by the container. This
is an alpha feature and may change in the future. +optional
Corresponds to the JSON property volumeDevices
1400 1401 1402 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1400 def volume_devices @volume_devices end |
#volume_mounts ⇒ Array<Google::Apis::RunV1alpha1::VolumeMount>
Pod volumes to mount into the container's filesystem. Cannot be updated. +
optional
Corresponds to the JSON property volumeMounts
1406 1407 1408 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1406 def volume_mounts @volume_mounts end |
#working_dir ⇒ String
Container's working directory. If not specified, the container runtime's
default will be used, which might be configured in the container image. Cannot
be updated. +optional
Corresponds to the JSON property workingDir
1413 1414 1415 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1413 def working_dir @working_dir end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 |
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1420 def update!(**args) @args = args[:args] if args.key?(:args) @command = args[:command] if args.key?(:command) @env = args[:env] if args.key?(:env) @env_from = args[:env_from] if args.key?(:env_from) @image = args[:image] if args.key?(:image) @image_pull_policy = args[:image_pull_policy] if args.key?(:image_pull_policy) @lifecycle = args[:lifecycle] if args.key?(:lifecycle) @liveness_probe = args[:liveness_probe] if args.key?(:liveness_probe) @name = args[:name] if args.key?(:name) @ports = args[:ports] if args.key?(:ports) @readiness_probe = args[:readiness_probe] if args.key?(:readiness_probe) @resources = args[:resources] if args.key?(:resources) @security_context = args[:security_context] if args.key?(:security_context) @stdin = args[:stdin] if args.key?(:stdin) @stdin_once = args[:stdin_once] if args.key?(:stdin_once) @termination_message_path = args[:termination_message_path] if args.key?(:termination_message_path) @termination_message_policy = args[:termination_message_policy] if args.key?(:termination_message_policy) @tty = args[:tty] if args.key?(:tty) @volume_devices = args[:volume_devices] if args.key?(:volume_devices) @volume_mounts = args[:volume_mounts] if args.key?(:volume_mounts) @working_dir = args[:working_dir] if args.key?(:working_dir) end |