-
Notifications
You must be signed in to change notification settings - Fork 1
/
JobProps.go
137 lines (134 loc) · 6.73 KB
/
JobProps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package cdk8splus29
import (
"github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2"
)
// Properties for `Job`.
type JobProps struct {
// Metadata that all persisted resources must have, which includes all objects users must create.
Metadata *cdk8s.ApiObjectMetadata `field:"optional" json:"metadata" yaml:"metadata"`
// Indicates whether a service account token should be automatically mounted.
// See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
//
// Default: false.
//
AutomountServiceAccountToken *bool `field:"optional" json:"automountServiceAccountToken" yaml:"automountServiceAccountToken"`
// List of containers belonging to the pod.
//
// Containers cannot currently be
// added or removed. There must be at least one container in a Pod.
//
// You can add additionnal containers using `podSpec.addContainer()`
// Default: - No containers. Note that a pod spec must include at least one container.
//
Containers *[]*ContainerProps `field:"optional" json:"containers" yaml:"containers"`
// DNS settings for the pod.
// See: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
//
// Default: policy: DnsPolicy.CLUSTER_FIRST
// hostnameAsFQDN: false.
//
Dns *PodDnsProps `field:"optional" json:"dns" yaml:"dns"`
// A secret containing docker credentials for authenticating to a registry.
// Default: - No auth. Images are assumed to be publicly available.
//
DockerRegistryAuth ISecret `field:"optional" json:"dockerRegistryAuth" yaml:"dockerRegistryAuth"`
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
HostAliases *[]*HostAlias `field:"optional" json:"hostAliases" yaml:"hostAliases"`
// Host network for the pod.
// Default: false.
//
HostNetwork *bool `field:"optional" json:"hostNetwork" yaml:"hostNetwork"`
// List of initialization containers belonging to the pod.
//
// Init containers are executed in order prior to containers being started.
// If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy.
// The name for an init container or normal container must be unique among all containers.
// Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
// The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit
// for each resource type, and then using the max of of that value or the sum of the normal containers.
// Limits are applied to init containers in a similar fashion.
//
// Init containers cannot currently be added ,removed or updated.
// See: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
//
// Default: - No init containers.
//
InitContainers *[]*ContainerProps `field:"optional" json:"initContainers" yaml:"initContainers"`
// Isolates the pod.
//
// This will prevent any ingress or egress connections to / from this pod.
// You can however allow explicit connections post instantiation by using the `.connections` property.
// Default: false.
//
Isolate *bool `field:"optional" json:"isolate" yaml:"isolate"`
// Restart policy for all containers within the pod.
// See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
//
// Default: RestartPolicy.ALWAYS
//
RestartPolicy RestartPolicy `field:"optional" json:"restartPolicy" yaml:"restartPolicy"`
// SecurityContext holds pod-level security attributes and common container settings.
// Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS
// ensureNonRoot: true.
//
SecurityContext *PodSecurityContextProps `field:"optional" json:"securityContext" yaml:"securityContext"`
// A service account provides an identity for processes that run in a Pod.
//
// When you (a human) access the cluster (for example, using kubectl), you are
// authenticated by the apiserver as a particular User Account (currently this
// is usually admin, unless your cluster administrator has customized your
// cluster). Processes in containers inside pods can also contact the
// apiserver. When they do, they are authenticated as a particular Service
// Account (for example, default).
// See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
//
// Default: - No service account.
//
ServiceAccount IServiceAccount `field:"optional" json:"serviceAccount" yaml:"serviceAccount"`
// Grace period until the pod is terminated.
// Default: Duration.seconds(30)
//
TerminationGracePeriod cdk8s.Duration `field:"optional" json:"terminationGracePeriod" yaml:"terminationGracePeriod"`
// List of volumes that can be mounted by containers belonging to the pod.
//
// You can also add volumes later using `podSpec.addVolume()`
// See: https://kubernetes.io/docs/concepts/storage/volumes
//
// Default: - No volumes.
//
Volumes *[]Volume `field:"optional" json:"volumes" yaml:"volumes"`
// The pod metadata of this workload.
PodMetadata *cdk8s.ApiObjectMetadata `field:"optional" json:"podMetadata" yaml:"podMetadata"`
// Automatically allocates a pod label selector for this workload and add it to the pod metadata.
//
// This ensures this workload manages pods created by
// its pod template.
// Default: true.
//
Select *bool `field:"optional" json:"select" yaml:"select"`
// Automatically spread pods across hostname and zones.
// See: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints
//
// Default: false.
//
Spread *bool `field:"optional" json:"spread" yaml:"spread"`
// Specifies the duration the job may be active before the system tries to terminate it.
// Default: - If unset, then there is no deadline.
//
ActiveDeadline cdk8s.Duration `field:"optional" json:"activeDeadline" yaml:"activeDeadline"`
// Specifies the number of retries before marking this job failed.
// Default: - If not set, system defaults to 6.
//
BackoffLimit *float64 `field:"optional" json:"backoffLimit" yaml:"backoffLimit"`
// Limits the lifetime of a Job that has finished execution (either Complete or Failed).
//
// If this field is set, after the Job finishes, it is eligible to
// be automatically deleted. When the Job is being deleted, its lifecycle
// guarantees (e.g. finalizers) will be honored. If this field is set to zero,
// the Job becomes eligible to be deleted immediately after it finishes. This
// field is alpha-level and is only honored by servers that enable the
// `TTLAfterFinished` feature.
// Default: - If this field is unset, the Job won't be automatically deleted.
//
TtlAfterFinished cdk8s.Duration `field:"optional" json:"ttlAfterFinished" yaml:"ttlAfterFinished"`
}