Class CfnJobDefinition.PodPropertiesProperty
The properties for the pod.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.AWS.Batch.dll
Syntax (csharp)
public class PodPropertiesProperty : Object, CfnJobDefinition.IPodPropertiesProperty
Syntax (vb)
Public Class PodPropertiesProperty
Inherits Object
Implements CfnJobDefinition.IPodPropertiesProperty
Remarks
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 labels;
var limits;
var requests;
var podPropertiesProperty = new PodPropertiesProperty {
Containers = new [] { 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 {
Privileged = false,
ReadOnlyRootFilesystem = false,
RunAsGroup = 123,
RunAsNonRoot = false,
RunAsUser = 123
},
VolumeMounts = new [] { new EksContainerVolumeMountProperty {
MountPath = "mountPath",
Name = "name",
ReadOnly = false
} }
} },
DnsPolicy = "dnsPolicy",
HostNetwork = false,
Metadata = new MetadataProperty {
Labels = labels
},
ServiceAccountName = "serviceAccountName",
Volumes = new [] { new EksVolumeProperty {
Name = "name",
// the properties below are optional
EmptyDir = new EmptyDirProperty {
Medium = "medium",
SizeLimit = "sizeLimit"
},
HostPath = new HostPathProperty {
Path = "path"
},
Secret = new EksSecretProperty {
SecretName = "secretName",
// the properties below are optional
Optional = false
}
} }
};
Synopsis
Constructors
PodPropertiesProperty() |
Properties
Containers | The properties of the container that's used on the Amazon EKS pod. |
DnsPolicy | The DNS policy for the pod. |
HostNetwork | Indicates if the pod uses the hosts' network IP address. |
Metadata |
|
ServiceAccountName | The name of the service account that's used to run the pod. |
Volumes | Specifies the volumes for a job definition that uses Amazon EKS resources. |
Constructors
PodPropertiesProperty()
public PodPropertiesProperty()
Properties
Containers
The properties of the container that's used on the Amazon EKS pod.
public object Containers { get; set; }
Property Value
System.Object
Remarks
DnsPolicy
The DNS policy for the pod.
public string DnsPolicy { get; set; }
Property Value
System.String
Remarks
The default value is ClusterFirst
. If the hostNetwork
parameter is not specified, the default is ClusterFirstWithHostNet
. ClusterFirst
indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the upstream nameserver inherited from the node. If no value was specified for dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by either of DescribeJobDefinitions or DescribeJobs API operations. The pod spec setting will contain either ClusterFirst
or ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter. For more information, see Pod's DNS policy in the Kubernetes documentation .
Valid values: Default
| ClusterFirst
| ClusterFirstWithHostNet
HostNetwork
Indicates if the pod uses the hosts' network IP address.
public object HostNetwork { get; set; }
Property Value
System.Object
Remarks
The default value is true
. Setting this to false
enables the Kubernetes pod networking model. Most AWS Batch workloads are egress-only and don't require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and Pod networking in the Kubernetes documentation .
Metadata
CfnJobDefinition.PodPropertiesProperty.Metadata
.
public object Metadata { get; set; }
Property Value
System.Object
Remarks
ServiceAccountName
The name of the service account that's used to run the pod.
public string ServiceAccountName { get; set; }
Property Value
System.String
Remarks
For more information, see Kubernetes service accounts and Configure a Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service accounts for pods in the Kubernetes documentation .
Volumes
Specifies the volumes for a job definition that uses Amazon EKS resources.
public object Volumes { get; set; }
Property Value
System.Object