Interface CfnJobDefinition.IEksContainerProperty
EKS container properties are used in job definitions for Amazon EKS based job definitions to describe the properties for a container node in the pod that's launched as part of a job.
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface CfnJobDefinition.IEksContainerProperty
Syntax (vb)
Public Interface CfnJobDefinition.IEksContainerProperty
Remarks
This can't be specified for Amazon ECS based job definitions.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Batch;
var limits;
var requests;
var eksContainerProperty = new EksContainerProperty {
Image = "image",
// the properties below are optional
Args = new [] { "args" },
Command = new [] { "command" },
Env = new [] { new EksContainerEnvironmentVariableProperty {
Name = "name",
// the properties below are optional
Value = "value"
} },
ImagePullPolicy = "imagePullPolicy",
Name = "name",
Resources = new ResourcesProperty {
Limits = limits,
Requests = requests
},
SecurityContext = new SecurityContextProperty {
AllowPrivilegeEscalation = false,
Privileged = false,
ReadOnlyRootFilesystem = false,
RunAsGroup = 123,
RunAsNonRoot = false,
RunAsUser = 123
},
VolumeMounts = new [] { new EksContainerVolumeMountProperty {
MountPath = "mountPath",
Name = "name",
ReadOnly = false,
SubPath = "subPath"
} }
};
Synopsis
Properties
| Args | An array of arguments to the entrypoint. |
| Command | The entrypoint for the container. |
| Env | The environment variables to pass to a container. |
| Image | The Docker image used to start the container. |
| ImagePullPolicy | The image pull policy for the container. |
| Name | The name of the container. |
| Resources | The type and amount of resources to assign to a container. |
| SecurityContext | The security context for a job. |
| VolumeMounts | The volume mounts for the container. |
Properties
Args
An array of arguments to the entrypoint.
string[]? Args { get; }
Property Value
string[]
Remarks
If this isn't specified, the CMD of the container image is used. This corresponds to the args member in the Entrypoint portion of the Pod in Kubernetes. Environment variable references are expanded using the container's environment.
If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to " \((NAME1)</code> " and the <code>NAME1</code> environment variable doesn't exist, the command string will remain " <code>\)(NAME1) ." \(</code> is replaced with <code>$</code> , and the resulting string isn't expanded. For example, <code>\)(VAR_NAME) is passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. For more information, see Dockerfile reference: CMD and Define a command and arguments for a pod in the Kubernetes documentation .
Command
The entrypoint for the container.
string[]? Command { get; }
Property Value
string[]
Remarks
This isn't run within a shell. If this isn't specified, the ENTRYPOINT of the container image is used. Environment variable references are expanded using the container's environment.
If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to " \((NAME1)</code> " and the <code>NAME1</code> environment variable doesn't exist, the command string will remain " <code>\)(NAME1) ." \(</code> is replaced with <code>$</code> and the resulting string isn't expanded. For example, <code>\)(VAR_NAME) will be passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. The entrypoint can't be updated. For more information, see ENTRYPOINT in the Dockerfile reference and Define a command and arguments for a container and Entrypoint in the Kubernetes documentation .
Env
The environment variables to pass to a container.
object? Env { get; }
Property Value
Remarks
Environment variables cannot start with " <code>AWS_BATCH</code> ". This naming convention is reserved for variables that AWS Batch sets.
Type union: either IResolvable or (either IResolvable or CfnJobDefinition.IEksContainerEnvironmentVariableProperty)[]
Image
The Docker image used to start the container.
string Image { get; }
Property Value
Remarks
ImagePullPolicy
The image pull policy for the container.
string? ImagePullPolicy { get; }
Property Value
Remarks
Supported values are Always , IfNotPresent , and Never . This parameter defaults to IfNotPresent . However, if the :latest tag is specified, it defaults to Always . For more information, see Updating images in the Kubernetes documentation .
Name
The name of the container.
string? Name { get; }
Property Value
Remarks
If the name isn't specified, the default name " Default " is used. Each container in a pod must have a unique name.
Resources
The type and amount of resources to assign to a container.
object? Resources { get; }
Property Value
Remarks
The supported resources include memory , cpu , and nvidia.com/gpu . For more information, see Resource management for pods and containers in the Kubernetes documentation .
Type union: either IResolvable or CfnJobDefinition.IResourcesProperty
SecurityContext
The security context for a job.
object? SecurityContext { get; }
Property Value
Remarks
For more information, see Configure a security context for a pod or container in the Kubernetes documentation .
Type union: either IResolvable or CfnJobDefinition.ISecurityContextProperty
VolumeMounts
The volume mounts for the container.
object? VolumeMounts { get; }
Property Value
Remarks
AWS Batch supports emptyDir , hostPath , and secret volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .
Type union: either IResolvable or (either IResolvable or CfnJobDefinition.IEksContainerVolumeMountProperty)[]