-
Notifications
You must be signed in to change notification settings - Fork 1
/
AbstractPodProps.go
103 lines (100 loc) · 4.99 KB
/
AbstractPodProps.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
package cdk8splus29
import (
"github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2"
)
// Properties for `AbstractPod`.
type AbstractPodProps 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"`
}