Class: Google::Apis::RunV1::Container
- Inherits:
-
Object
- Object
- Google::Apis::RunV1::Container
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/run_v1/classes.rb,
generated/google/apis/run_v1/representations.rb,
generated/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>
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported Arguments to the entrypoint.
-
#command ⇒ Array<String>
Corresponds to the JSON property
command
. -
#env ⇒ Array<Google::Apis::RunV1::EnvVar>
(Optional) Cloud Run fully managed: supported Cloud Run for Anthos: supported List of environment variables to set in the container.
-
#env_from ⇒ Array<Google::Apis::RunV1::EnvFromSource>
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported List of sources to populate environment variables in the container.
-
#image ⇒ String
Cloud Run fully managed: only supports containers from Google Container Registry Cloud Run for Anthos: supported URL of the Container image.
-
#image_pull_policy ⇒ String
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported Image pull policy.
-
#liveness_probe ⇒ Google::Apis::RunV1::Probe
Cloud Run fully managed: not supported Cloud Run for Anthos: supported Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
-
#name ⇒ String
(Optional) Name of the container specified as a DNS_LABEL.
-
#ports ⇒ Array<Google::Apis::RunV1::ContainerPort>
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported List of ports to expose from the container.
-
#readiness_probe ⇒ Google::Apis::RunV1::Probe
Cloud Run fully managed: not supported Cloud Run for Anthos: supported 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
Cloud Run fully managed: not supported Cloud Run for Anthos: supported SecurityContext holds security configuration that will be applied to a container.
-
#termination_message_path ⇒ String
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported 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
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported Indicate how the termination message should be populated.
-
#volume_mounts ⇒ Array<Google::Apis::RunV1::VolumeMount>
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported Pod volumes to mount into the container's filesystem.
-
#working_dir ⇒ String
(Optional) Cloud Run fully managed: not supported Cloud Run for Anthos: supported 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.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Container
Returns a new instance of Container
805 806 807 |
# File 'generated/google/apis/run_v1/classes.rb', line 805 def initialize(**args) update!(**args) end |
Instance Attribute Details
#args ⇒ Array<String>
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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
Corresponds to the JSON property args
656 657 658 |
# File 'generated/google/apis/run_v1/classes.rb', line 656 def args @args end |
#command ⇒ Array<String>
Corresponds to the JSON property command
661 662 663 |
# File 'generated/google/apis/run_v1/classes.rb', line 661 def command @command end |
#env ⇒ Array<Google::Apis::RunV1::EnvVar>
(Optional)
Cloud Run fully managed: supported
Cloud Run for Anthos: supported
List of environment variables to set in the container.
Cannot be updated.
Corresponds to the JSON property env
670 671 672 |
# File 'generated/google/apis/run_v1/classes.rb', line 670 def env @env end |
#env_from ⇒ Array<Google::Apis::RunV1::EnvFromSource>
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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.
Corresponds to the JSON property envFrom
683 684 685 |
# File 'generated/google/apis/run_v1/classes.rb', line 683 def env_from @env_from end |
#image ⇒ String
Cloud Run fully managed: only supports containers from Google Container
Registry
Cloud Run for Anthos: supported
URL of the Container image.
More info: https://kubernetes.io/docs/concepts/containers/images
Corresponds to the JSON property image
692 693 694 |
# File 'generated/google/apis/run_v1/classes.rb', line 692 def image @image end |
#image_pull_policy ⇒ String
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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
Corresponds to the JSON property imagePullPolicy
705 706 707 |
# File 'generated/google/apis/run_v1/classes.rb', line 705 def image_pull_policy @image_pull_policy end |
#liveness_probe ⇒ Google::Apis::RunV1::Probe
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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
713 714 715 |
# File 'generated/google/apis/run_v1/classes.rb', line 713 def liveness_probe @liveness_probe end |
#name ⇒ String
(Optional)
Name of the container specified as a DNS_LABEL.
Corresponds to the JSON property name
719 720 721 |
# File 'generated/google/apis/run_v1/classes.rb', line 719 def name @name end |
#ports ⇒ Array<Google::Apis::RunV1::ContainerPort>
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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.
Corresponds to the JSON property ports
733 734 735 |
# File 'generated/google/apis/run_v1/classes.rb', line 733 def ports @ports end |
#readiness_probe ⇒ Google::Apis::RunV1::Probe
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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
741 742 743 |
# File 'generated/google/apis/run_v1/classes.rb', line 741 def readiness_probe @readiness_probe end |
#resources ⇒ Google::Apis::RunV1::ResourceRequirements
ResourceRequirements describes the compute resource requirements.
Corresponds to the JSON property resources
746 747 748 |
# File 'generated/google/apis/run_v1/classes.rb', line 746 def resources @resources end |
#security_context ⇒ Google::Apis::RunV1::SecurityContext
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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
756 757 758 |
# File 'generated/google/apis/run_v1/classes.rb', line 756 def security_context @security_context end |
#termination_message_path ⇒ String
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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.
Corresponds to the JSON property terminationMessagePath
770 771 772 |
# File 'generated/google/apis/run_v1/classes.rb', line 770 def @termination_message_path end |
#termination_message_policy ⇒ String
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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
783 784 785 |
# File 'generated/google/apis/run_v1/classes.rb', line 783 def @termination_message_policy end |
#volume_mounts ⇒ Array<Google::Apis::RunV1::VolumeMount>
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
Pod volumes to mount into the container's filesystem.
Cannot be updated.
Corresponds to the JSON property volumeMounts
792 793 794 |
# File 'generated/google/apis/run_v1/classes.rb', line 792 def volume_mounts @volume_mounts end |
#working_dir ⇒ String
(Optional)
Cloud Run fully managed: not supported
Cloud Run for Anthos: supported
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.
Corresponds to the JSON property workingDir
803 804 805 |
# File 'generated/google/apis/run_v1/classes.rb', line 803 def working_dir @working_dir end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 |
# File 'generated/google/apis/run_v1/classes.rb', line 810 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) @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 |