Class: Google::Apis::RunV2::GoogleCloudRunV2Container
- Inherits:
-
Object
- Object
- Google::Apis::RunV2::GoogleCloudRunV2Container
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/run_v2/classes.rb,
lib/google/apis/run_v2/representations.rb,
lib/google/apis/run_v2/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::RunV2::GoogleCloudRunV2EnvVar>
List of environment variables to set in the container.
-
#image ⇒ String
Required.
-
#name ⇒ String
Name of the container specified as a DNS_LABEL.
-
#ports ⇒ Array<Google::Apis::RunV2::GoogleCloudRunV2ContainerPort>
List of ports to expose from the container.
-
#resources ⇒ Google::Apis::RunV2::GoogleCloudRunV2ResourceRequirements
ResourceRequirements describes the compute resource requirements.
-
#volume_mounts ⇒ Array<Google::Apis::RunV2::GoogleCloudRunV2VolumeMount>
Volume to mount into the container's filesystem.
-
#working_dir ⇒ String
Container's working directory.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRunV2Container
constructor
A new instance of GoogleCloudRunV2Container.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRunV2Container
Returns a new instance of GoogleCloudRunV2Container.
213 214 215 |
# File 'lib/google/apis/run_v2/classes.rb', line 213 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. 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
157 158 159 |
# File 'lib/google/apis/run_v2/classes.rb', line 157 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. 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 command
169 170 171 |
# File 'lib/google/apis/run_v2/classes.rb', line 169 def command @command end |
#env ⇒ Array<Google::Apis::RunV2::GoogleCloudRunV2EnvVar>
List of environment variables to set in the container.
Corresponds to the JSON property env
174 175 176 |
# File 'lib/google/apis/run_v2/classes.rb', line 174 def env @env end |
#image ⇒ String
Required. URL of the Container image in Google Container Registry or Google
Artifact Registry. More info: https://kubernetes.io/docs/concepts/containers/
images
Corresponds to the JSON property image
181 182 183 |
# File 'lib/google/apis/run_v2/classes.rb', line 181 def image @image end |
#name ⇒ String
Name of the container specified as a DNS_LABEL.
Corresponds to the JSON property name
186 187 188 |
# File 'lib/google/apis/run_v2/classes.rb', line 186 def name @name end |
#ports ⇒ Array<Google::Apis::RunV2::GoogleCloudRunV2ContainerPort>
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
195 196 197 |
# File 'lib/google/apis/run_v2/classes.rb', line 195 def ports @ports end |
#resources ⇒ Google::Apis::RunV2::GoogleCloudRunV2ResourceRequirements
ResourceRequirements describes the compute resource requirements.
Corresponds to the JSON property resources
200 201 202 |
# File 'lib/google/apis/run_v2/classes.rb', line 200 def resources @resources end |
#volume_mounts ⇒ Array<Google::Apis::RunV2::GoogleCloudRunV2VolumeMount>
Volume to mount into the container's filesystem.
Corresponds to the JSON property volumeMounts
205 206 207 |
# File 'lib/google/apis/run_v2/classes.rb', line 205 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
211 212 213 |
# File 'lib/google/apis/run_v2/classes.rb', line 211 def working_dir @working_dir end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/google/apis/run_v2/classes.rb', line 218 def update!(**args) @args = args[:args] if args.key?(:args) @command = args[:command] if args.key?(:command) @env = args[:env] if args.key?(:env) @image = args[:image] if args.key?(:image) @name = args[:name] if args.key?(:name) @ports = args[:ports] if args.key?(:ports) @resources = args[:resources] if args.key?(:resources) @volume_mounts = args[:volume_mounts] if args.key?(:volume_mounts) @working_dir = args[:working_dir] if args.key?(:working_dir) end |