Class: Google::Apis::RunV1::Container
- Inherits:
-
Object
- Object
- Google::Apis::RunV1::Container
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/run_v1/classes.rb,
lib/google/apis/run_v1/representations.rb,
lib/google/apis/run_v1/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::RunV1::EnvVar>
List of environment variables to set in the container.
-
#env_from ⇒ Array<Google::Apis::RunV1::EnvFromSource>
Not supported by Cloud Run.
-
#image ⇒ String
Required.
-
#image_pull_policy ⇒ String
Image pull policy.
-
#liveness_probe ⇒ Google::Apis::RunV1::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 (RFC 1123).
-
#ports ⇒ Array<Google::Apis::RunV1::ContainerPort>
List of ports to expose from the container.
-
#readiness_probe ⇒ Google::Apis::RunV1::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::RunV1::ResourceRequirements
ResourceRequirements describes the compute resource requirements.
-
#security_context ⇒ Google::Apis::RunV1::SecurityContext
Not supported by Cloud Run.
-
#startup_probe ⇒ Google::Apis::RunV1::Probe
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
-
#termination_message_path ⇒ String
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.
-
#volume_mounts ⇒ Array<Google::Apis::RunV1::VolumeMount>
Volume 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.
601 602 603 |
# File 'lib/google/apis/run_v1/classes.rb', line 601 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 are not supported in Cloud Run.
Corresponds to the JSON property args
489 490 491 |
# File 'lib/google/apis/run_v1/classes.rb', line 489 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 are not supported in
Cloud Run.
Corresponds to the JSON property command
496 497 498 |
# File 'lib/google/apis/run_v1/classes.rb', line 496 def command @command end |
#env ⇒ Array<Google::Apis::RunV1::EnvVar>
List of environment variables to set in the container. EnvVar with duplicate
names are generally allowed; if referencing a secret, the name must be unique
for the container. For non-secret EnvVar names, the Container will only get
the last-declared one.
Corresponds to the JSON property env
504 505 506 |
# File 'lib/google/apis/run_v1/classes.rb', line 504 def env @env end |
#env_from ⇒ Array<Google::Apis::RunV1::EnvFromSource>
Not supported by Cloud Run.
Corresponds to the JSON property envFrom
509 510 511 |
# File 'lib/google/apis/run_v1/classes.rb', line 509 def env_from @env_from end |
#image ⇒ String
Required. Name of the container image in Dockerhub, Google Artifact Registry,
or Google Container Registry. If the host is not provided, Dockerhub is
assumed.
Corresponds to the JSON property image
516 517 518 |
# File 'lib/google/apis/run_v1/classes.rb', line 516 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.
Corresponds to the JSON property imagePullPolicy
522 523 524 |
# File 'lib/google/apis/run_v1/classes.rb', line 522 def image_pull_policy @image_pull_policy end |
#liveness_probe ⇒ Google::Apis::RunV1::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
528 529 530 |
# File 'lib/google/apis/run_v1/classes.rb', line 528 def liveness_probe @liveness_probe end |
#name ⇒ String
Name of the container specified as a DNS_LABEL (RFC 1123).
Corresponds to the JSON property name
533 534 535 |
# File 'lib/google/apis/run_v1/classes.rb', line 533 def name @name end |
#ports ⇒ Array<Google::Apis::RunV1::ContainerPort>
List of ports to expose from the container. Only a single port can be
specified. The specified ports must be listening on all interfaces (0.0.0.0)
within the container to be accessible. If omitted, a port number will be
chosen and passed to the container through the PORT environment variable for
the container to listen on.
Corresponds to the JSON property ports
542 543 544 |
# File 'lib/google/apis/run_v1/classes.rb', line 542 def ports @ports end |
#readiness_probe ⇒ Google::Apis::RunV1::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
548 549 550 |
# File 'lib/google/apis/run_v1/classes.rb', line 548 def readiness_probe @readiness_probe end |
#resources ⇒ Google::Apis::RunV1::ResourceRequirements
ResourceRequirements describes the compute resource requirements.
Corresponds to the JSON property resources
553 554 555 |
# File 'lib/google/apis/run_v1/classes.rb', line 553 def resources @resources end |
#security_context ⇒ Google::Apis::RunV1::SecurityContext
Not supported by Cloud Run. 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
561 562 563 |
# File 'lib/google/apis/run_v1/classes.rb', line 561 def security_context @security_context end |
#startup_probe ⇒ Google::Apis::RunV1::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 startupProbe
567 568 569 |
# File 'lib/google/apis/run_v1/classes.rb', line 567 def startup_probe @startup_probe end |
#termination_message_path ⇒ 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. 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.
Corresponds to the JSON property terminationMessagePath
577 578 579 |
# File 'lib/google/apis/run_v1/classes.rb', line 577 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.
Corresponds to the JSON property terminationMessagePolicy
587 588 589 |
# File 'lib/google/apis/run_v1/classes.rb', line 587 def @termination_message_policy end |
#volume_mounts ⇒ Array<Google::Apis::RunV1::VolumeMount>
Volume to mount into the container's filesystem. Only supports
SecretVolumeSources. Pod volumes to mount into the container's filesystem.
Corresponds to the JSON property volumeMounts
593 594 595 |
# File 'lib/google/apis/run_v1/classes.rb', line 593 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.
Corresponds to the JSON property workingDir
599 600 601 |
# File 'lib/google/apis/run_v1/classes.rb', line 599 def working_dir @working_dir end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/google/apis/run_v1/classes.rb', line 606 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) @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) @startup_probe = args[:startup_probe] if args.key?(:startup_probe) @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) @volume_mounts = args[:volume_mounts] if args.key?(:volume_mounts) @working_dir = args[:working_dir] if args.key?(:working_dir) end |