cdk8s-plus-29 (TypeScript) ¶
Constructs ¶
AbstractPod ¶
Initializers ¶
import { AbstractPod } from 'cdk8s-plus-29'
new AbstractPod(scope: Construct, id: string, props?: AbstractPodProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
addContainer
¶
public addContainer(cont: ContainerProps)
cont
Required ¶
addHostAlias
¶
public addHostAlias(hostAlias: HostAlias)
hostAlias
Required ¶
- Type:
cdk8s-plus-29.HostAlias
addInitContainer
¶
public addInitContainer(cont: ContainerProps)
cont
Required ¶
addVolume
¶
public addVolume(vol: Volume)
vol
Required ¶
- Type:
cdk8s-plus-29.Volume
attachContainer
¶
public attachContainer(cont: Container)
cont
Required ¶
- Type:
cdk8s-plus-29.Container
toNetworkPolicyPeerConfig
¶
public toNetworkPolicyPeerConfig()
toPodSelector
¶
public toPodSelector()
toPodSelectorConfig
¶
public toPodSelectorConfig()
toSubjectConfiguration
¶
public toSubjectConfiguration()
Properties ¶
automountServiceAccountToken
Required ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
containers
Required ¶
public readonly containers: Container[];
- Type:
cdk8s-plus-29.Container
[]
dns
Required ¶
public readonly dns: PodDns;
- Type:
cdk8s-plus-29.PodDns
hostAliases
Required ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
initContainers
Required ¶
public readonly initContainers: Container[];
- Type:
cdk8s-plus-29.Container
[]
podMetadata
Required ¶
public readonly podMetadata: ApiObjectMetadataDefinition;
securityContext
Required ¶
public readonly securityContext: PodSecurityContext;
volumes
Required ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[]
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
AwsElasticBlockStorePersistentVolume ¶
Represents an AWS Disk resource that is attached to a kubelet’s host machine and then exposed to the pod.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
Initializers ¶
import { AwsElasticBlockStorePersistentVolume } from 'cdk8s-plus-29'
new AwsElasticBlockStorePersistentVolume(scope: Construct, id: string, props: AwsElasticBlockStorePersistentVolumeProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Properties ¶
fsType
Required ¶
public readonly fsType: string;
- Type:
string
File system type of this volume.
readOnly
Required ¶
public readonly readOnly: boolean;
- Type:
boolean
Whether or not it is mounted as a read-only volume.
volumeId
Required ¶
public readonly volumeId: string;
- Type:
string
Volume id of this volume.
partition
Optional ¶
public readonly partition: number;
- Type:
number
Partition of this volume.
AzureDiskPersistentVolume ¶
AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
Initializers ¶
import { AzureDiskPersistentVolume } from 'cdk8s-plus-29'
new AzureDiskPersistentVolume(scope: Construct, id: string, props: AzureDiskPersistentVolumeProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Properties ¶
azureKind
Required ¶
public readonly azureKind: AzureDiskPersistentVolumeKind;
Azure kind of this volume.
cachingMode
Required ¶
public readonly cachingMode: AzureDiskPersistentVolumeCachingMode;
Caching mode of this volume.
diskName
Required ¶
public readonly diskName: string;
- Type:
string
Disk name of this volume.
diskUri
Required ¶
public readonly diskUri: string;
- Type:
string
Disk URI of this volume.
fsType
Required ¶
public readonly fsType: string;
- Type:
string
File system type of this volume.
readOnly
Required ¶
public readonly readOnly: boolean;
- Type:
boolean
Whether or not it is mounted as a read-only volume.
BasicAuthSecret ¶
Create a secret for basic authentication.
https://kubernetes.io/docs/concepts/configuration/secret/#basic-authentication-secret
Initializers ¶
import { BasicAuthSecret } from 'cdk8s-plus-29'
new BasicAuthSecret(scope: Construct, id: string, props: BasicAuthSecretProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
ClusterRole ¶
- Implements:
cdk8s-plus-29.IClusterRole
,cdk8s-plus-29.IRole
ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
Initializers ¶
import { ClusterRole } from 'cdk8s-plus-29'
new ClusterRole(scope: Construct, id: string, props?: ClusterRoleProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
aggregate
¶
public aggregate(key: string, value: string)
key
Required ¶
- Type:
string
value
Required ¶
- Type:
string
allow
¶
public allow(verbs: string[], endpoints: IApiEndpoint)
verbs
Required ¶
- Type:
string
[]
endpoints
Required ¶
The endpoints(s) to apply to.
allowCreate
¶
public allowCreate(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowDelete
¶
public allowDelete(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowDeleteCollection
¶
public allowDeleteCollection(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowGet
¶
public allowGet(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowList
¶
public allowList(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowPatch
¶
public allowPatch(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowRead
¶
public allowRead(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowReadWrite
¶
public allowReadWrite(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowUpdate
¶
public allowUpdate(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
allowWatch
¶
public allowWatch(endpoints: IApiEndpoint)
endpoints
Required ¶
The resource(s) to apply to.
bind
¶
public bind(subjects: ISubject)
subjects
Required ¶
- Type:
cdk8s-plus-29.ISubject
a list of subjects to bind to.
bindInNamespace
¶
public bindInNamespace(namespace: string, subjects: ISubject)
namespace
Required ¶
- Type:
string
the namespace to limit permissions to.
subjects
Required ¶
- Type:
cdk8s-plus-29.ISubject
a list of subjects to bind to.
combine
¶
public combine(rol: ClusterRole)
rol
Required ¶
Static Functions ¶
fromClusterRoleName
¶
import { ClusterRole } from 'cdk8s-plus-29'
ClusterRole.fromClusterRoleName(scope: Construct, id: string, name: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
rules
Required ¶
public readonly rules: ClusterRolePolicyRule[];
Rules associaated with this Role.
Returns a copy, use allow
to add rules.
ClusterRoleBinding ¶
A ClusterRoleBinding grants permissions cluster-wide to a user or set of users.
Initializers ¶
import { ClusterRoleBinding } from 'cdk8s-plus-29'
new ClusterRoleBinding(scope: Construct, id: string, props: ClusterRoleBindingProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Methods ¶
addSubjects
¶
public addSubjects(subjects: ISubject)
subjects
Required ¶
- Type:
cdk8s-plus-29.ISubject
The subjects to add.
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
role
Required ¶
public readonly role: IClusterRole;
subjects
Required ¶
public readonly subjects: ISubject[];
- Type:
cdk8s-plus-29.ISubject
[]
ConfigMap ¶
- Implements:
cdk8s-plus-29.IConfigMap
ConfigMap holds configuration data for pods to consume.
Initializers ¶
import { ConfigMap } from 'cdk8s-plus-29'
new ConfigMap(scope: Construct, id: string, props?: ConfigMapProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
addBinaryData
¶
public addBinaryData(key: string, value: string)
key
Required ¶
- Type:
string
The key.
value
Required ¶
- Type:
string
The value.
addData
¶
public addData(key: string, value: string)
key
Required ¶
- Type:
string
The key.
value
Required ¶
- Type:
string
The value.
addDirectory
¶
public addDirectory(localDir: string, options?: AddDirectoryOptions)
localDir
Required ¶
- Type:
string
A path to a local directory.
options
Optional ¶
Options.
addFile
¶
public addFile(localFile: string, key?: string)
localFile
Required ¶
- Type:
string
The path to the local file.
key
Optional ¶
- Type:
string
The ConfigMap key (default to the file name).
Static Functions ¶
fromConfigMapName
¶
import { ConfigMap } from 'cdk8s-plus-29'
ConfigMap.fromConfigMapName(scope: Construct, id: string, name: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
Properties ¶
binaryData
Required ¶
public readonly binaryData: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
The binary data associated with this config map.
Returns a copy. To add data records, use addBinaryData()
or addData()
.
data
Required ¶
public readonly data: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
The data associated with this config map.
Returns an copy. To add data records, use addData()
or addBinaryData()
.
immutable
Required ¶
public readonly immutable: boolean;
- Type:
boolean
Whether or not this config map is immutable.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
CronJob ¶
A CronJob is responsible for creating a Job and scheduling it based on provided cron schedule.
This helps running Jobs in a recurring manner.
Initializers ¶
import { CronJob } from 'cdk8s-plus-29'
new CronJob(scope: Construct, id: string, props: CronJobProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Properties ¶
concurrencyPolicy
Required ¶
public readonly concurrencyPolicy: string;
- Type:
string
The policy used by this cron job to determine the concurrency mode in which to schedule jobs.
failedJobsRetained
Required ¶
public readonly failedJobsRetained: number;
- Type:
number
The number of failed jobs retained by this cron job.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
Represents the resource type.
schedule
Required ¶
public readonly schedule: Cron;
- Type:
cdk8s.Cron
The schedule this cron job is scheduled to run in.
startingDeadline
Required ¶
public readonly startingDeadline: Duration;
- Type:
cdk8s.Duration
The time by which the running cron job needs to schedule the next job execution.
The job is considered as failed if it misses this deadline.
successfulJobsRetained
Required ¶
public readonly successfulJobsRetained: number;
- Type:
number
The number of successful jobs retained by this cron job.
suspend
Required ¶
public readonly suspend: boolean;
- Type:
boolean
Whether or not the cron job is currently suspended or not.
timeZone
Optional ¶
public readonly timeZone: string;
- Type:
string
The timezone which this cron job would follow to schedule jobs.
DaemonSet ¶
A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.
Some typical uses of a DaemonSet are:
- running a cluster storage daemon on every node
- running a logs collection daemon on every node
- running a node monitoring daemon on every node
In a simple case, one DaemonSet, covering all nodes, would be used for each type of daemon. A more complex setup might use multiple DaemonSets for a single type of daemon, but with different flags and/or different memory and cpu requests for different hardware types.
Initializers ¶
import { DaemonSet } from 'cdk8s-plus-29'
new DaemonSet(scope: Construct, id: string, props?: DaemonSetProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Properties ¶
minReadySeconds
Required ¶
public readonly minReadySeconds: number;
- Type:
number
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
Deployment ¶
- Implements:
cdk8s-plus-29.IScalable
A Deployment provides declarative updates for Pods and ReplicaSets.
You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
Note: Do not manage ReplicaSets owned by a Deployment. Consider opening an issue in the main Kubernetes repository if your use case is not covered below.
Use Case
The following are typical use cases for Deployments:
- Create a Deployment to rollout a ReplicaSet. The ReplicaSet creates Pods in the background. Check the status of the rollout to see if it succeeds or not.
- Declare the new state of the Pods by updating the PodTemplateSpec of the Deployment. A new ReplicaSet is created and the Deployment manages moving the Pods from the old ReplicaSet to the new one at a controlled rate. Each new ReplicaSet updates the revision of the Deployment.
- Rollback to an earlier Deployment revision if the current state of the Deployment is not stable. Each rollback updates the revision of the Deployment.
- Scale up the Deployment to facilitate more load.
- Pause the Deployment to apply multiple fixes to its PodTemplateSpec and then resume it to start a new rollout.
- Use the status of the Deployment as an indicator that a rollout has stuck.
- Clean up older ReplicaSets that you don’t need anymore.
Initializers ¶
import { Deployment } from 'cdk8s-plus-29'
new Deployment(scope: Construct, id: string, props?: DeploymentProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
exposeViaIngress
¶
public exposeViaIngress(path: string, options?: ExposeDeploymentViaIngressOptions)
path
Required ¶
- Type:
string
The ingress path to register under.
options
Optional ¶
Additional options.
exposeViaService
¶
public exposeViaService(options?: DeploymentExposeViaServiceOptions)
options
Optional ¶
Options to determine details of the service and port exposed.
markHasAutoscaler
¶
public markHasAutoscaler()
toScalingTarget
¶
public toScalingTarget()
Properties ¶
minReady
Required ¶
public readonly minReady: Duration;
- Type:
cdk8s.Duration
Minimum duration for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
progressDeadline
Required ¶
public readonly progressDeadline: Duration;
- Type:
cdk8s.Duration
The maximum duration for a deployment to make progress before it is considered to be failed.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
strategy
Required ¶
public readonly strategy: DeploymentStrategy;
replicas
Optional ¶
public readonly replicas: number;
- Type:
number
Number of desired pods.
hasAutoscaler
Required ¶
public readonly hasAutoscaler: boolean;
- Type:
boolean
If this is a target of an autoscaler.
DockerConfigSecret ¶
Create a secret for storing credentials for accessing a container image registry.
https://kubernetes.io/docs/concepts/configuration/secret/#docker-config-secrets
Initializers ¶
import { DockerConfigSecret } from 'cdk8s-plus-29'
new DockerConfigSecret(scope: Construct, id: string, props: DockerConfigSecretProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
GCEPersistentDiskPersistentVolume ¶
GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet’s host machine and then exposed to the pod.
Provisioned by an admin.
https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
Initializers ¶
import { GCEPersistentDiskPersistentVolume } from 'cdk8s-plus-29'
new GCEPersistentDiskPersistentVolume(scope: Construct, id: string, props: GCEPersistentDiskPersistentVolumeProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Properties ¶
fsType
Required ¶
public readonly fsType: string;
- Type:
string
File system type of this volume.
pdName
Required ¶
public readonly pdName: string;
- Type:
string
PD resource in GCE of this volume.
readOnly
Required ¶
public readonly readOnly: boolean;
- Type:
boolean
Whether or not it is mounted as a read-only volume.
partition
Optional ¶
public readonly partition: number;
- Type:
number
Partition of this volume.
Group ¶
- Implements:
cdk8s-plus-29.ISubject
Represents a group.
Methods ¶
toSubjectConfiguration
¶
public toSubjectConfiguration()
Static Functions ¶
fromName
¶
import { Group } from 'cdk8s-plus-29'
Group.fromName(scope: Construct, id: string, name: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
Properties ¶
kind
Required ¶
public readonly kind: string;
- Type:
string
name
Required ¶
public readonly name: string;
- Type:
string
apiGroup
Optional ¶
public readonly apiGroup: string;
- Type:
string
HorizontalPodAutoscaler ¶
A HorizontalPodAutoscaler scales a workload up or down in response to a metric change.
This allows your services to scale up when demand is high and scale down when they are no longer needed.
Typical use cases for HorizontalPodAutoscaler:
- When Memory usage is above 70%, scale up the number of replicas to meet the demand.
- When CPU usage is below 30%, scale down the number of replicas to save resources.
- When a service is experiencing a spike in traffic, scale up the number of replicas to meet the demand. Then, when the traffic subsides, scale down the number of replicas to save resources.
The autoscaler uses the following algorithm to determine the number of replicas to scale:
desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]
HorizontalPodAutoscaler’s can be used to with any Scalable
workload:
* Deployment
* StatefulSet
Targets that already have a replica count defined:
Remove any replica counts from the target resource before associating with a HorizontalPodAutoscaler. If this isn’t done, then any time a change to that object is applied, Kubernetes will scale the current number of Pods to the value of the target.replicas key. This may not be desired and could lead to unexpected behavior.
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#implicit-maintenance-mode-deactivation
Initializers ¶
import { HorizontalPodAutoscaler } from 'cdk8s-plus-29'
new HorizontalPodAutoscaler(scope: Construct, id: string, props: HorizontalPodAutoscalerProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Properties ¶
maxReplicas
Required ¶
public readonly maxReplicas: number;
- Type:
number
The maximum number of replicas that can be scaled up to.
minReplicas
Required ¶
public readonly minReplicas: number;
- Type:
number
The minimum number of replicas that can be scaled down to.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
scaleDown
Required ¶
public readonly scaleDown: ScalingRules;
The scaling behavior when scaling down.
scaleUp
Required ¶
public readonly scaleUp: ScalingRules;
The scaling behavior when scaling up.
target
Required ¶
public readonly target: IScalable;
- Type:
cdk8s-plus-29.IScalable
The workload to scale up or down.
metrics
Optional ¶
public readonly metrics: Metric[];
- Type:
cdk8s-plus-29.Metric
[]
The metric conditions that trigger a scale up or scale down.
Ingress ¶
Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend.
An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
Initializers ¶
import { Ingress } from 'cdk8s-plus-29'
new Ingress(scope: Construct, id: string, props?: IngressProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
addDefaultBackend
¶
public addDefaultBackend(backend: IngressBackend)
backend
Required ¶
The backend to use for requests that do not match any rule.
addHostDefaultBackend
¶
public addHostDefaultBackend(host: string, backend: IngressBackend)
host
Required ¶
- Type:
string
The host name to match.
backend
Required ¶
The backend to route to.
addHostRule
¶
public addHostRule(host: string, path: string, backend: IngressBackend, pathType?: HttpIngressPathType)
host
Required ¶
- Type:
string
The host name.
path
Required ¶
- Type:
string
The HTTP path.
backend
Required ¶
The backend to route requests to.
pathType
Optional ¶
How the path is matched against request paths.
addRule
¶
public addRule(path: string, backend: IngressBackend, pathType?: HttpIngressPathType)
path
Required ¶
- Type:
string
The HTTP path.
backend
Required ¶
The backend to route requests to.
pathType
Optional ¶
How the path is matched against request paths.
addRules
¶
public addRules(rules: IngressRule)
rules
Required ¶
The rules to add.
addTls
¶
public addTls(tls: IngressTls[])
tls
Required ¶
- Type:
cdk8s-plus-29.IngressTls
[]
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
Job ¶
A Job creates one or more Pods and ensures that a specified number of them successfully terminate.
As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot). You can also use a Job to run multiple Pods in parallel.
Initializers ¶
import { Job } from 'cdk8s-plus-29'
new Job(scope: Construct, id: string, props?: JobProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
- Type:
cdk8s-plus-29.JobProps
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
activeDeadline
Optional ¶
public readonly activeDeadline: Duration;
- Type:
cdk8s.Duration
Duration before job is terminated.
If undefined, there is no deadline.
backoffLimit
Optional ¶
public readonly backoffLimit: number;
- Type:
number
Number of retries before marking failed.
ttlAfterFinished
Optional ¶
public readonly ttlAfterFinished: Duration;
- Type:
cdk8s.Duration
TTL before the job is deleted after it is finished.
Namespace ¶
In Kubernetes, namespaces provides a mechanism for isolating groups of resources within a single cluster.
Names of resources need to be unique within a namespace, but not across namespaces. Namespace-based scoping is applicable only for namespaced objects (e.g. Deployments, Services, etc) and not for cluster-wide objects (e.g. StorageClass, Nodes, PersistentVolumes, etc).
Initializers ¶
import { Namespace } from 'cdk8s-plus-29'
new Namespace(scope: Construct, id: string, props?: NamespaceProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
toNamespaceSelectorConfig
¶
public toNamespaceSelectorConfig()
toNetworkPolicyPeerConfig
¶
public toNetworkPolicyPeerConfig()
toPodSelector
¶
public toPodSelector()
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
Constants ¶
NAME_LABEL
¶
- Type:
string
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#automatic-labelling
Namespaces ¶
Represents a group of namespaces.
Initializers ¶
import { Namespaces } from 'cdk8s-plus-29'
new Namespaces(scope: Construct, id: string, expressions?: LabelExpression[], names?: string[], labels?: {[ key: string ]: string})
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
expressions
Optional ¶
- Type:
cdk8s-plus-29.LabelExpression
[]
names
Optional ¶
- Type:
string
[]
labels
Optional ¶
- Type: {[ key: string ]:
string
}
Methods ¶
toNamespaceSelectorConfig
¶
public toNamespaceSelectorConfig()
toNetworkPolicyPeerConfig
¶
public toNetworkPolicyPeerConfig()
toPodSelector
¶
public toPodSelector()
Static Functions ¶
all
¶
import { Namespaces } from 'cdk8s-plus-29'
Namespaces.all(scope: Construct, id: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
select
¶
import { Namespaces } from 'cdk8s-plus-29'
Namespaces.select(scope: Construct, id: string, options: NamespacesSelectOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
options
Required ¶
NetworkPolicy ¶
Control traffic flow at the IP address or port level (OSI layer 3 or 4), network policies are an application-centric construct which allow you to specify how a pod is allowed to communicate with various network peers.
Outgoing traffic is allowed if there are no network policies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the network policies that select the pod.
- Incoming traffic is allowed to a pod if there are no network policies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod’s local node, OR if the traffic matches at least one ingress rule across all of the network policies that select the pod.
Network policies do not conflict; they are additive. If any policy or policies apply to a given pod for a given direction, the connections allowed in that direction from that pod is the union of what the applicable policies allow. Thus, order of evaluation does not affect the policy result.
For a connection from a source pod to a destination pod to be allowed, both the egress policy on the source pod and the ingress policy on the destination pod need to allow the connection. If either side does not allow the connection, it will not happen.
https://kubernetes.io/docs/concepts/services-networking/network-policies/#networkpolicy-resource
Initializers ¶
import { NetworkPolicy } from 'cdk8s-plus-29'
new NetworkPolicy(scope: Construct, id: string, props?: NetworkPolicyProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
addEgressRule
¶
public addEgressRule(peer: INetworkPolicyPeer, ports?: NetworkPolicyPort[])
peer
Required ¶
ports
Optional ¶
- Type:
cdk8s-plus-29.NetworkPolicyPort
[]
addIngressRule
¶
public addIngressRule(peer: INetworkPolicyPeer, ports?: NetworkPolicyPort[])
peer
Required ¶
ports
Optional ¶
- Type:
cdk8s-plus-29.NetworkPolicyPort
[]
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
NetworkPolicyIpBlock ¶
- Implements:
cdk8s-plus-29.INetworkPolicyPeer
Describes a particular CIDR (Ex.
“192.168.1.1/24”,”2001:db9::/64”) that is allowed to the pods matched by a network policy selector. The except entry describes CIDRs that should not be included within this rule.
Methods ¶
toNetworkPolicyPeerConfig
¶
public toNetworkPolicyPeerConfig()
toPodSelector
¶
public toPodSelector()
Static Functions ¶
anyIpv4
¶
import { NetworkPolicyIpBlock } from 'cdk8s-plus-29'
NetworkPolicyIpBlock.anyIpv4(scope: Construct, id: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
anyIpv6
¶
import { NetworkPolicyIpBlock } from 'cdk8s-plus-29'
NetworkPolicyIpBlock.anyIpv6(scope: Construct, id: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
ipv4
¶
import { NetworkPolicyIpBlock } from 'cdk8s-plus-29'
NetworkPolicyIpBlock.ipv4(scope: Construct, id: string, cidrIp: string, except?: string[])
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
cidrIp
Required ¶
- Type:
string
except
Optional ¶
- Type:
string
[]
ipv6
¶
import { NetworkPolicyIpBlock } from 'cdk8s-plus-29'
NetworkPolicyIpBlock.ipv6(scope: Construct, id: string, cidrIp: string, except?: string[])
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
cidrIp
Required ¶
- Type:
string
except
Optional ¶
- Type:
string
[]
Properties ¶
cidr
Required ¶
public readonly cidr: string;
- Type:
string
A string representing the IP Block Valid examples are “192.168.1.1/24” or “2001:db9::/64”.
except
Optional ¶
public readonly except: string[];
- Type:
string
[]
A slice of CIDRs that should not be included within an IP Block Valid examples are “192.168.1.1/24” or “2001:db9::/64”. Except values will be rejected if they are outside the CIDR range.
PersistentVolume ¶
- Implements:
cdk8s-plus-29.IPersistentVolume
,cdk8s-plus-29.IStorage
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes.
It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.
Initializers ¶
import { PersistentVolume } from 'cdk8s-plus-29'
new PersistentVolume(scope: Construct, id: string, props?: PersistentVolumeProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
asVolume
¶
public asVolume()
bind
¶
public bind(claim: IPersistentVolumeClaim)
claim
Required ¶
The PVC to bind to.
reserve
¶
public reserve()
Static Functions ¶
fromPersistentVolumeName
¶
import { PersistentVolume } from 'cdk8s-plus-29'
PersistentVolume.fromPersistentVolumeName(scope: Construct, id: string, volumeName: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
volumeName
Required ¶
- Type:
string
Properties ¶
mode
Required ¶
public readonly mode: PersistentVolumeMode;
Volume mode of this volume.
reclaimPolicy
Required ¶
public readonly reclaimPolicy: PersistentVolumeReclaimPolicy;
Reclaim policy of this volume.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
Access modes requirement of this claim.
claim
Optional ¶
public readonly claim: IPersistentVolumeClaim;
PVC this volume is bound to.
Undefined means this volume is not yet claimed by any PVC.
mountOptions
Optional ¶
public readonly mountOptions: string[];
- Type:
string
[]
Mount options of this volume.
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
Storage size of this volume.
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
Storage class this volume belongs to.
PersistentVolumeClaim ¶
- Implements:
cdk8s-plus-29.IPersistentVolumeClaim
A PersistentVolumeClaim (PVC) is a request for storage by a user.
It is similar to a Pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes
Initializers ¶
import { PersistentVolumeClaim } from 'cdk8s-plus-29'
new PersistentVolumeClaim(scope: Construct, id: string, props?: PersistentVolumeClaimProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
bind
¶
public bind(vol: IPersistentVolume)
vol
Required ¶
The PV to bind to.
Static Functions ¶
fromClaimName
¶
import { PersistentVolumeClaim } from 'cdk8s-plus-29'
PersistentVolumeClaim.fromClaimName(scope: Construct, id: string, claimName: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
claimName
Required ¶
- Type:
string
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
volumeMode
Required ¶
public readonly volumeMode: PersistentVolumeMode;
Volume mode requirement of this claim.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
Access modes requirement of this claim.
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
Storage requirement of this claim.
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
Storage class requirment of this claim.
volume
Optional ¶
public readonly volume: IPersistentVolume;
PV this claim is bound to.
Undefined means the claim is not bound to any specific volume.
Pod ¶
Pod is a collection of containers that can run on a host.
This resource is created by clients and scheduled onto hosts.
Initializers ¶
import { Pod } from 'cdk8s-plus-29'
new Pod(scope: Construct, id: string, props?: PodProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
- Type:
cdk8s-plus-29.PodProps
Properties ¶
connections
Required ¶
public readonly connections: PodConnections;
podMetadata
Required ¶
public readonly podMetadata: ApiObjectMetadataDefinition;
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
scheduling
Required ¶
public readonly scheduling: PodScheduling;
Constants ¶
ADDRESS_LABEL
¶
- Type:
string
This label is autoamtically added by cdk8s to any pod.
It provides a unique and stable identifier for the pod.
Pods ¶
- Implements:
cdk8s-plus-29.IPodSelector
Represents a group of pods.
Initializers ¶
import { Pods } from 'cdk8s-plus-29'
new Pods(scope: Construct, id: string, expressions?: LabelExpression[], labels?: {[ key: string ]: string}, namespaces?: INamespaceSelector)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
expressions
Optional ¶
- Type:
cdk8s-plus-29.LabelExpression
[]
labels
Optional ¶
- Type: {[ key: string ]:
string
}
namespaces
Optional ¶
Methods ¶
toNetworkPolicyPeerConfig
¶
public toNetworkPolicyPeerConfig()
toPodSelector
¶
public toPodSelector()
toPodSelectorConfig
¶
public toPodSelectorConfig()
Static Functions ¶
all
¶
import { Pods } from 'cdk8s-plus-29'
Pods.all(scope: Construct, id: string, options?: PodsAllOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
options
Optional ¶
select
¶
import { Pods } from 'cdk8s-plus-29'
Pods.select(scope: Construct, id: string, options: PodsSelectOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
options
Required ¶
Resource ¶
Base class for all Kubernetes objects in stdk8s.
Represents a single resource.
Initializers ¶
import { Resource } from 'cdk8s-plus-29'
new Resource(scope: Construct, id: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
Methods ¶
asApiResource
¶
public asApiResource()
asNonApiResource
¶
public asNonApiResource()
Properties ¶
apiGroup
Required ¶
public readonly apiGroup: string;
- Type:
string
The group portion of the API version (e.g. “authorization.k8s.io”).
apiVersion
Required ¶
public readonly apiVersion: string;
- Type:
string
The object’s API version (e.g. “authorization.k8s.io/v1”).
kind
Required ¶
public readonly kind: string;
- Type:
string
The object kind (e.g. “Deployment”).
metadata
Required ¶
public readonly metadata: ApiObjectMetadataDefinition;
name
Required ¶
public readonly name: string;
- Type:
string
The name of this API object.
permissions
Required ¶
public readonly permissions: ResourcePermissions;
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
resourceName
Optional ¶
public readonly resourceName: string;
- Type:
string
The unique, namespace-global, name of an object inside the Kubernetes cluster.
If this is omitted, the ApiResource should represent all objects of the given type.
Role ¶
- Implements:
cdk8s-plus-29.IRole
Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
Initializers ¶
import { Role } from 'cdk8s-plus-29'
new Role(scope: Construct, id: string, props?: RoleProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
- Type:
cdk8s-plus-29.RoleProps
Methods ¶
allow
¶
public allow(verbs: string[], resources: IApiResource)
verbs
Required ¶
- Type:
string
[]
resources
Required ¶
The resource(s) to apply to.
allowCreate
¶
public allowCreate(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowDelete
¶
public allowDelete(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowDeleteCollection
¶
public allowDeleteCollection(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowGet
¶
public allowGet(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowList
¶
public allowList(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowPatch
¶
public allowPatch(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowRead
¶
public allowRead(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowReadWrite
¶
public allowReadWrite(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowUpdate
¶
public allowUpdate(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
allowWatch
¶
public allowWatch(resources: IApiResource)
resources
Required ¶
The resource(s) to apply to.
bind
¶
public bind(subjects: ISubject)
subjects
Required ¶
- Type:
cdk8s-plus-29.ISubject
a list of subjects to bind to.
Static Functions ¶
fromRoleName
¶
import { Role } from 'cdk8s-plus-29'
Role.fromRoleName(scope: Construct, id: string, name: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
rules
Required ¶
public readonly rules: RolePolicyRule[];
- Type:
cdk8s-plus-29.RolePolicyRule
[]
Rules associaated with this Role.
Returns a copy, use allow
to add rules.
RoleBinding ¶
A RoleBinding grants permissions within a specific namespace to a user or set of users.
Initializers ¶
import { RoleBinding } from 'cdk8s-plus-29'
new RoleBinding(scope: Construct, id: string, props: RoleBindingProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Methods ¶
addSubjects
¶
public addSubjects(subjects: ISubject)
subjects
Required ¶
- Type:
cdk8s-plus-29.ISubject
The subjects to add.
Properties ¶
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
role
Required ¶
public readonly role: IRole;
- Type:
cdk8s-plus-29.IRole
subjects
Required ¶
public readonly subjects: ISubject[];
- Type:
cdk8s-plus-29.ISubject
[]
Secret ¶
- Implements:
cdk8s-plus-29.ISecret
Kubernetes Secrets let you store and manage sensitive information, such as passwords, OAuth tokens, and ssh keys.
Storing confidential information in a Secret is safer and more flexible than putting it verbatim in a Pod definition or in a container image.
https://kubernetes.io/docs/concepts/configuration/secret
Initializers ¶
import { Secret } from 'cdk8s-plus-29'
new Secret(scope: Construct, id: string, props?: SecretProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
addStringData
¶
public addStringData(key: string, value: string)
key
Required ¶
- Type:
string
Key.
value
Required ¶
- Type:
string
Value.
envValue
¶
public envValue(key: string, options?: EnvValueFromSecretOptions)
key
Required ¶
- Type:
string
options
Optional ¶
getStringData
¶
public getStringData(key: string)
key
Required ¶
- Type:
string
Key.
Static Functions ¶
fromSecretName
¶
import { Secret } from 'cdk8s-plus-29'
Secret.fromSecretName(scope: Construct, id: string, name: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
Properties ¶
immutable
Required ¶
public readonly immutable: boolean;
- Type:
boolean
Whether or not the secret is immutable.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
Service ¶
An abstract way to expose an application running on a set of Pods as a network service.
With Kubernetes you don’t need to modify your application to use an unfamiliar service discovery mechanism. Kubernetes gives Pods their own IP addresses and a single DNS name for a set of Pods, and can load-balance across them.
For example, consider a stateless image-processing backend which is running with 3 replicas. Those replicas are fungible—frontends do not care which backend they use. While the actual Pods that compose the backend set may change, the frontend clients should not need to be aware of that, nor should they need to keep track of the set of backends themselves. The Service abstraction enables this decoupling.
If you’re able to use Kubernetes APIs for service discovery in your application, you can query the API server for Endpoints, that get updated whenever the set of Pods in a Service changes. For non-native applications, Kubernetes offers ways to place a network port or load balancer in between your application and the backend Pods.
Initializers ¶
import { Service } from 'cdk8s-plus-29'
new Service(scope: Construct, id: string, props?: ServiceProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
bind
¶
public bind(port: number, options?: ServiceBindOptions)
port
Required ¶
- Type:
number
The port definition.
options
Optional ¶
exposeViaIngress
¶
public exposeViaIngress(path: string, options?: ExposeServiceViaIngressOptions)
path
Required ¶
- Type:
string
The path to expose the service under.
options
Optional ¶
Additional options.
select
¶
public select(selector: IPodSelector)
selector
Required ¶
selectLabel
¶
public selectLabel(key: string, value: string)
key
Required ¶
- Type:
string
value
Required ¶
- Type:
string
Properties ¶
port
Required ¶
public readonly port: number;
- Type:
number
Return the first port of the service.
ports
Required ¶
public readonly ports: ServicePort[];
- Type:
cdk8s-plus-29.ServicePort
[]
Ports for this service.
Use bind()
to bind additional service ports.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
type
Required ¶
public readonly type: ServiceType;
Determines how the Service is exposed.
clusterIP
Optional ¶
public readonly clusterIP: string;
- Type:
string
The IP address of the service and is usually assigned randomly by the master.
externalName
Optional ¶
public readonly externalName: string;
- Type:
string
The externalName to be used for EXTERNAL_NAME types.
ServiceAccount ¶
- Implements:
cdk8s-plus-29.IServiceAccount
,cdk8s-plus-29.ISubject
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account
Initializers ¶
import { ServiceAccount } from 'cdk8s-plus-29'
new ServiceAccount(scope: Construct, id: string, props?: ServiceAccountProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
Methods ¶
addSecret
¶
public addSecret(secr: ISecret)
secr
Required ¶
- Type:
cdk8s-plus-29.ISecret
The secret.
toSubjectConfiguration
¶
public toSubjectConfiguration()
Static Functions ¶
fromServiceAccountName
¶
import { ServiceAccount } from 'cdk8s-plus-29'
ServiceAccount.fromServiceAccountName(scope: Construct, id: string, name: string, options?: FromServiceAccountNameOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
The name of the service account resource.
options
Optional ¶
additional options.
Properties ¶
automountToken
Required ¶
public readonly automountToken: boolean;
- Type:
boolean
Whether or not a token is automatically mounted for this service account.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
secrets
Required ¶
public readonly secrets: ISecret[];
- Type:
cdk8s-plus-29.ISecret
[]
List of secrets allowed to be used by pods running using this service account.
Returns a copy. To add a secret, use addSecret()
.
ServiceAccountTokenSecret ¶
Create a secret for a service account token.
https://kubernetes.io/docs/concepts/configuration/secret/#service-account-token-secrets
Initializers ¶
import { ServiceAccountTokenSecret } from 'cdk8s-plus-29'
new ServiceAccountTokenSecret(scope: Construct, id: string, props: ServiceAccountTokenSecretProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
SshAuthSecret ¶
Create a secret for ssh authentication.
https://kubernetes.io/docs/concepts/configuration/secret/#ssh-authentication-secrets
Initializers ¶
import { SshAuthSecret } from 'cdk8s-plus-29'
new SshAuthSecret(scope: Construct, id: string, props: SshAuthSecretProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
StatefulSet ¶
- Implements:
cdk8s-plus-29.IScalable
StatefulSet is the workload API object used to manage stateful applications.
Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.
Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.
If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.
Using StatefulSets¶
StatefulSets are valuable for applications that require one or more of the following.
- Stable, unique network identifiers.
- Stable, persistent storage.
- Ordered, graceful deployment and scaling.
- Ordered, automated rolling updates.
Initializers ¶
import { StatefulSet } from 'cdk8s-plus-29'
new StatefulSet(scope: Construct, id: string, props: StatefulSetProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Methods ¶
markHasAutoscaler
¶
public markHasAutoscaler()
toScalingTarget
¶
public toScalingTarget()
Properties ¶
minReady
Required ¶
public readonly minReady: Duration;
- Type:
cdk8s.Duration
Minimum duration for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
podManagementPolicy
Required ¶
public readonly podManagementPolicy: PodManagementPolicy;
Management policy to use for the set.
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of a resource type as it appears in the relevant API endpoint.
service
Required ¶
public readonly service: Service;
- Type:
cdk8s-plus-29.Service
strategy
Required ¶
public readonly strategy: StatefulSetUpdateStrategy;
The update startegy of this stateful set.
replicas
Optional ¶
public readonly replicas: number;
- Type:
number
Number of desired pods.
hasAutoscaler
Required ¶
public readonly hasAutoscaler: boolean;
- Type:
boolean
If this is a target of an autoscaler.
TlsSecret ¶
Create a secret for storing a TLS certificate and its associated key.
https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets
Initializers ¶
import { TlsSecret } from 'cdk8s-plus-29'
new TlsSecret(scope: Construct, id: string, props: TlsSecretProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
User ¶
- Implements:
cdk8s-plus-29.ISubject
Represents a user.
Methods ¶
toSubjectConfiguration
¶
public toSubjectConfiguration()
Static Functions ¶
fromName
¶
import { User } from 'cdk8s-plus-29'
User.fromName(scope: Construct, id: string, name: string)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
Properties ¶
kind
Required ¶
public readonly kind: string;
- Type:
string
name
Required ¶
public readonly name: string;
- Type:
string
apiGroup
Optional ¶
public readonly apiGroup: string;
- Type:
string
Volume ¶
- Implements:
cdk8s-plus-29.IStorage
Volume represents a named volume in a pod that may be accessed by any container in the pod.
Docker also has a concept of volumes, though it is somewhat looser and less managed. In Docker, a volume is simply a directory on disk or in another Container. Lifetimes are not managed and until very recently there were only local-disk-backed volumes. Docker now provides volume drivers, but the functionality is very limited for now (e.g. as of Docker 1.7 only one volume driver is allowed per Container and there is no way to pass parameters to volumes).
A Kubernetes volume, on the other hand, has an explicit lifetime - the same as the Pod that encloses it. Consequently, a volume outlives any Containers that run within the Pod, and data is preserved across Container restarts. Of course, when a Pod ceases to exist, the volume will cease to exist, too. Perhaps more importantly than this, Kubernetes supports many types of volumes, and a Pod can use any number of them simultaneously.
At its core, a volume is just a directory, possibly with some data in it, which is accessible to the Containers in a Pod. How that directory comes to be, the medium that backs it, and the contents of it are determined by the particular volume type used.
To use a volume, a Pod specifies what volumes to provide for the Pod (the .spec.volumes field) and where to mount those into Containers (the .spec.containers[*].volumeMounts field).
A process in a container sees a filesystem view composed from their Docker image and volumes. The Docker image is at the root of the filesystem hierarchy, and any volumes are mounted at the specified paths within the image. Volumes can not mount onto other volumes
Methods ¶
asVolume
¶
public asVolume()
Static Functions ¶
fromAwsElasticBlockStore
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromAwsElasticBlockStore(scope: Construct, id: string, volumeId: string, options?: AwsElasticBlockStoreVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
volumeId
Required ¶
- Type:
string
options
Optional ¶
fromAzureDisk
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromAzureDisk(scope: Construct, id: string, diskName: string, diskUri: string, options?: AzureDiskVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
diskName
Required ¶
- Type:
string
diskUri
Required ¶
- Type:
string
options
Optional ¶
fromConfigMap
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromConfigMap(scope: Construct, id: string, configMap: IConfigMap, options?: ConfigMapVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
configMap
Required ¶
- Type:
cdk8s-plus-29.IConfigMap
The config map to use to populate the volume.
options
Optional ¶
Options.
fromCsi
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromCsi(scope: Construct, id: string, driver: string, options?: CsiVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
driver
Required ¶
- Type:
string
The name of the CSI driver to use to populate the volume.
options
Optional ¶
Options for the CSI volume, including driver-specific ones.
fromEmptyDir
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromEmptyDir(scope: Construct, id: string, name: string, options?: EmptyDirVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
options
Optional ¶
Additional options.
fromGcePersistentDisk
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromGcePersistentDisk(scope: Construct, id: string, pdName: string, options?: GCEPersistentDiskVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
pdName
Required ¶
- Type:
string
options
Optional ¶
fromHostPath
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromHostPath(scope: Construct, id: string, name: string, options: HostPathVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
options
Required ¶
fromNfs
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromNfs(scope: Construct, id: string, name: string, options: NfsVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
name
Required ¶
- Type:
string
options
Required ¶
fromPersistentVolumeClaim
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromPersistentVolumeClaim(scope: Construct, id: string, claim: IPersistentVolumeClaim, options?: PersistentVolumeClaimVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
claim
Required ¶
options
Optional ¶
fromSecret
¶
import { Volume } from 'cdk8s-plus-29'
Volume.fromSecret(scope: Construct, id: string, secr: ISecret, options?: SecretVolumeOptions)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
secr
Required ¶
- Type:
cdk8s-plus-29.ISecret
The secret to use to populate the volume.
options
Optional ¶
Options.
Properties ¶
name
Required ¶
public readonly name: string;
- Type:
string
Workload ¶
A workload is an application running on Kubernetes.
Whether your workload is a single component or several that work together, on Kubernetes you run it inside a set of pods. In Kubernetes, a Pod represents a set of running containers on your cluster.
Initializers ¶
import { Workload } from 'cdk8s-plus-29'
new Workload(scope: Construct, id: string, props: WorkloadProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
Methods ¶
select
¶
public select(selectors: LabelSelector)
selectors
Required ¶
Properties ¶
connections
Required ¶
public readonly connections: PodConnections;
matchExpressions
Required ¶
public readonly matchExpressions: LabelSelectorRequirement[];
The expression matchers this workload will use in order to select pods.
Returns a a copy. Use select()
to add expression matchers.
matchLabels
Required ¶
public readonly matchLabels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
The label matchers this workload will use in order to select pods.
Returns a a copy. Use select()
to add label matchers.
podMetadata
Required ¶
public readonly podMetadata: ApiObjectMetadataDefinition;
The metadata of pods in this workload.
scheduling
Required ¶
public readonly scheduling: WorkloadScheduling;
Structs ¶
AbstractPodProps ¶
Properties for AbstractPod
.
Initializer ¶
import { AbstractPodProps } from 'cdk8s-plus-29'
const abstractPodProps: AbstractPodProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
AddDeploymentOptions ¶
Options to add a deployment to a service.
Initializer ¶
import { AddDeploymentOptions } from 'cdk8s-plus-29'
const addDeploymentOptions: AddDeploymentOptions = { ... }
name
Optional ¶
public readonly name: string;
- Type:
string
The name of this port within the service.
This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the ‘Name’ field in EndpointPort objects. Optional if only one ServicePort is defined on this service.
nodePort
Optional ¶
public readonly nodePort: number;
- Type:
number
- Default: auto-allocate a port if the ServiceType of this Service requires one.
The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one.
https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
protocol
Optional ¶
public readonly protocol: Protocol;
- Type:
cdk8s-plus-29.Protocol
- Default: Protocol.TCP
The IP protocol for this port.
Supports “TCP”, “UDP”, and “SCTP”. Default is TCP.
targetPort
Optional ¶
public readonly targetPort: number;
- Type:
number
- Default: The value of
port
will be used.
The port number the service will redirect to.
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: Copied from the first container of the deployment.
The port number the service will bind to.
AddDirectoryOptions ¶
Options for configmap.addDirectory()
.
Initializer ¶
import { AddDirectoryOptions } from 'cdk8s-plus-29'
const addDirectoryOptions: AddDirectoryOptions = { ... }
exclude
Optional ¶
public readonly exclude: string[];
- Type:
string
[] - Default: include all files
Glob patterns to exclude when adding files.
keyPrefix
Optional ¶
public readonly keyPrefix: string;
- Type:
string
- Default: “”
A prefix to add to all keys in the config map.
ApiResourceOptions ¶
Options for ApiResource
.
Initializer ¶
import { ApiResourceOptions } from 'cdk8s-plus-29'
const apiResourceOptions: ApiResourceOptions = { ... }
apiGroup
Required ¶
public readonly apiGroup: string;
- Type:
string
The group portion of the API version (e.g. authorization.k8s.io
).
resourceType
Required ¶
public readonly resourceType: string;
- Type:
string
The name of the resource type as it appears in the relevant API endpoint.
https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources
AwsElasticBlockStorePersistentVolumeProps ¶
Properties for AwsElasticBlockStorePersistentVolume
.
Initializer ¶
import { AwsElasticBlockStorePersistentVolumeProps } from 'cdk8s-plus-29'
const awsElasticBlockStorePersistentVolumeProps: AwsElasticBlockStorePersistentVolumeProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
- Type:
cdk8s-plus-29.PersistentVolumeAccessMode
[] - Default: No access modes.
Contains all ways the volume can be mounted.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
claim
Optional ¶
public readonly claim: IPersistentVolumeClaim;
- Type:
cdk8s-plus-29.IPersistentVolumeClaim
- Default: Not bound to a specific claim.
Part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
Expected to be non-nil when bound.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding
mountOptions
Optional ¶
public readonly mountOptions: string[];
- Type:
string
[] - Default: No options.
A list of mount options, e.g. [“ro”, “soft”]. Not validated - mount will simply fail if one is invalid.
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
reclaimPolicy
Optional ¶
public readonly reclaimPolicy: PersistentVolumeReclaimPolicy;
- Type:
cdk8s-plus-29.PersistentVolumeReclaimPolicy
- Default: PersistentVolumeReclaimPolicy.RETAIN
When a user is done with their volume, they can delete the PVC objects from the API that allows reclamation of the resource.
The reclaim policy tells the cluster what to do with the volume after it has been released of its claim.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
- Default: No specified.
What is the storage capacity of this volume.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
- Default: Volume does not belong to any storage class.
Name of StorageClass to which this persistent volume belongs.
volumeMode
Optional ¶
public readonly volumeMode: PersistentVolumeMode;
- Type:
cdk8s-plus-29.PersistentVolumeMode
- Default: VolumeMode.FILE_SYSTEM
Defines what type of volume is required by the claim.
volumeId
Required ¶
public readonly volumeId: string;
- Type:
string
Unique ID of the persistent disk resource in AWS (Amazon EBS volume).
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: ‘ext4’
Filesystem type of the volume that you want to mount.
Tip: Ensure that the filesystem type is supported by the host operating system.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
partition
Optional ¶
public readonly partition: number;
- Type:
number
- Default: No partition.
The partition in the volume that you want to mount.
If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as “1”. Similarly, the volume partition for /dev/sda is “0” (or you can leave the property empty).
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Specify “true” to force and set the ReadOnly property in VolumeMounts to “true”.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
AwsElasticBlockStoreVolumeOptions ¶
Options of Volume.fromAwsElasticBlockStore
.
Initializer ¶
import { AwsElasticBlockStoreVolumeOptions } from 'cdk8s-plus-29'
const awsElasticBlockStoreVolumeOptions: AwsElasticBlockStoreVolumeOptions = { ... }
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: ‘ext4’
Filesystem type of the volume that you want to mount.
Tip: Ensure that the filesystem type is supported by the host operating system.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto-generated
The volume name.
partition
Optional ¶
public readonly partition: number;
- Type:
number
- Default: No partition.
The partition in the volume that you want to mount.
If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as “1”. Similarly, the volume partition for /dev/sda is “0” (or you can leave the property empty).
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Specify “true” to force and set the ReadOnly property in VolumeMounts to “true”.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
AzureDiskPersistentVolumeProps ¶
Properties for AzureDiskPersistentVolume
.
Initializer ¶
import { AzureDiskPersistentVolumeProps } from 'cdk8s-plus-29'
const azureDiskPersistentVolumeProps: AzureDiskPersistentVolumeProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
- Type:
cdk8s-plus-29.PersistentVolumeAccessMode
[] - Default: No access modes.
Contains all ways the volume can be mounted.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
claim
Optional ¶
public readonly claim: IPersistentVolumeClaim;
- Type:
cdk8s-plus-29.IPersistentVolumeClaim
- Default: Not bound to a specific claim.
Part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
Expected to be non-nil when bound.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding
mountOptions
Optional ¶
public readonly mountOptions: string[];
- Type:
string
[] - Default: No options.
A list of mount options, e.g. [“ro”, “soft”]. Not validated - mount will simply fail if one is invalid.
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
reclaimPolicy
Optional ¶
public readonly reclaimPolicy: PersistentVolumeReclaimPolicy;
- Type:
cdk8s-plus-29.PersistentVolumeReclaimPolicy
- Default: PersistentVolumeReclaimPolicy.RETAIN
When a user is done with their volume, they can delete the PVC objects from the API that allows reclamation of the resource.
The reclaim policy tells the cluster what to do with the volume after it has been released of its claim.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
- Default: No specified.
What is the storage capacity of this volume.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
- Default: Volume does not belong to any storage class.
Name of StorageClass to which this persistent volume belongs.
volumeMode
Optional ¶
public readonly volumeMode: PersistentVolumeMode;
- Type:
cdk8s-plus-29.PersistentVolumeMode
- Default: VolumeMode.FILE_SYSTEM
Defines what type of volume is required by the claim.
diskName
Required ¶
public readonly diskName: string;
- Type:
string
The Name of the data disk in the blob storage.
diskUri
Required ¶
public readonly diskUri: string;
- Type:
string
The URI the data disk in the blob storage.
cachingMode
Optional ¶
public readonly cachingMode: AzureDiskPersistentVolumeCachingMode;
- Type:
cdk8s-plus-29.AzureDiskPersistentVolumeCachingMode
- Default: AzureDiskPersistentVolumeCachingMode.NONE.
Host Caching mode.
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: ‘ext4’
Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
kind
Optional ¶
public readonly kind: AzureDiskPersistentVolumeKind;
- Type:
cdk8s-plus-29.AzureDiskPersistentVolumeKind
- Default: AzureDiskPersistentVolumeKind.SHARED
Kind of disk.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Force the ReadOnly setting in VolumeMounts.
AzureDiskVolumeOptions ¶
Options of Volume.fromAzureDisk
.
Initializer ¶
import { AzureDiskVolumeOptions } from 'cdk8s-plus-29'
const azureDiskVolumeOptions: AzureDiskVolumeOptions = { ... }
cachingMode
Optional ¶
public readonly cachingMode: AzureDiskPersistentVolumeCachingMode;
- Type:
cdk8s-plus-29.AzureDiskPersistentVolumeCachingMode
- Default: AzureDiskPersistentVolumeCachingMode.NONE.
Host Caching mode.
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: ‘ext4’
Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
kind
Optional ¶
public readonly kind: AzureDiskPersistentVolumeKind;
- Type:
cdk8s-plus-29.AzureDiskPersistentVolumeKind
- Default: AzureDiskPersistentVolumeKind.SHARED
Kind of disk.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto-generated
The volume name.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Force the ReadOnly setting in VolumeMounts.
BasicAuthSecretProps ¶
Options for BasicAuthSecret
.
Initializer ¶
import { BasicAuthSecretProps } from 'cdk8s-plus-29'
const basicAuthSecretProps: BasicAuthSecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
password
Required ¶
public readonly password: string;
- Type:
string
The password or token for authentication.
username
Required ¶
public readonly username: string;
- Type:
string
The user name for authentication.
ClusterRoleBindingProps ¶
Properties for ClusterRoleBinding
.
Initializer ¶
import { ClusterRoleBindingProps } from 'cdk8s-plus-29'
const clusterRoleBindingProps: ClusterRoleBindingProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
role
Required ¶
public readonly role: IClusterRole;
The role to bind to.
ClusterRolePolicyRule ¶
Policy rule of a `ClusterRole.
Initializer ¶
import { ClusterRolePolicyRule } from 'cdk8s-plus-29'
const clusterRolePolicyRule: ClusterRolePolicyRule = { ... }
endpoints
Required ¶
public readonly endpoints: IApiEndpoint[];
- Type:
cdk8s-plus-29.IApiEndpoint
[]
Endpoints this rule applies to.
Can be either api resources or non api resources.
verbs
Required ¶
public readonly verbs: string[];
- Type:
string
[]
Verbs to allow.
(e.g [‘get’, ‘watch’])
ClusterRoleProps ¶
Properties for ClusterRole
.
Initializer ¶
import { ClusterRoleProps } from 'cdk8s-plus-29'
const clusterRoleProps: ClusterRoleProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
aggregationLabels
Optional ¶
public readonly aggregationLabels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
Specify labels that should be used to locate ClusterRoles, whose rules will be automatically filled into this ClusterRole’s rules.
rules
Optional ¶
public readonly rules: ClusterRolePolicyRule[];
- Type:
cdk8s-plus-29.ClusterRolePolicyRule
[] - Default: []
A list of rules the role should allow.
CommandProbeOptions ¶
Options for Probe.fromCommand()
.
Initializer ¶
import { CommandProbeOptions } from 'cdk8s-plus-29'
const commandProbeOptions: CommandProbeOptions = { ... }
failureThreshold
Optional ¶
public readonly failureThreshold: number;
- Type:
number
- Default: 3
Minimum consecutive failures for the probe to be considered failed after having succeeded.
Defaults to 3. Minimum value is 1.
initialDelaySeconds
Optional ¶
public readonly initialDelaySeconds: Duration;
- Type:
cdk8s.Duration
- Default: immediate
Number of seconds after the container has started before liveness probes are initiated.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
periodSeconds
Optional ¶
public readonly periodSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(10) Minimum value is 1.
How often (in seconds) to perform the probe.
Default to 10 seconds. Minimum value is 1.
successThreshold
Optional ¶
public readonly successThreshold: number;
- Type:
number
- Default: 1 Must be 1 for liveness and startup. Minimum value is 1.
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1.
Must be 1 for liveness and startup. Minimum value is 1.
timeoutSeconds
Optional ¶
public readonly timeoutSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(1)
Number of seconds after which the probe times out.
Defaults to 1 second. Minimum value is 1.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
CommonSecretProps ¶
Common properties for Secret
.
Initializer ¶
import { CommonSecretProps } from 'cdk8s-plus-29'
const commonSecretProps: CommonSecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
ConfigMapProps ¶
Properties for initialization of ConfigMap
.
Initializer ¶
import { ConfigMapProps } from 'cdk8s-plus-29'
const configMapProps: ConfigMapProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
binaryData
Optional ¶
public readonly binaryData: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
BinaryData contains the binary data.
Each key must consist of alphanumeric characters, ‘-‘, ‘_’ or ‘.’. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process.
You can also add binary data using configMap.addBinaryData()
.
data
Optional ¶
public readonly data: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
Data contains the configuration data.
Each key must consist of alphanumeric characters, ‘-‘, ‘_’ or ‘.’. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.
You can also add data using configMap.addData()
.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
ConfigMapVolumeOptions ¶
Options for the ConfigMap-based volume.
Initializer ¶
import { ConfigMapVolumeOptions } from 'cdk8s-plus-29'
const configMapVolumeOptions: ConfigMapVolumeOptions = { ... }
defaultMode
Optional ¶
public readonly defaultMode: number;
- Type:
number
- Default: 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
Mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
items
Optional ¶
public readonly items: {[ key: string ]: PathMapping};
- Type: {[ key: string ]:
cdk8s-plus-29.PathMapping
} - Default: no mapping
If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value.
If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the ‘..’ path or start with ‘..’.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto-generated
The volume name.
optional
Optional ¶
public readonly optional: boolean;
- Type:
boolean
- Default: undocumented
Specify whether the ConfigMap or its keys must be defined.
ContainerLifecycle ¶
Container lifecycle properties.
Initializer ¶
import { ContainerLifecycle } from 'cdk8s-plus-29'
const containerLifecycle: ContainerLifecycle = { ... }
postStart
Optional ¶
public readonly postStart: Handler;
- Type:
cdk8s-plus-29.Handler
- Default: No post start handler.
This hook is executed immediately after a container is created.
However, there is no guarantee that the hook will execute before the container ENTRYPOINT.
preStop
Optional ¶
public readonly preStop: Handler;
- Type:
cdk8s-plus-29.Handler
- Default: No pre stop handler.
This hook is called immediately before a container is terminated due to an API request or management event such as a liveness/startup probe failure, preemption, resource contention and others.
A call to the PreStop hook fails if the container is already in a terminated or completed state and the hook must complete before the TERM signal to stop the container can be sent. The Pod’s termination grace period countdown begins before the PreStop hook is executed, so regardless of the outcome of the handler, the container will eventually terminate within the Pod’s termination grace period. No parameters are passed to the handler.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination
ContainerOpts ¶
Optional properties of a container.
Initializer ¶
import { ContainerOpts } from 'cdk8s-plus-29'
const containerOpts: ContainerOpts = { ... }
args
Optional ¶
public readonly args: string[];
- Type:
string
[] - Default: []
Arguments to the entrypoint. The docker image’s CMD is used if command
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.
Cannot be updated.
https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
command
Optional ¶
public readonly command: string[];
- Type:
string
[] - Default: The docker image’s ENTRYPOINT.
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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
envFrom
Optional ¶
public readonly envFrom: EnvFrom[];
- Type:
cdk8s-plus-29.EnvFrom
[] - Default: No sources.
List of sources to populate environment variables in the container.
When a key exists in multiple sources, the value associated with
the last source will take precedence. Values defined by the envVariables
property
with a duplicate key will take precedence.
envVariables
Optional ¶
public readonly envVariables: {[ key: string ]: EnvValue};
- Type: {[ key: string ]:
cdk8s-plus-29.EnvValue
} - Default: No environment variables.
Environment variables to set in the container.
imagePullPolicy
Optional ¶
public readonly imagePullPolicy: ImagePullPolicy;
- Type:
cdk8s-plus-29.ImagePullPolicy
- Default: ImagePullPolicy.ALWAYS
Image pull policy for this container.
lifecycle
Optional ¶
public readonly lifecycle: ContainerLifecycle;
Describes actions that the management system should take in response to container lifecycle events.
liveness
Optional ¶
public readonly liveness: Probe;
- Type:
cdk8s-plus-29.Probe
- Default: no liveness probe is defined
Periodic probe of container liveness.
Container will be restarted if the probe fails.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: ‘main’
Name of the container specified as a DNS_LABEL.
Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.
~~port
~~Optional ¶
- Deprecated: - use
portNumber
.
public readonly port: number;
- Type:
number
portNumber
Optional ¶
public readonly portNumber: number;
- Type:
number
- Default: Only the ports mentiond in the
ports
property are exposed.
Number of port to expose on the pod’s IP address.
This must be a valid port number, 0 < x < 65536.
This is a convinience property if all you need a single TCP numbered port.
In case more advanced configuartion is required, use the ports
property.
This port is added to the list of ports mentioned in the ports
property.
ports
Optional ¶
public readonly ports: ContainerPort[];
- Type:
cdk8s-plus-29.ContainerPort
[] - Default: Only the port mentioned in the
portNumber
property is exposed.
List of ports to expose from this container.
readiness
Optional ¶
public readonly readiness: Probe;
- Type:
cdk8s-plus-29.Probe
- Default: no readiness probe is defined
Determines when the container is ready to serve traffic.
resources
Optional ¶
public readonly resources: ContainerResources;
- Type:
cdk8s-plus-29.ContainerResources
- Default: cpu: request: 1000 millis limit: 1500 millis memory: request: 512 mebibytes limit: 2048 mebibytes
Compute resources (CPU and memory requests and limits) required by the container.
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
restartPolicy
Optional ¶
public readonly restartPolicy: ContainerRestartPolicy;
- Type:
cdk8s-plus-29.ContainerRestartPolicy
- Default: no restart policy is defined and the pod restart policy is applied
Kubelet will start init containers with restartPolicy=Always in the order with other init containers, but instead of waiting for its completion, it will wait for the container startup completion Currently, only accepted value is Always.
https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/
securityContext
Optional ¶
public readonly securityContext: ContainerSecurityContextProps;
- Type:
cdk8s-plus-29.ContainerSecurityContextProps
- Default: ensureNonRoot: true privileged: false readOnlyRootFilesystem: true allowPrivilegeEscalation: false user: 25000 group: 26000
SecurityContext defines the security options the container should be run with.
If set, the fields override equivalent fields of the pod’s security context.
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
startup
Optional ¶
public readonly startup: Probe;
- Type:
cdk8s-plus-29.Probe
- Default: If a port is provided, then knocks on that port to determine when the container is ready for readiness and liveness probe checks. Otherwise, no startup probe is defined.
StartupProbe indicates that the Pod has successfully initialized.
If specified, no other probes are executed until this completes successfully
volumeMounts
Optional ¶
public readonly volumeMounts: VolumeMount[];
- Type:
cdk8s-plus-29.VolumeMount
[]
Pod volumes to mount into the container’s filesystem.
Cannot be updated.
workingDir
Optional ¶
public readonly workingDir: string;
- Type:
string
- Default: The container runtime’s default.
Container’s working directory.
If not specified, the container runtime’s default will be used, which might be configured in the container image. Cannot be updated.
ContainerPort ¶
Represents a network port in a single container.
Initializer ¶
import { ContainerPort } from 'cdk8s-plus-29'
const containerPort: ContainerPort = { ... }
number
Required ¶
public readonly number: number;
- Type:
number
Number of port to expose on the pod’s IP address.
This must be a valid port number, 0 < x < 65536.
hostIp
Optional ¶
public readonly hostIp: string;
- Type:
string
- Default: 127.0.0.1.
What host IP to bind the external port to.
hostPort
Optional ¶
public readonly hostPort: number;
- Type:
number
- Default: auto generated by kubernetes and might change on restarts.
Number of port to expose on the host.
If specified, this must be a valid port number, 0 < x < 65536. Most containers do not need this.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: port is not named.
If specified, this must be an IANA_SVC_NAME and unique within the pod.
Each named port in a pod must have a unique name. Name for the port that can be referred to by services.
protocol
Optional ¶
public readonly protocol: Protocol;
- Type:
cdk8s-plus-29.Protocol
- Default: Protocol.TCP
Protocol for port.
Must be UDP, TCP, or SCTP. Defaults to “TCP”.
ContainerProps ¶
Properties for creating a container.
Initializer ¶
import { ContainerProps } from 'cdk8s-plus-29'
const containerProps: ContainerProps = { ... }
args
Optional ¶
public readonly args: string[];
- Type:
string
[] - Default: []
Arguments to the entrypoint. The docker image’s CMD is used if command
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.
Cannot be updated.
https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
command
Optional ¶
public readonly command: string[];
- Type:
string
[] - Default: The docker image’s ENTRYPOINT.
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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
envFrom
Optional ¶
public readonly envFrom: EnvFrom[];
- Type:
cdk8s-plus-29.EnvFrom
[] - Default: No sources.
List of sources to populate environment variables in the container.
When a key exists in multiple sources, the value associated with
the last source will take precedence. Values defined by the envVariables
property
with a duplicate key will take precedence.
envVariables
Optional ¶
public readonly envVariables: {[ key: string ]: EnvValue};
- Type: {[ key: string ]:
cdk8s-plus-29.EnvValue
} - Default: No environment variables.
Environment variables to set in the container.
imagePullPolicy
Optional ¶
public readonly imagePullPolicy: ImagePullPolicy;
- Type:
cdk8s-plus-29.ImagePullPolicy
- Default: ImagePullPolicy.ALWAYS
Image pull policy for this container.
lifecycle
Optional ¶
public readonly lifecycle: ContainerLifecycle;
Describes actions that the management system should take in response to container lifecycle events.
liveness
Optional ¶
public readonly liveness: Probe;
- Type:
cdk8s-plus-29.Probe
- Default: no liveness probe is defined
Periodic probe of container liveness.
Container will be restarted if the probe fails.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: ‘main’
Name of the container specified as a DNS_LABEL.
Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.
~~port
~~Optional ¶
- Deprecated: - use
portNumber
.
public readonly port: number;
- Type:
number
portNumber
Optional ¶
public readonly portNumber: number;
- Type:
number
- Default: Only the ports mentiond in the
ports
property are exposed.
Number of port to expose on the pod’s IP address.
This must be a valid port number, 0 < x < 65536.
This is a convinience property if all you need a single TCP numbered port.
In case more advanced configuartion is required, use the ports
property.
This port is added to the list of ports mentioned in the ports
property.
ports
Optional ¶
public readonly ports: ContainerPort[];
- Type:
cdk8s-plus-29.ContainerPort
[] - Default: Only the port mentioned in the
portNumber
property is exposed.
List of ports to expose from this container.
readiness
Optional ¶
public readonly readiness: Probe;
- Type:
cdk8s-plus-29.Probe
- Default: no readiness probe is defined
Determines when the container is ready to serve traffic.
resources
Optional ¶
public readonly resources: ContainerResources;
- Type:
cdk8s-plus-29.ContainerResources
- Default: cpu: request: 1000 millis limit: 1500 millis memory: request: 512 mebibytes limit: 2048 mebibytes
Compute resources (CPU and memory requests and limits) required by the container.
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
restartPolicy
Optional ¶
public readonly restartPolicy: ContainerRestartPolicy;
- Type:
cdk8s-plus-29.ContainerRestartPolicy
- Default: no restart policy is defined and the pod restart policy is applied
Kubelet will start init containers with restartPolicy=Always in the order with other init containers, but instead of waiting for its completion, it will wait for the container startup completion Currently, only accepted value is Always.
https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/
securityContext
Optional ¶
public readonly securityContext: ContainerSecurityContextProps;
- Type:
cdk8s-plus-29.ContainerSecurityContextProps
- Default: ensureNonRoot: true privileged: false readOnlyRootFilesystem: true allowPrivilegeEscalation: false user: 25000 group: 26000
SecurityContext defines the security options the container should be run with.
If set, the fields override equivalent fields of the pod’s security context.
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
startup
Optional ¶
public readonly startup: Probe;
- Type:
cdk8s-plus-29.Probe
- Default: If a port is provided, then knocks on that port to determine when the container is ready for readiness and liveness probe checks. Otherwise, no startup probe is defined.
StartupProbe indicates that the Pod has successfully initialized.
If specified, no other probes are executed until this completes successfully
volumeMounts
Optional ¶
public readonly volumeMounts: VolumeMount[];
- Type:
cdk8s-plus-29.VolumeMount
[]
Pod volumes to mount into the container’s filesystem.
Cannot be updated.
workingDir
Optional ¶
public readonly workingDir: string;
- Type:
string
- Default: The container runtime’s default.
Container’s working directory.
If not specified, the container runtime’s default will be used, which might be configured in the container image. Cannot be updated.
image
Required ¶
public readonly image: string;
- Type:
string
Docker image name.
ContainerResources ¶
CPU and memory compute resources.
Initializer ¶
import { ContainerResources } from 'cdk8s-plus-29'
const containerResources: ContainerResources = { ... }
cpu
Optional ¶
public readonly cpu: CpuResources;
ephemeralStorage
Optional ¶
public readonly ephemeralStorage: EphemeralStorageResources;
memory
Optional ¶
public readonly memory: MemoryResources;
ContainerSecurityContextProps ¶
Properties for ContainerSecurityContext
.
Initializer ¶
import { ContainerSecurityContextProps } from 'cdk8s-plus-29'
const containerSecurityContextProps: ContainerSecurityContextProps = { ... }
allowPrivilegeEscalation
Optional ¶
public readonly allowPrivilegeEscalation: boolean;
- Type:
boolean
- Default: false
Whether a process can gain more privileges than its parent process.
capabilities
Optional ¶
public readonly capabilities: ContainerSecutiryContextCapabilities;
- Type:
cdk8s-plus-29.ContainerSecutiryContextCapabilities
- Default: none
POSIX capabilities for running containers.
ensureNonRoot
Optional ¶
public readonly ensureNonRoot: boolean;
- Type:
boolean
- Default: true
Indicates that the container must run as a non-root user.
If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does.
group
Optional ¶
public readonly group: number;
- Type:
number
- Default: 26000. An arbitrary number bigger than 9999 is selected here. This is so that the container is blocked to access host files even if somehow it manages to get access to host file system.
The GID to run the entrypoint of the container process.
privileged
Optional ¶
public readonly privileged: boolean;
- Type:
boolean
- Default: false
Run container in privileged mode.
Processes in privileged containers are essentially equivalent to root on the host.
readOnlyRootFilesystem
Optional ¶
public readonly readOnlyRootFilesystem: boolean;
- Type:
boolean
- Default: true
Whether this container has a read-only root filesystem.
seccompProfile
Optional ¶
public readonly seccompProfile: SeccompProfile;
- Type:
cdk8s-plus-29.SeccompProfile
- Default: none
Container’s seccomp profile settings.
Only one profile source may be set
user
Optional ¶
public readonly user: number;
- Type:
number
- Default: 25000. An arbitrary number bigger than 9999 is selected here. This is so that the container is blocked to access host files even if somehow it manages to get access to host file system.
The UID to run the entrypoint of the container process.
ContainerSecutiryContextCapabilities ¶
Initializer ¶
import { ContainerSecutiryContextCapabilities } from 'cdk8s-plus-29'
const containerSecutiryContextCapabilities: ContainerSecutiryContextCapabilities = { ... }
add
Optional ¶
public readonly add: Capability[];
- Type:
cdk8s-plus-29.Capability
[]
Added capabilities.
drop
Optional ¶
public readonly drop: Capability[];
- Type:
cdk8s-plus-29.Capability
[]
Removed capabilities.
CpuResources ¶
CPU request and limit.
Initializer ¶
import { CpuResources } from 'cdk8s-plus-29'
const cpuResources: CpuResources = { ... }
limit
Optional ¶
public readonly limit: Cpu;
- Type:
cdk8s-plus-29.Cpu
request
Optional ¶
public readonly request: Cpu;
- Type:
cdk8s-plus-29.Cpu
CronJobProps ¶
Properties for CronJob
.
Initializer ¶
import { CronJobProps } from 'cdk8s-plus-29'
const cronJobProps: CronJobProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
podMetadata
Optional ¶
public readonly podMetadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
The pod metadata of this workload.
select
Optional ¶
public readonly select: boolean;
- Type:
boolean
- Default: true
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.
spread
Optional ¶
public readonly spread: boolean;
- Type:
boolean
- Default: false
Automatically spread pods across hostname and zones.
https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints
activeDeadline
Optional ¶
public readonly activeDeadline: Duration;
- Type:
cdk8s.Duration
- Default: If unset, then there is no deadline.
Specifies the duration the job may be active before the system tries to terminate it.
backoffLimit
Optional ¶
public readonly backoffLimit: number;
- Type:
number
- Default: If not set, system defaults to 6.
Specifies the number of retries before marking this job failed.
ttlAfterFinished
Optional ¶
public readonly ttlAfterFinished: Duration;
- Type:
cdk8s.Duration
- Default: If this field is unset, the Job won’t be automatically deleted.
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.
schedule
Required ¶
public readonly schedule: Cron;
- Type:
cdk8s.Cron
Specifies the time in which the job would run again.
This is defined as a cron expression in the CronJob resource.
concurrencyPolicy
Optional ¶
public readonly concurrencyPolicy: ConcurrencyPolicy;
- Type:
cdk8s-plus-29.ConcurrencyPolicy
- Default: ConcurrencyPolicy.Forbid
Specifies the concurrency policy for the job.
failedJobsRetained
Optional ¶
public readonly failedJobsRetained: number;
- Type:
number
- Default: 1
Specifies the number of failed jobs history retained.
This would retain the Job and the associated Pod resource and can be useful for debugging.
startingDeadline
Optional ¶
public readonly startingDeadline: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(10)
Kubernetes attempts to start cron jobs at its schedule time, but this is not guaranteed.
This deadline specifies how much time can pass after a schedule point, for which kubernetes can still start the job. For example, if this is set to 100 seconds, kubernetes is allowed to start the job at a maximum 100 seconds after the scheduled time.
Note that the Kubernetes CronJobController checks for things every 10 seconds, for this reason, a deadline below 10 seconds is not allowed, as it may cause your job to never be scheduled.
In addition, kubernetes will stop scheduling jobs if more than 100 schedules were missed (for any reason). This property also controls what time interval should kubernetes consider when counting for missed schedules.
For example, suppose a CronJob is set to schedule a new Job every one minute beginning at 08:30:00,
and its startingDeadline
field is not set. If the CronJob controller happens to be down from 08:29:00 to 10:21:00,
the job will not start as the number of missed jobs which missed their schedule is greater than 100.
However, if startingDeadline
is set to 200 seconds, kubernetes will only count 3 missed schedules, and thus
start a new execution at 10:22:00.
successfulJobsRetained
Optional ¶
public readonly successfulJobsRetained: number;
- Type:
number
- Default: 3
Specifies the number of successful jobs history retained.
This would retain the Job and the associated Pod resource and can be useful for debugging.
suspend
Optional ¶
public readonly suspend: boolean;
- Type:
boolean
- Default: false
Specifies if the cron job should be suspended.
Only applies to future executions, current ones are remained untouched.
timeZone
Optional ¶
public readonly timeZone: string;
- Type:
string
- Default: Timezone of kube-controller-manager process.
Specifies the timezone for the job.
This helps aligining the schedule to follow the specified timezone.
{@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones} for list of valid timezone values.
CsiVolumeOptions ¶
Options for the CSI driver based volume.
Initializer ¶
import { CsiVolumeOptions } from 'cdk8s-plus-29'
const csiVolumeOptions: CsiVolumeOptions = { ... }
attributes
Optional ¶
public readonly attributes: {[ key: string ]: string};
- Type: {[ key: string ]:
string
} - Default: undefined
Any driver-specific attributes to pass to the CSI volume builder.
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: driver-dependent
The filesystem type to mount.
Ex. “ext4”, “xfs”, “ntfs”. If not provided, the empty value is passed to the associated CSI driver, which will determine the default filesystem to apply.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto-generated
The volume name.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Whether the mounted volume should be read-only or not.
DaemonSetProps ¶
Properties for DaemonSet
.
Initializer ¶
import { DaemonSetProps } from 'cdk8s-plus-29'
const daemonSetProps: DaemonSetProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
podMetadata
Optional ¶
public readonly podMetadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
The pod metadata of this workload.
select
Optional ¶
public readonly select: boolean;
- Type:
boolean
- Default: true
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.
spread
Optional ¶
public readonly spread: boolean;
- Type:
boolean
- Default: false
Automatically spread pods across hostname and zones.
https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints
minReadySeconds
Optional ¶
public readonly minReadySeconds: number;
- Type:
number
- Default: 0
Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
DeploymentExposeViaServiceOptions ¶
Options for Deployment.exposeViaService
.
Initializer ¶
import { DeploymentExposeViaServiceOptions } from 'cdk8s-plus-29'
const deploymentExposeViaServiceOptions: DeploymentExposeViaServiceOptions = { ... }
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto generated.
The name of the service to expose.
If you’d like to expose the deployment multiple times, you must explicitly set a name starting from the second expose call.
ports
Optional ¶
public readonly ports: ServicePort[];
- Type:
cdk8s-plus-29.ServicePort
[] - Default: extracted from the deployment.
The ports that the service should bind to.
serviceType
Optional ¶
public readonly serviceType: ServiceType;
- Type:
cdk8s-plus-29.ServiceType
- Default: ClusterIP.
The type of the exposed service.
DeploymentProps ¶
Properties for Deployment
.
Initializer ¶
import { DeploymentProps } from 'cdk8s-plus-29'
const deploymentProps: DeploymentProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
podMetadata
Optional ¶
public readonly podMetadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
The pod metadata of this workload.
select
Optional ¶
public readonly select: boolean;
- Type:
boolean
- Default: true
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.
spread
Optional ¶
public readonly spread: boolean;
- Type:
boolean
- Default: false
Automatically spread pods across hostname and zones.
https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints
minReady
Optional ¶
public readonly minReady: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(0)
Minimum duration for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
Zero means the pod will be considered available as soon as it is ready.
https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#min-ready-seconds
progressDeadline
Optional ¶
public readonly progressDeadline: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(600)
The maximum duration for a deployment to make progress before it is considered to be failed.
The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status.
Note that progress will not be estimated during the time a deployment is paused.
https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#progress-deadline-seconds
replicas
Optional ¶
public readonly replicas: number;
- Type:
number
- Default: 2
Number of desired pods.
strategy
Optional ¶
public readonly strategy: DeploymentStrategy;
- Type:
cdk8s-plus-29.DeploymentStrategy
- Default: RollingUpdate with maxSurge and maxUnavailable set to 25%.
Specifies the strategy used to replace old Pods by new ones.
DeploymentStrategyRollingUpdateOptions ¶
Options for DeploymentStrategy.rollingUpdate
.
Initializer ¶
import { DeploymentStrategyRollingUpdateOptions } from 'cdk8s-plus-29'
const deploymentStrategyRollingUpdateOptions: DeploymentStrategyRollingUpdateOptions = { ... }
maxSurge
Optional ¶
public readonly maxSurge: PercentOrAbsolute;
- Type:
cdk8s-plus-29.PercentOrAbsolute
- Default: ‘25%’
The maximum number of pods that can be scheduled above the desired number of pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding up.
This can not be 0 if maxUnavailable
is 0.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.
maxUnavailable
Optional ¶
public readonly maxUnavailable: PercentOrAbsolute;
- Type:
cdk8s-plus-29.PercentOrAbsolute
- Default: ‘25%’
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if maxSurge
is 0.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.
DnsOption ¶
Custom DNS option.
Initializer ¶
import { DnsOption } from 'cdk8s-plus-29'
const dnsOption: DnsOption = { ... }
name
Required ¶
public readonly name: string;
- Type:
string
Option name.
value
Optional ¶
public readonly value: string;
- Type:
string
- Default: No value.
Option value.
DockerConfigSecretProps ¶
Options for DockerConfigSecret
.
Initializer ¶
import { DockerConfigSecretProps } from 'cdk8s-plus-29'
const dockerConfigSecretProps: DockerConfigSecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
data
Required ¶
public readonly data: {[ key: string ]: any};
- Type: {[ key: string ]:
any
}
JSON content to provide for the ~/.docker/config.json
file. This will be stringified and inserted as stringData.
https://docs.docker.com/engine/reference/commandline/cli/#sample-configuration-file
EmptyDirVolumeOptions ¶
Options for volumes populated with an empty directory.
Initializer ¶
import { EmptyDirVolumeOptions } from 'cdk8s-plus-29'
const emptyDirVolumeOptions: EmptyDirVolumeOptions = { ... }
medium
Optional ¶
public readonly medium: EmptyDirMedium;
- Type:
cdk8s-plus-29.EmptyDirMedium
- Default: EmptyDirMedium.DEFAULT
By default, emptyDir volumes are stored on whatever medium is backing the node - that might be disk or SSD or network storage, depending on your environment.
However, you can set the emptyDir.medium field to
EmptyDirMedium.MEMORY
to tell Kubernetes to mount a tmpfs (RAM-backed
filesystem) for you instead. While tmpfs is very fast, be aware that unlike
disks, tmpfs is cleared on node reboot and any files you write will count
against your Container’s memory limit.
sizeLimit
Optional ¶
public readonly sizeLimit: Size;
- Type:
cdk8s.Size
- Default: limit is undefined
Total amount of local storage required for this EmptyDir volume.
The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod.
EnvValueFromConfigMapOptions ¶
Options to specify an envionment variable value from a ConfigMap key.
Initializer ¶
import { EnvValueFromConfigMapOptions } from 'cdk8s-plus-29'
const envValueFromConfigMapOptions: EnvValueFromConfigMapOptions = { ... }
optional
Optional ¶
public readonly optional: boolean;
- Type:
boolean
- Default: false
Specify whether the ConfigMap or its key must be defined.
EnvValueFromFieldRefOptions ¶
Options to specify an environment variable value from a field reference.
Initializer ¶
import { EnvValueFromFieldRefOptions } from 'cdk8s-plus-29'
const envValueFromFieldRefOptions: EnvValueFromFieldRefOptions = { ... }
apiVersion
Optional ¶
public readonly apiVersion: string;
- Type:
string
Version of the schema the FieldPath is written in terms of.
key
Optional ¶
public readonly key: string;
- Type:
string
The key to select the pod label or annotation.
EnvValueFromProcessOptions ¶
Options to specify an environment variable value from the process environment.
Initializer ¶
import { EnvValueFromProcessOptions } from 'cdk8s-plus-29'
const envValueFromProcessOptions: EnvValueFromProcessOptions = { ... }
required
Optional ¶
public readonly required: boolean;
- Type:
boolean
- Default: false
Specify whether the key must exist in the environment.
If this is set to true, and the key does not exist, an error will thrown.
EnvValueFromResourceOptions ¶
Options to specify an environment variable value from a resource.
Initializer ¶
import { EnvValueFromResourceOptions } from 'cdk8s-plus-29'
const envValueFromResourceOptions: EnvValueFromResourceOptions = { ... }
container
Optional ¶
public readonly container: Container;
- Type:
cdk8s-plus-29.Container
The container to select the value from.
divisor
Optional ¶
public readonly divisor: string;
- Type:
string
The output format of the exposed resource.
EnvValueFromSecretOptions ¶
Options to specify an environment variable value from a Secret.
Initializer ¶
import { EnvValueFromSecretOptions } from 'cdk8s-plus-29'
const envValueFromSecretOptions: EnvValueFromSecretOptions = { ... }
optional
Optional ¶
public readonly optional: boolean;
- Type:
boolean
- Default: false
Specify whether the Secret or its key must be defined.
EphemeralStorageResources ¶
Emphemeral storage request and limit.
Initializer ¶
import { EphemeralStorageResources } from 'cdk8s-plus-29'
const ephemeralStorageResources: EphemeralStorageResources = { ... }
limit
Optional ¶
public readonly limit: Size;
- Type:
cdk8s.Size
request
Optional ¶
public readonly request: Size;
- Type:
cdk8s.Size
ExposeDeploymentViaIngressOptions ¶
Options for exposing a deployment via an ingress.
Initializer ¶
import { ExposeDeploymentViaIngressOptions } from 'cdk8s-plus-29'
const exposeDeploymentViaIngressOptions: ExposeDeploymentViaIngressOptions = { ... }
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto generated.
The name of the service to expose.
If you’d like to expose the deployment multiple times, you must explicitly set a name starting from the second expose call.
ports
Optional ¶
public readonly ports: ServicePort[];
- Type:
cdk8s-plus-29.ServicePort
[] - Default: extracted from the deployment.
The ports that the service should bind to.
serviceType
Optional ¶
public readonly serviceType: ServiceType;
- Type:
cdk8s-plus-29.ServiceType
- Default: ClusterIP.
The type of the exposed service.
ingress
Optional ¶
public readonly ingress: Ingress;
- Type:
cdk8s-plus-29.Ingress
- Default: An ingress will be automatically created.
The ingress to add rules to.
pathType
Optional ¶
public readonly pathType: HttpIngressPathType;
- Type:
cdk8s-plus-29.HttpIngressPathType
- Default: HttpIngressPathType.PREFIX
The type of the path.
ExposeServiceViaIngressOptions ¶
Options for exposing a service using an ingress.
Initializer ¶
import { ExposeServiceViaIngressOptions } from 'cdk8s-plus-29'
const exposeServiceViaIngressOptions: ExposeServiceViaIngressOptions = { ... }
ingress
Optional ¶
public readonly ingress: Ingress;
- Type:
cdk8s-plus-29.Ingress
- Default: An ingress will be automatically created.
The ingress to add rules to.
pathType
Optional ¶
public readonly pathType: HttpIngressPathType;
- Type:
cdk8s-plus-29.HttpIngressPathType
- Default: HttpIngressPathType.PREFIX
The type of the path.
FromServiceAccountNameOptions ¶
Initializer ¶
import { FromServiceAccountNameOptions } from 'cdk8s-plus-29'
const fromServiceAccountNameOptions: FromServiceAccountNameOptions = { ... }
namespaceName
Optional ¶
public readonly namespaceName: string;
- Type:
string
- Default: “default”
The name of the namespace the service account belongs to.
GCEPersistentDiskPersistentVolumeProps ¶
Properties for GCEPersistentDiskPersistentVolume
.
Initializer ¶
import { GCEPersistentDiskPersistentVolumeProps } from 'cdk8s-plus-29'
const gCEPersistentDiskPersistentVolumeProps: GCEPersistentDiskPersistentVolumeProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
- Type:
cdk8s-plus-29.PersistentVolumeAccessMode
[] - Default: No access modes.
Contains all ways the volume can be mounted.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
claim
Optional ¶
public readonly claim: IPersistentVolumeClaim;
- Type:
cdk8s-plus-29.IPersistentVolumeClaim
- Default: Not bound to a specific claim.
Part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
Expected to be non-nil when bound.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding
mountOptions
Optional ¶
public readonly mountOptions: string[];
- Type:
string
[] - Default: No options.
A list of mount options, e.g. [“ro”, “soft”]. Not validated - mount will simply fail if one is invalid.
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
reclaimPolicy
Optional ¶
public readonly reclaimPolicy: PersistentVolumeReclaimPolicy;
- Type:
cdk8s-plus-29.PersistentVolumeReclaimPolicy
- Default: PersistentVolumeReclaimPolicy.RETAIN
When a user is done with their volume, they can delete the PVC objects from the API that allows reclamation of the resource.
The reclaim policy tells the cluster what to do with the volume after it has been released of its claim.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
- Default: No specified.
What is the storage capacity of this volume.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
- Default: Volume does not belong to any storage class.
Name of StorageClass to which this persistent volume belongs.
volumeMode
Optional ¶
public readonly volumeMode: PersistentVolumeMode;
- Type:
cdk8s-plus-29.PersistentVolumeMode
- Default: VolumeMode.FILE_SYSTEM
Defines what type of volume is required by the claim.
pdName
Required ¶
public readonly pdName: string;
- Type:
string
Unique name of the PD resource in GCE.
Used to identify the disk in GCE.
https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: ‘ext4’
Filesystem type of the volume that you want to mount.
Tip: Ensure that the filesystem type is supported by the host operating system.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
partition
Optional ¶
public readonly partition: number;
- Type:
number
- Default: No partition.
The partition in the volume that you want to mount.
If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as “1”. Similarly, the volume partition for /dev/sda is “0” (or you can leave the property empty).
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Specify “true” to force and set the ReadOnly property in VolumeMounts to “true”.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
GCEPersistentDiskVolumeOptions ¶
Options of Volume.fromGcePersistentDisk
.
Initializer ¶
import { GCEPersistentDiskVolumeOptions } from 'cdk8s-plus-29'
const gCEPersistentDiskVolumeOptions: GCEPersistentDiskVolumeOptions = { ... }
fsType
Optional ¶
public readonly fsType: string;
- Type:
string
- Default: ‘ext4’
Filesystem type of the volume that you want to mount.
Tip: Ensure that the filesystem type is supported by the host operating system.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto-generated
The volume name.
partition
Optional ¶
public readonly partition: number;
- Type:
number
- Default: No partition.
The partition in the volume that you want to mount.
If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as “1”. Similarly, the volume partition for /dev/sda is “0” (or you can leave the property empty).
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Specify “true” to force and set the ReadOnly property in VolumeMounts to “true”.
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
HandlerFromHttpGetOptions ¶
Options for Handler.fromHttpGet
.
Initializer ¶
import { HandlerFromHttpGetOptions } from 'cdk8s-plus-29'
const handlerFromHttpGetOptions: HandlerFromHttpGetOptions = { ... }
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: defaults to
container.port
.
The TCP port to use when sending the GET request.
HandlerFromTcpSocketOptions ¶
Options for Handler.fromTcpSocket
.
Initializer ¶
import { HandlerFromTcpSocketOptions } from 'cdk8s-plus-29'
const handlerFromTcpSocketOptions: HandlerFromTcpSocketOptions = { ... }
host
Optional ¶
public readonly host: string;
- Type:
string
- Default: defaults to the pod IP
The host name to connect to on the container.
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: defaults to
container.port
.
The TCP port to connect to on the container.
HorizontalPodAutoscalerProps ¶
Properties for HorizontalPodAutoscaler.
Initializer ¶
import { HorizontalPodAutoscalerProps } from 'cdk8s-plus-29'
const horizontalPodAutoscalerProps: HorizontalPodAutoscalerProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
maxReplicas
Required ¶
public readonly maxReplicas: number;
- Type:
number
The maximum number of replicas that can be scaled up to.
target
Required ¶
public readonly target: IScalable;
- Type:
cdk8s-plus-29.IScalable
The workload to scale up or down.
Scalable workload types: * Deployment * StatefulSet
metrics
Optional ¶
public readonly metrics: Metric[];
- Type:
cdk8s-plus-29.Metric
[] - Default: If metrics are not provided, then the target resource constraints (e.g. cpu limit) will be used as scaling metrics.
The metric conditions that trigger a scale up or scale down.
minReplicas
Optional ¶
public readonly minReplicas: number;
- Type:
number
- Default: 1
The minimum number of replicas that can be scaled down to.
Can be set to 0 if the alpha feature gate HPAScaleToZero
is enabled and
at least one Object or External metric is configured.
scaleDown
Optional ¶
public readonly scaleDown: ScalingRules;
- Type:
cdk8s-plus-29.ScalingRules
- Default: Scale down to minReplica count with a 5 minute stabilization window.
The scaling behavior when scaling down.
scaleUp
Optional ¶
public readonly scaleUp: ScalingRules;
- Type:
cdk8s-plus-29.ScalingRules
- Default: Is the higher of:
- Increase no more than 4 pods per 60 seconds
- Double the number of pods per 60 seconds
The scaling behavior when scaling up.
HostAlias ¶
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s /etc/hosts file.
Initializer ¶
import { HostAlias } from 'cdk8s-plus-29'
const hostAlias: HostAlias = { ... }
hostnames
Required ¶
public readonly hostnames: string[];
- Type:
string
[]
Hostnames for the chosen IP address.
ip
Required ¶
public readonly ip: string;
- Type:
string
IP address of the host file entry.
HostPathVolumeOptions ¶
Options for a HostPathVolume-based volume.
Initializer ¶
import { HostPathVolumeOptions } from 'cdk8s-plus-29'
const hostPathVolumeOptions: HostPathVolumeOptions = { ... }
path
Required ¶
public readonly path: string;
- Type:
string
The path of the directory on the host.
type
Optional ¶
public readonly type: HostPathVolumeType;
- Type:
cdk8s-plus-29.HostPathVolumeType
- Default: HostPathVolumeType.DEFAULT
The expected type of the path found on the host.
HttpGetProbeOptions ¶
Options for Probe.fromHttpGet()
.
Initializer ¶
import { HttpGetProbeOptions } from 'cdk8s-plus-29'
const httpGetProbeOptions: HttpGetProbeOptions = { ... }
failureThreshold
Optional ¶
public readonly failureThreshold: number;
- Type:
number
- Default: 3
Minimum consecutive failures for the probe to be considered failed after having succeeded.
Defaults to 3. Minimum value is 1.
initialDelaySeconds
Optional ¶
public readonly initialDelaySeconds: Duration;
- Type:
cdk8s.Duration
- Default: immediate
Number of seconds after the container has started before liveness probes are initiated.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
periodSeconds
Optional ¶
public readonly periodSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(10) Minimum value is 1.
How often (in seconds) to perform the probe.
Default to 10 seconds. Minimum value is 1.
successThreshold
Optional ¶
public readonly successThreshold: number;
- Type:
number
- Default: 1 Must be 1 for liveness and startup. Minimum value is 1.
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1.
Must be 1 for liveness and startup. Minimum value is 1.
timeoutSeconds
Optional ¶
public readonly timeoutSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(1)
Number of seconds after which the probe times out.
Defaults to 1 second. Minimum value is 1.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
host
Optional ¶
public readonly host: string;
- Type:
string
- Default: defaults to the pod IP
The host name to connect to on the container.
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: defaults to
container.port
.
The TCP port to use when sending the GET request.
scheme
Optional ¶
public readonly scheme: ConnectionScheme;
- Type:
cdk8s-plus-29.ConnectionScheme
- Default: ConnectionScheme.HTTP
Scheme to use for connecting to the host (HTTP or HTTPS).
IngressProps ¶
Properties for Ingress
.
Initializer ¶
import { IngressProps } from 'cdk8s-plus-29'
const ingressProps: IngressProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
className
Optional ¶
public readonly className: string;
- Type:
string
Class Name for this ingress.
This field is a reference to an IngressClass resource that contains additional Ingress configuration, including the name of the Ingress controller.
defaultBackend
Optional ¶
public readonly defaultBackend: IngressBackend;
The default backend services requests that do not match any rule.
Using this option or the addDefaultBackend()
method is equivalent to
adding a rule with both path
and host
undefined.
rules
Optional ¶
public readonly rules: IngressRule[];
- Type:
cdk8s-plus-29.IngressRule
[]
Routing rules for this ingress.
Each rule must define an IngressBackend
that will receive the requests
that match this rule. If both host
and path
are not specifiec, this
backend will be used as the default backend of the ingress.
You can also add rules later using addRule()
, addHostRule()
,
addDefaultBackend()
and addHostDefaultBackend()
.
tls
Optional ¶
public readonly tls: IngressTls[];
- Type:
cdk8s-plus-29.IngressTls
[]
TLS settings for this ingress.
Using this option tells the ingress controller to expose a TLS endpoint. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.
IngressRule ¶
Represents the rules mapping the paths under a specified host to the related backend services.
Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching path.
Initializer ¶
import { IngressRule } from 'cdk8s-plus-29'
const ingressRule: IngressRule = { ... }
backend
Required ¶
public readonly backend: IngressBackend;
Backend defines the referenced service endpoint to which the traffic will be forwarded to.
host
Optional ¶
public readonly host: string;
- Type:
string
- Default: If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.
Host is the fully qualified domain name of a network host, as defined by RFC 3986.
Note the following deviations from the “host” part of the URI as
defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue
can only apply to the IP in the Spec of the parent Ingress. 2. The :
delimiter is not respected because ports are not allowed. Currently the
port of an Ingress is implicitly :80 for http and :443 for https. Both
these may change in the future. Incoming requests are matched against the
host before the IngressRuleValue.
path
Optional ¶
public readonly path: string;
- Type:
string
- Default: If unspecified, the path defaults to a catch all sending traffic to the backend.
Path is an extended POSIX regex as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional “path” part of a URL as defined by RFC 3986. Paths must begin with a ‘/’.
pathType
Optional ¶
public readonly pathType: HttpIngressPathType;
Specify how the path is matched against request paths.
By default, path types will be matched by prefix.
https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types
IngressTls ¶
Represents the TLS configuration mapping that is passed to the ingress controller for SSL termination.
Initializer ¶
import { IngressTls } from 'cdk8s-plus-29'
const ingressTls: IngressTls = { ... }
hosts
Optional ¶
public readonly hosts: string[];
- Type:
string
[] - Default: If unspecified, it defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress.
Hosts are a list of hosts included in the TLS certificate.
The values in this list must match the name/s used in the TLS Secret.
secret
Optional ¶
public readonly secret: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: If unspecified, it allows SSL routing based on SNI hostname.
Secret is the secret that contains the certificate and key used to terminate SSL traffic on 443.
If the SNI host in a listener conflicts with the “Host” header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing.
JobProps ¶
Properties for Job
.
Initializer ¶
import { JobProps } from 'cdk8s-plus-29'
const jobProps: JobProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
podMetadata
Optional ¶
public readonly podMetadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
The pod metadata of this workload.
select
Optional ¶
public readonly select: boolean;
- Type:
boolean
- Default: true
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.
spread
Optional ¶
public readonly spread: boolean;
- Type:
boolean
- Default: false
Automatically spread pods across hostname and zones.
https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints
activeDeadline
Optional ¶
public readonly activeDeadline: Duration;
- Type:
cdk8s.Duration
- Default: If unset, then there is no deadline.
Specifies the duration the job may be active before the system tries to terminate it.
backoffLimit
Optional ¶
public readonly backoffLimit: number;
- Type:
number
- Default: If not set, system defaults to 6.
Specifies the number of retries before marking this job failed.
ttlAfterFinished
Optional ¶
public readonly ttlAfterFinished: Duration;
- Type:
cdk8s.Duration
- Default: If this field is unset, the Job won’t be automatically deleted.
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.
LabelSelectorOptions ¶
Options for LabelSelector.of
.
Initializer ¶
import { LabelSelectorOptions } from 'cdk8s-plus-29'
const labelSelectorOptions: LabelSelectorOptions = { ... }
expressions
Optional ¶
public readonly expressions: LabelExpression[];
- Type:
cdk8s-plus-29.LabelExpression
[]
Expression based label matchers.
labels
Optional ¶
public readonly labels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
Strict label matchers.
LabelSelectorRequirement ¶
A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
Initializer ¶
import { LabelSelectorRequirement } from 'cdk8s-plus-29'
const labelSelectorRequirement: LabelSelectorRequirement = { ... }
key
Required ¶
public readonly key: string;
- Type:
string
The label key that the selector applies to.
operator
Required ¶
public readonly operator: string;
- Type:
string
Represents a key’s relationship to a set of values.
values
Optional ¶
public readonly values: string[];
- Type:
string
[]
An array of string values.
If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
MemoryResources ¶
Memory request and limit.
Initializer ¶
import { MemoryResources } from 'cdk8s-plus-29'
const memoryResources: MemoryResources = { ... }
limit
Optional ¶
public readonly limit: Size;
- Type:
cdk8s.Size
request
Optional ¶
public readonly request: Size;
- Type:
cdk8s.Size
MetricContainerResourceOptions ¶
Options for Metric.containerResource()
.
Initializer ¶
import { MetricContainerResourceOptions } from 'cdk8s-plus-29'
const metricContainerResourceOptions: MetricContainerResourceOptions = { ... }
container
Required ¶
public readonly container: Container;
- Type:
cdk8s-plus-29.Container
Container where the metric can be found.
target
Required ¶
public readonly target: MetricTarget;
Target metric value that will trigger scaling.
MetricObjectOptions ¶
Options for Metric.object()
.
Initializer ¶
import { MetricObjectOptions } from 'cdk8s-plus-29'
const metricObjectOptions: MetricObjectOptions = { ... }
name
Required ¶
public readonly name: string;
- Type:
string
The name of the metric to scale on.
target
Required ¶
public readonly target: MetricTarget;
The target metric value that will trigger scaling.
labelSelector
Optional ¶
public readonly labelSelector: LabelSelector;
- Type:
cdk8s-plus-29.LabelSelector
- Default: Just the metric ‘name’ will be used to gather metrics.
A selector to find a metric by label.
When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
object
Required ¶
public readonly object: IResource;
- Type:
cdk8s-plus-29.IResource
Resource where the metric can be found.
MetricOptions ¶
Base options for a Metric.
Initializer ¶
import { MetricOptions } from 'cdk8s-plus-29'
const metricOptions: MetricOptions = { ... }
name
Required ¶
public readonly name: string;
- Type:
string
The name of the metric to scale on.
target
Required ¶
public readonly target: MetricTarget;
The target metric value that will trigger scaling.
labelSelector
Optional ¶
public readonly labelSelector: LabelSelector;
- Type:
cdk8s-plus-29.LabelSelector
- Default: Just the metric ‘name’ will be used to gather metrics.
A selector to find a metric by label.
When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
MountOptions ¶
Options for mounts.
Initializer ¶
import { MountOptions } from 'cdk8s-plus-29'
const mountOptions: MountOptions = { ... }
propagation
Optional ¶
public readonly propagation: MountPropagation;
- Type:
cdk8s-plus-29.MountPropagation
- Default: MountPropagation.NONE
Determines how mounts are propagated from the host to container and the other way around.
When not set, MountPropagationNone is used.
Mount propagation allows for sharing volumes mounted by a Container to other Containers in the same Pod, or even to other Pods on the same node.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Mounted read-only if true, read-write otherwise (false or unspecified).
Defaults to false.
subPath
Optional ¶
public readonly subPath: string;
- Type:
string
- Default: “” the volume’s root
Path within the volume from which the container’s volume should be mounted.).
subPathExpr
Optional ¶
public readonly subPathExpr: string;
- Type:
string
- Default: “” volume’s root.
Expanded path within the volume from which the container’s volume should be mounted.
Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container’s environment. Defaults to “” (volume’s root).
subPathExpr
and subPath
are mutually exclusive.
NamespaceProps ¶
Properties for Namespace
.
Initializer ¶
import { NamespaceProps } from 'cdk8s-plus-29'
const namespaceProps: NamespaceProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
NamespaceSelectorConfig ¶
Configuration for selecting namespaces.
Initializer ¶
import { NamespaceSelectorConfig } from 'cdk8s-plus-29'
const namespaceSelectorConfig: NamespaceSelectorConfig = { ... }
labelSelector
Optional ¶
public readonly labelSelector: LabelSelector;
A selector to select namespaces by labels.
names
Optional ¶
public readonly names: string[];
- Type:
string
[]
A list of names to select namespaces by names.
NamespacesSelectOptions ¶
Options for Namespaces.select
.
Initializer ¶
import { NamespacesSelectOptions } from 'cdk8s-plus-29'
const namespacesSelectOptions: NamespacesSelectOptions = { ... }
expressions
Optional ¶
public readonly expressions: LabelExpression[];
- Type:
cdk8s-plus-29.LabelExpression
[] - Default: no selector requirements.
Namespaces must satisfy these selectors.
The selectors query labels, just like the labels
property, but they
provide a more advanced matching mechanism.
labels
Optional ¶
public readonly labels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
} - Default: no strict labels requirements.
Labels the namespaces must have.
This is equivalent to using an ‘Is’ selector.
names
Optional ¶
public readonly names: string[];
- Type:
string
[] - Default: no name requirements.
Namespaces names must be one of these.
NetworkPolicyAddEgressRuleOptions ¶
Options for NetworkPolicy.addEgressRule
.
Initializer ¶
import { NetworkPolicyAddEgressRuleOptions } from 'cdk8s-plus-29'
const networkPolicyAddEgressRuleOptions: NetworkPolicyAddEgressRuleOptions = { ... }
ports
Optional ¶
public readonly ports: NetworkPolicyPort[];
- Type:
cdk8s-plus-29.NetworkPolicyPort
[] - Default: If the peer is a managed pod, take its ports. Otherwise, all ports are allowed.
Ports the rule should allow outgoing traffic to.
NetworkPolicyPeerConfig ¶
Configuration for network peers.
A peer can either by an ip block, or a selection of pods, not both.
Initializer ¶
import { NetworkPolicyPeerConfig } from 'cdk8s-plus-29'
const networkPolicyPeerConfig: NetworkPolicyPeerConfig = { ... }
ipBlock
Optional ¶
public readonly ipBlock: NetworkPolicyIpBlock;
The ip block this peer represents.
podSelector
Optional ¶
public readonly podSelector: PodSelectorConfig;
The pod selector this peer represents.
NetworkPolicyPortProps ¶
Properties for NetworkPolicyPort
.
Initializer ¶
import { NetworkPolicyPortProps } from 'cdk8s-plus-29'
const networkPolicyPortProps: NetworkPolicyPortProps = { ... }
endPort
Optional ¶
public readonly endPort: number;
- Type:
number
- Default: not a port range.
End port (relative to port
).
Only applies if port
is defined.
Use this to specify a port range, rather that a specific one.
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: all ports are allowed.
Specific port number.
protocol
Optional ¶
public readonly protocol: NetworkProtocol;
- Type:
cdk8s-plus-29.NetworkProtocol
- Default: NetworkProtocol.TCP
Protocol.
NetworkPolicyProps ¶
Properties for NetworkPolicy
.
Initializer ¶
import { NetworkPolicyProps } from 'cdk8s-plus-29'
const networkPolicyProps: NetworkPolicyProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
egress
Optional ¶
public readonly egress: NetworkPolicyTraffic;
- Type:
cdk8s-plus-29.NetworkPolicyTraffic
- Default: the policy doesn’t change egress behavior of the pods it selects.
Egress traffic configuration.
ingress
Optional ¶
public readonly ingress: NetworkPolicyTraffic;
- Type:
cdk8s-plus-29.NetworkPolicyTraffic
- Default: the policy doesn’t change ingress behavior of the pods it selects.
Ingress traffic configuration.
selector
Optional ¶
public readonly selector: IPodSelector;
- Type:
cdk8s-plus-29.IPodSelector
- Default: will select all pods in the namespace of the policy.
Which pods does this policy object applies to.
This can either be a single pod / workload, or a grouping of pods selected
via the Pods.select
function. Rules is applied to any pods selected by this property.
Multiple network policies can select the same set of pods.
In this case, the rules for each are combined additively.
Note that
NetworkPolicyRule ¶
Describes a rule allowing traffic from / to pods matched by a network policy selector.
Initializer ¶
import { NetworkPolicyRule } from 'cdk8s-plus-29'
const networkPolicyRule: NetworkPolicyRule = { ... }
peer
Required ¶
public readonly peer: INetworkPolicyPeer;
Peer this rule interacts with.
ports
Optional ¶
public readonly ports: NetworkPolicyPort[];
- Type:
cdk8s-plus-29.NetworkPolicyPort
[] - Default: traffic is allowed on all ports.
The ports of the rule.
NetworkPolicyTraffic ¶
Describes how the network policy should configure egress / ingress traffic.
Initializer ¶
import { NetworkPolicyTraffic } from 'cdk8s-plus-29'
const networkPolicyTraffic: NetworkPolicyTraffic = { ... }
default
Optional ¶
public readonly default: NetworkPolicyTrafficDefault;
- Type:
cdk8s-plus-29.NetworkPolicyTrafficDefault
- Default: unset, the policy does not change the behavior.
Specifies the default behavior of the policy when no rules are defined.
rules
Optional ¶
public readonly rules: NetworkPolicyRule[];
- Type:
cdk8s-plus-29.NetworkPolicyRule
[] - Default: no rules
List of rules to be applied to the selected pods.
If empty, the behavior of the policy is dictated by the default
property.
NfsVolumeOptions ¶
Options for the NFS based volume.
Initializer ¶
import { NfsVolumeOptions } from 'cdk8s-plus-29'
const nfsVolumeOptions: NfsVolumeOptions = { ... }
path
Required ¶
public readonly path: string;
- Type:
string
Path that is exported by the NFS server.
server
Required ¶
public readonly server: string;
- Type:
string
Server is the hostname or IP address of the NFS server.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
If set to true, will force the NFS export to be mounted with read-only permissions.
NodeTaintQueryOptions ¶
Options for NodeTaintQuery
.
Initializer ¶
import { NodeTaintQueryOptions } from 'cdk8s-plus-29'
const nodeTaintQueryOptions: NodeTaintQueryOptions = { ... }
effect
Optional ¶
public readonly effect: TaintEffect;
- Type:
cdk8s-plus-29.TaintEffect
- Default: all effects are matched.
The taint effect to match.
evictAfter
Optional ¶
public readonly evictAfter: Duration;
- Type:
cdk8s.Duration
- Default: bound forever.
How much time should a pod that tolerates the NO_EXECUTE
effect be bound to the node.
Only applies for the NO_EXECUTE
effect.
PathMapping ¶
Maps a string key to a path within a volume.
Initializer ¶
import { PathMapping } from 'cdk8s-plus-29'
const pathMapping: PathMapping = { ... }
path
Required ¶
public readonly path: string;
- Type:
string
The relative path of the file to map the key to.
May not be an absolute path. May not contain the path element ‘..’. May not start with the string ‘..’.
mode
Optional ¶
public readonly mode: number;
- Type:
number
Optional: mode bits to use on this file, must be a value between 0 and 0777.
If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
PersistentVolumeClaimProps ¶
Properties for PersistentVolumeClaim
.
Initializer ¶
import { PersistentVolumeClaimProps } from 'cdk8s-plus-29'
const persistentVolumeClaimProps: PersistentVolumeClaimProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
- Type:
cdk8s-plus-29.PersistentVolumeAccessMode
[] - Default: No access modes requirement.
Contains the access modes the volume should support.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
- Default: No storage requirement.
Minimum storage size the volume should have.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
- Default: Not set.
Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:.
If the admission plugin is turned on, the storage class marked as default will be used. - If the admission plugin is turned off, the pvc can only be bound to volumes without a storage class.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
volume
Optional ¶
public readonly volume: IPersistentVolume;
- Type:
cdk8s-plus-29.IPersistentVolume
- Default: No specific volume binding.
The PersistentVolume backing this claim.
The control plane still checks that storage class, access modes, and requested storage size on the volume are valid.
Note that in order to guarantee a proper binding, the volume should
also define a claimRef
referring to this claim. Otherwise, the volume may be
claimed be other pvc’s before it gets a chance to bind to this one.
If the volume is managed (i.e not imported), you can use pv.claim()
to easily
create a bi-directional bounded claim.
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding.
volumeMode
Optional ¶
public readonly volumeMode: PersistentVolumeMode;
- Type:
cdk8s-plus-29.PersistentVolumeMode
- Default: VolumeMode.FILE_SYSTEM
Defines what type of volume is required by the claim.
PersistentVolumeClaimVolumeOptions ¶
Options for a PersistentVolumeClaim-based volume.
Initializer ¶
import { PersistentVolumeClaimVolumeOptions } from 'cdk8s-plus-29'
const persistentVolumeClaimVolumeOptions: PersistentVolumeClaimVolumeOptions = { ... }
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: Derived from the PVC name.
The volume name.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Will force the ReadOnly setting in VolumeMounts.
PersistentVolumeProps ¶
Properties for PersistentVolume
.
Initializer ¶
import { PersistentVolumeProps } from 'cdk8s-plus-29'
const persistentVolumeProps: PersistentVolumeProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
accessModes
Optional ¶
public readonly accessModes: PersistentVolumeAccessMode[];
- Type:
cdk8s-plus-29.PersistentVolumeAccessMode
[] - Default: No access modes.
Contains all ways the volume can be mounted.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
claim
Optional ¶
public readonly claim: IPersistentVolumeClaim;
- Type:
cdk8s-plus-29.IPersistentVolumeClaim
- Default: Not bound to a specific claim.
Part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
Expected to be non-nil when bound.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding
mountOptions
Optional ¶
public readonly mountOptions: string[];
- Type:
string
[] - Default: No options.
A list of mount options, e.g. [“ro”, “soft”]. Not validated - mount will simply fail if one is invalid.
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
reclaimPolicy
Optional ¶
public readonly reclaimPolicy: PersistentVolumeReclaimPolicy;
- Type:
cdk8s-plus-29.PersistentVolumeReclaimPolicy
- Default: PersistentVolumeReclaimPolicy.RETAIN
When a user is done with their volume, they can delete the PVC objects from the API that allows reclamation of the resource.
The reclaim policy tells the cluster what to do with the volume after it has been released of its claim.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming
storage
Optional ¶
public readonly storage: Size;
- Type:
cdk8s.Size
- Default: No specified.
What is the storage capacity of this volume.
https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
storageClassName
Optional ¶
public readonly storageClassName: string;
- Type:
string
- Default: Volume does not belong to any storage class.
Name of StorageClass to which this persistent volume belongs.
volumeMode
Optional ¶
public readonly volumeMode: PersistentVolumeMode;
- Type:
cdk8s-plus-29.PersistentVolumeMode
- Default: VolumeMode.FILE_SYSTEM
Defines what type of volume is required by the claim.
PodConnectionsAllowFromOptions ¶
Options for PodConnections.allowFrom
.
Initializer ¶
import { PodConnectionsAllowFromOptions } from 'cdk8s-plus-29'
const podConnectionsAllowFromOptions: PodConnectionsAllowFromOptions = { ... }
isolation
Optional ¶
public readonly isolation: PodConnectionsIsolation;
- Type:
cdk8s-plus-29.PodConnectionsIsolation
- Default: unset, isolates both the pod and the peer.
Which isolation should be applied to establish the connection.
ports
Optional ¶
public readonly ports: NetworkPolicyPort[];
- Type:
cdk8s-plus-29.NetworkPolicyPort
[] - Default: The pod ports.
Ports to allow incoming traffic to.
PodConnectionsAllowToOptions ¶
Options for PodConnections.allowTo
.
Initializer ¶
import { PodConnectionsAllowToOptions } from 'cdk8s-plus-29'
const podConnectionsAllowToOptions: PodConnectionsAllowToOptions = { ... }
isolation
Optional ¶
public readonly isolation: PodConnectionsIsolation;
- Type:
cdk8s-plus-29.PodConnectionsIsolation
- Default: unset, isolates both the pod and the peer.
Which isolation should be applied to establish the connection.
ports
Optional ¶
public readonly ports: NetworkPolicyPort[];
- Type:
cdk8s-plus-29.NetworkPolicyPort
[] - Default: If the peer is a managed pod, take its ports. Otherwise, all ports are allowed.
Ports to allow outgoing traffic to.
PodDnsProps ¶
Properties for PodDns
.
Initializer ¶
import { PodDnsProps } from 'cdk8s-plus-29'
const podDnsProps: PodDnsProps = { ... }
hostname
Optional ¶
public readonly hostname: string;
- Type:
string
- Default: Set to a system-defined value.
Specifies the hostname of the Pod.
hostnameAsFQDN
Optional ¶
public readonly hostnameAsFQDN: boolean;
- Type:
boolean
- Default: false
If true the pod’s hostname will be configured as the pod’s FQDN, rather than the leaf name (the default).
In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters to FQDN. If a pod does not have FQDN, this has no effect.
nameservers
Optional ¶
public readonly nameservers: string[];
- Type:
string
[]
A list of IP addresses that will be used as DNS servers for the Pod.
There can be at most 3 IP addresses specified. When the policy is set to “NONE”, the list must contain at least one IP address, otherwise this property is optional. The servers listed will be combined to the base nameservers generated from the specified DNS policy with duplicate addresses removed.
options
Optional ¶
public readonly options: DnsOption[];
- Type:
cdk8s-plus-29.DnsOption
[]
List of objects where each object may have a name property (required) and a value property (optional).
The contents in this property will be merged to the options generated from the specified DNS policy. Duplicate entries are removed.
policy
Optional ¶
public readonly policy: DnsPolicy;
- Type:
cdk8s-plus-29.DnsPolicy
- Default: DnsPolicy.CLUSTER_FIRST
Set DNS policy for the pod.
If policy is set to None
, other configuration must be supplied.
searches
Optional ¶
public readonly searches: string[];
- Type:
string
[]
A list of DNS search domains for hostname lookup in the Pod.
When specified, the provided list will be merged into the base search domain names generated from the chosen DNS policy. Duplicate domain names are removed.
Kubernetes allows for at most 6 search domains.
subdomain
Optional ¶
public readonly subdomain: string;
- Type:
string
- Default: No subdomain.
If specified, the fully qualified Pod hostname will be “
PodProps ¶
Properties for Pod
.
Initializer ¶
import { PodProps } from 'cdk8s-plus-29'
const podProps: PodProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
PodsAllOptions ¶
Options for Pods.all
.
Initializer ¶
import { PodsAllOptions } from 'cdk8s-plus-29'
const podsAllOptions: PodsAllOptions = { ... }
namespaces
Optional ¶
public readonly namespaces: Namespaces;
- Type:
cdk8s-plus-29.Namespaces
- Default: unset, implies the namespace of the resource this selection is used in.
Namespaces the pods are allowed to be in.
Use Namespaces.all()
to allow all namespaces.
PodSchedulingAttractOptions ¶
Options for PodScheduling.attract
.
Initializer ¶
import { PodSchedulingAttractOptions } from 'cdk8s-plus-29'
const podSchedulingAttractOptions: PodSchedulingAttractOptions = { ... }
weight
Optional ¶
public readonly weight: number;
- Type:
number
- Default: no weight. assignment is assumed to be required (hard).
Indicates the attraction is optional (soft), with this weight score.
PodSchedulingColocateOptions ¶
Options for PodScheduling.colocate
.
Initializer ¶
import { PodSchedulingColocateOptions } from 'cdk8s-plus-29'
const podSchedulingColocateOptions: PodSchedulingColocateOptions = { ... }
topology
Optional ¶
public readonly topology: Topology;
- Type:
cdk8s-plus-29.Topology
- Default: Topology.HOSTNAME
Which topology to coloate on.
weight
Optional ¶
public readonly weight: number;
- Type:
number
- Default: no weight. co-location is assumed to be required (hard).
Indicates the co-location is optional (soft), with this weight score.
PodSchedulingSeparateOptions ¶
Options for PodScheduling.separate
.
Initializer ¶
import { PodSchedulingSeparateOptions } from 'cdk8s-plus-29'
const podSchedulingSeparateOptions: PodSchedulingSeparateOptions = { ... }
topology
Optional ¶
public readonly topology: Topology;
- Type:
cdk8s-plus-29.Topology
- Default: Topology.HOSTNAME
Which topology to separate on.
weight
Optional ¶
public readonly weight: number;
- Type:
number
- Default: no weight. separation is assumed to be required (hard).
Indicates the separation is optional (soft), with this weight score.
PodSecurityContextProps ¶
Properties for PodSecurityContext
.
Initializer ¶
import { PodSecurityContextProps } from 'cdk8s-plus-29'
const podSecurityContextProps: PodSecurityContextProps = { ... }
ensureNonRoot
Optional ¶
public readonly ensureNonRoot: boolean;
- Type:
boolean
- Default: true
Indicates that the container must run as a non-root user.
If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does.
fsGroup
Optional ¶
public readonly fsGroup: number;
- Type:
number
- Default: Volume ownership is not changed.
Modify the ownership and permissions of pod volumes to this GID.
fsGroupChangePolicy
Optional ¶
public readonly fsGroupChangePolicy: FsGroupChangePolicy;
- Type:
cdk8s-plus-29.FsGroupChangePolicy
- Default: FsGroupChangePolicy.ALWAYS
Defines behavior of changing ownership and permission of the volume before being exposed inside Pod.
This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir.
group
Optional ¶
public readonly group: number;
- Type:
number
- Default: Group configured by container runtime
The GID to run the entrypoint of the container process.
sysctls
Optional ¶
public readonly sysctls: Sysctl[];
- Type:
cdk8s-plus-29.Sysctl
[] - Default: No sysctls
Sysctls hold a list of namespaced sysctls used for the pod.
Pods with unsupported sysctls (by the container runtime) might fail to launch.
user
Optional ¶
public readonly user: number;
- Type:
number
- Default: User specified in image metadata
The UID to run the entrypoint of the container process.
PodSelectorConfig ¶
Configuration for selecting pods, optionally in particular namespaces.
Initializer ¶
import { PodSelectorConfig } from 'cdk8s-plus-29'
const podSelectorConfig: PodSelectorConfig = { ... }
labelSelector
Required ¶
public readonly labelSelector: LabelSelector;
A selector to select pods by labels.
namespaces
Optional ¶
public readonly namespaces: NamespaceSelectorConfig;
Configuration for selecting which namepsaces are the pods allowed to be in.
PodsSelectOptions ¶
Options for Pods.select
.
Initializer ¶
import { PodsSelectOptions } from 'cdk8s-plus-29'
const podsSelectOptions: PodsSelectOptions = { ... }
expressions
Optional ¶
public readonly expressions: LabelExpression[];
- Type:
cdk8s-plus-29.LabelExpression
[] - Default: no expressions requirements.
Expressions the pods must satisify.
labels
Optional ¶
public readonly labels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
} - Default: no strict labels requirements.
Labels the pods must have.
namespaces
Optional ¶
public readonly namespaces: Namespaces;
- Type:
cdk8s-plus-29.Namespaces
- Default: unset, implies the namespace of the resource this selection is used in.
Namespaces the pods are allowed to be in.
Use Namespaces.all()
to allow all namespaces.
ProbeOptions ¶
Probe options.
Initializer ¶
import { ProbeOptions } from 'cdk8s-plus-29'
const probeOptions: ProbeOptions = { ... }
failureThreshold
Optional ¶
public readonly failureThreshold: number;
- Type:
number
- Default: 3
Minimum consecutive failures for the probe to be considered failed after having succeeded.
Defaults to 3. Minimum value is 1.
initialDelaySeconds
Optional ¶
public readonly initialDelaySeconds: Duration;
- Type:
cdk8s.Duration
- Default: immediate
Number of seconds after the container has started before liveness probes are initiated.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
periodSeconds
Optional ¶
public readonly periodSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(10) Minimum value is 1.
How often (in seconds) to perform the probe.
Default to 10 seconds. Minimum value is 1.
successThreshold
Optional ¶
public readonly successThreshold: number;
- Type:
number
- Default: 1 Must be 1 for liveness and startup. Minimum value is 1.
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1.
Must be 1 for liveness and startup. Minimum value is 1.
timeoutSeconds
Optional ¶
public readonly timeoutSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(1)
Number of seconds after which the probe times out.
Defaults to 1 second. Minimum value is 1.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
ResourceProps ¶
Initialization properties for resources.
Initializer ¶
import { ResourceProps } from 'cdk8s-plus-29'
const resourceProps: ResourceProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
RoleBindingProps ¶
Properties for RoleBinding
.
Initializer ¶
import { RoleBindingProps } from 'cdk8s-plus-29'
const roleBindingProps: RoleBindingProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
role
Required ¶
public readonly role: IRole;
- Type:
cdk8s-plus-29.IRole
The role to bind to.
A RoleBinding can reference a Role or a ClusterRole.
RolePolicyRule ¶
Policy rule of a `Role.
Initializer ¶
import { RolePolicyRule } from 'cdk8s-plus-29'
const rolePolicyRule: RolePolicyRule = { ... }
resources
Required ¶
public readonly resources: IApiResource[];
- Type:
cdk8s-plus-29.IApiResource
[]
Resources this rule applies to.
verbs
Required ¶
public readonly verbs: string[];
- Type:
string
[]
Verbs to allow.
(e.g [‘get’, ‘watch’])
RoleProps ¶
Properties for Role
.
Initializer ¶
import { RoleProps } from 'cdk8s-plus-29'
const roleProps: RoleProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
rules
Optional ¶
public readonly rules: RolePolicyRule[];
- Type:
cdk8s-plus-29.RolePolicyRule
[] - Default: []
A list of rules the role should allow.
ScalingPolicy ¶
Initializer ¶
import { ScalingPolicy } from 'cdk8s-plus-29'
const scalingPolicy: ScalingPolicy = { ... }
replicas
Required ¶
public readonly replicas: Replicas;
- Type:
cdk8s-plus-29.Replicas
The type and quantity of replicas to change.
duration
Optional ¶
public readonly duration: Duration;
- Type:
cdk8s.Duration
- Default: 15 seconds
The amount of time the scaling policy has to continue scaling before the target metric must be revalidated.
Must be greater than 0 seconds and no longer than 30 minutes.
ScalingRules ¶
Defines the scaling behavior for one direction.
Initializer ¶
import { ScalingRules } from 'cdk8s-plus-29'
const scalingRules: ScalingRules = { ... }
policies
Optional ¶
public readonly policies: ScalingPolicy[];
- Type:
cdk8s-plus-29.ScalingPolicy
[] - Default: * Scale up
- Increase no more than 4 pods per 60 seconds
- Double the number of pods per 60 seconds
- Scale down
- Decrease to minReplica count
The scaling policies.
stabilizationWindow
Optional ¶
public readonly stabilizationWindow: Duration;
- Type:
cdk8s.Duration
- Default: * On scale down no stabilization is performed.
- On scale up stabilization is performed for 5 minutes.
Defines the window of past metrics that the autoscaler should consider when calculating wether or not autoscaling should occur.
Minimum duration is 1 second, max is 1 hour.
strategy
Optional ¶
public readonly strategy: ScalingStrategy;
- Type:
cdk8s-plus-29.ScalingStrategy
- Default: MAX_CHANGE
The strategy to use when scaling.
ScalingTarget ¶
Properties used to configure the target of an Autoscaler.
Initializer ¶
import { ScalingTarget } from 'cdk8s-plus-29'
const scalingTarget: ScalingTarget = { ... }
apiVersion
Required ¶
public readonly apiVersion: string;
- Type:
string
The object’s API version (e.g. “authorization.k8s.io/v1”).
containers
Required ¶
public readonly containers: Container[];
- Type:
cdk8s-plus-29.Container
[]
Container definitions associated with the target.
kind
Required ¶
public readonly kind: string;
- Type:
string
The object kind (e.g. “Deployment”).
name
Required ¶
public readonly name: string;
- Type:
string
The Kubernetes name of this resource.
replicas
Optional ¶
public readonly replicas: number;
- Type:
number
The fixed number of replicas defined on the target.
This is used for validation purposes as Scalable targets should not have a fixed number of replicas.
SeccompProfile ¶
Initializer ¶
import { SeccompProfile } from 'cdk8s-plus-29'
const seccompProfile: SeccompProfile = { ... }
type
Required ¶
public readonly type: SeccompProfileType;
Indicates which kind of seccomp profile will be applied.
localhostProfile
Optional ¶
public readonly localhostProfile: string;
- Type:
string
- Default: empty string
localhostProfile indicates a profile defined in a file on the node should be used.
The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet’s configured seccomp profile location. Must only be set if type is “Localhost”.
SecretProps ¶
Options for Secret
.
Initializer ¶
import { SecretProps } from 'cdk8s-plus-29'
const secretProps: SecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
stringData
Optional ¶
public readonly stringData: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
stringData allows specifying non-binary secret data in string form.
It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.
type
Optional ¶
public readonly type: string;
- Type:
string
- Default: undefined - Don’t set a type.
Optional type associated with the secret.
Used to facilitate programmatic handling of secret data by various controllers.
SecretValue ¶
Represents a specific value in JSON secret.
Initializer ¶
import { SecretValue } from 'cdk8s-plus-29'
const secretValue: SecretValue = { ... }
key
Required ¶
public readonly key: string;
- Type:
string
The JSON key.
secret
Required ¶
public readonly secret: ISecret;
- Type:
cdk8s-plus-29.ISecret
The secret.
SecretVolumeOptions ¶
Options for the Secret-based volume.
Initializer ¶
import { SecretVolumeOptions } from 'cdk8s-plus-29'
const secretVolumeOptions: SecretVolumeOptions = { ... }
defaultMode
Optional ¶
public readonly defaultMode: number;
- Type:
number
- Default: 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
Mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
items
Optional ¶
public readonly items: {[ key: string ]: PathMapping};
- Type: {[ key: string ]:
cdk8s-plus-29.PathMapping
} - Default: no mapping
If unspecified, each key-value pair in the Data field of the referenced secret will be projected into the volume as a file whose name is the key and content is the value.
If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the ‘..’ path or start with ‘..’.
name
Optional ¶
public readonly name: string;
- Type:
string
- Default: auto-generated
The volume name.
optional
Optional ¶
public readonly optional: boolean;
- Type:
boolean
- Default: undocumented
Specify whether the secret or its keys must be defined.
ServiceAccountProps ¶
Properties for initialization of ServiceAccount
.
Initializer ¶
import { ServiceAccountProps } from 'cdk8s-plus-29'
const serviceAccountProps: ServiceAccountProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountToken
Optional ¶
public readonly automountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether pods running as this service account should have an API token automatically mounted.
Can be overridden at the pod level.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
secrets
Optional ¶
public readonly secrets: ISecret[];
- Type:
cdk8s-plus-29.ISecret
[]
List of secrets allowed to be used by pods running using this ServiceAccount.
https://kubernetes.io/docs/concepts/configuration/secret
ServiceAccountTokenSecretProps ¶
Options for ServiceAccountTokenSecret
.
Initializer ¶
import { ServiceAccountTokenSecretProps } from 'cdk8s-plus-29'
const serviceAccountTokenSecretProps: ServiceAccountTokenSecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
serviceAccount
Required ¶
public readonly serviceAccount: IServiceAccount;
The service account to store a secret for.
ServiceBindOptions ¶
Options for Service.bind
.
Initializer ¶
import { ServiceBindOptions } from 'cdk8s-plus-29'
const serviceBindOptions: ServiceBindOptions = { ... }
name
Optional ¶
public readonly name: string;
- Type:
string
The name of this port within the service.
This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the ‘Name’ field in EndpointPort objects. Optional if only one ServicePort is defined on this service.
nodePort
Optional ¶
public readonly nodePort: number;
- Type:
number
- Default: auto-allocate a port if the ServiceType of this Service requires one.
The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one.
https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
protocol
Optional ¶
public readonly protocol: Protocol;
- Type:
cdk8s-plus-29.Protocol
- Default: Protocol.TCP
The IP protocol for this port.
Supports “TCP”, “UDP”, and “SCTP”. Default is TCP.
targetPort
Optional ¶
public readonly targetPort: number;
- Type:
number
- Default: The value of
port
will be used.
The port number the service will redirect to.
ServiceIngressBackendOptions ¶
Options for setting up backends for ingress rules.
Initializer ¶
import { ServiceIngressBackendOptions } from 'cdk8s-plus-29'
const serviceIngressBackendOptions: ServiceIngressBackendOptions = { ... }
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: if the service exposes a single port, this port will be used.
The port to use to access the service.
This option will fail if the service does not expose any ports. - If the service exposes multiple ports, this option must be specified. - If the service exposes a single port, this option is optional and if specified, it must be the same port exposed by the service.
ServicePort ¶
Definition of a service port.
Initializer ¶
import { ServicePort } from 'cdk8s-plus-29'
const servicePort: ServicePort = { ... }
name
Optional ¶
public readonly name: string;
- Type:
string
The name of this port within the service.
This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the ‘Name’ field in EndpointPort objects. Optional if only one ServicePort is defined on this service.
nodePort
Optional ¶
public readonly nodePort: number;
- Type:
number
- Default: auto-allocate a port if the ServiceType of this Service requires one.
The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one.
https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
protocol
Optional ¶
public readonly protocol: Protocol;
- Type:
cdk8s-plus-29.Protocol
- Default: Protocol.TCP
The IP protocol for this port.
Supports “TCP”, “UDP”, and “SCTP”. Default is TCP.
targetPort
Optional ¶
public readonly targetPort: number;
- Type:
number
- Default: The value of
port
will be used.
The port number the service will redirect to.
port
Required ¶
public readonly port: number;
- Type:
number
The port number the service will bind to.
ServiceProps ¶
Properties for Service
.
Initializer ¶
import { ServiceProps } from 'cdk8s-plus-29'
const serviceProps: ServiceProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
clusterIP
Optional ¶
public readonly clusterIP: string;
- Type:
string
- Default: Automatically assigned.
The IP address of the service and is usually assigned randomly by the master.
If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are “None”, empty string (“”), or a valid IP address. “None” can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName.
https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
externalIPs
Optional ¶
public readonly externalIPs: string[];
- Type:
string
[] - Default: No external IPs.
A list of IP addresses for which nodes in the cluster will also accept traffic for this service.
These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.
externalName
Optional ¶
public readonly externalName: string;
- Type:
string
- Default: No external name.
The externalName to be used when ServiceType.EXTERNAL_NAME is set.
loadBalancerSourceRanges
Optional ¶
public readonly loadBalancerSourceRanges: string[];
- Type:
string
[]
A list of CIDR IP addresses, if specified and supported by the platform, will restrict traffic through the cloud-provider load-balancer to the specified client IPs.
More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
ports
Optional ¶
public readonly ports: ServicePort[];
- Type:
cdk8s-plus-29.ServicePort
[] - Default: either the selector ports, or none.
The ports this service binds to.
If the selector of the service is a managed pod / workload, its ports will are automatically extracted and used as the default value. Otherwise, no ports are bound.
publishNotReadyAddresses
Optional ¶
public readonly publishNotReadyAddresses: boolean;
- Type:
boolean
- Default: false
The publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready.
More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#servicespec-v1-core
selector
Optional ¶
public readonly selector: IPodSelector;
- Type:
cdk8s-plus-29.IPodSelector
- Default: unset, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify.
Which pods should the service select and route to.
You can pass one of the following:
- An instance of
Pod
or any workload resource (e.gDeployment
,StatefulSet
, …) - Pods selected by the
Pods.select
function. Note that in this case only labels can be specified.
type
Optional ¶
public readonly type: ServiceType;
- Type:
cdk8s-plus-29.ServiceType
- Default: ServiceType.ClusterIP
Determines how the Service is exposed.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
SshAuthSecretProps ¶
Options for SshAuthSecret
.
Initializer ¶
import { SshAuthSecretProps } from 'cdk8s-plus-29'
const sshAuthSecretProps: SshAuthSecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
sshPrivateKey
Required ¶
public readonly sshPrivateKey: string;
- Type:
string
The SSH private key to use.
StatefulSetProps ¶
Properties for initialization of StatefulSet
.
Initializer ¶
import { StatefulSetProps } from 'cdk8s-plus-29'
const statefulSetProps: StatefulSetProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
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()
dns
Optional ¶
public readonly dns: PodDnsProps;
- Type:
cdk8s-plus-29.PodDnsProps
- Default: policy: DnsPolicy.CLUSTER_FIRST hostnameAsFQDN: false
DNS settings for the pod.
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
dockerRegistryAuth
Optional ¶
public readonly dockerRegistryAuth: ISecret;
- Type:
cdk8s-plus-29.ISecret
- Default: No auth. Images are assumed to be publicly available.
A secret containing docker credentials for authenticating to a registry.
hostAliases
Optional ¶
public readonly hostAliases: HostAlias[];
- Type:
cdk8s-plus-29.HostAlias
[]
HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.
hostNetwork
Optional ¶
public readonly hostNetwork: boolean;
- Type:
boolean
- Default: false
Host network for the pod.
initContainers
Optional ¶
public readonly initContainers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No init containers.
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.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
isolate
Optional ¶
public readonly isolate: boolean;
- Type:
boolean
- Default: false
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.
restartPolicy
Optional ¶
public readonly restartPolicy: RestartPolicy;
- Type:
cdk8s-plus-29.RestartPolicy
- Default: RestartPolicy.ALWAYS
Restart policy for all containers within the pod.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
securityContext
Optional ¶
public readonly securityContext: PodSecurityContextProps;
- Type:
cdk8s-plus-29.PodSecurityContextProps
- Default: fsGroupChangePolicy: FsGroupChangePolicy.FsGroupChangePolicy.ALWAYS ensureNonRoot: true
SecurityContext holds pod-level security attributes and common container settings.
serviceAccount
Optional ¶
public readonly serviceAccount: IServiceAccount;
- Type:
cdk8s-plus-29.IServiceAccount
- Default: No service account.
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).
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
terminationGracePeriod
Optional ¶
public readonly terminationGracePeriod: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(30)
Grace period until the pod is terminated.
volumes
Optional ¶
public readonly volumes: Volume[];
- Type:
cdk8s-plus-29.Volume
[] - Default: No volumes.
List of volumes that can be mounted by containers belonging to the pod.
You can also add volumes later using podSpec.addVolume()
https://kubernetes.io/docs/concepts/storage/volumes
podMetadata
Optional ¶
public readonly podMetadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
The pod metadata of this workload.
select
Optional ¶
public readonly select: boolean;
- Type:
boolean
- Default: true
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.
spread
Optional ¶
public readonly spread: boolean;
- Type:
boolean
- Default: false
Automatically spread pods across hostname and zones.
https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints
minReady
Optional ¶
public readonly minReady: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(0)
Minimum duration for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
Zero means the pod will be considered available as soon as it is ready.
This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.
https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#min-ready-seconds
podManagementPolicy
Optional ¶
public readonly podManagementPolicy: PodManagementPolicy;
- Type:
cdk8s-plus-29.PodManagementPolicy
- Default: PodManagementPolicy.ORDERED_READY
Pod management policy to use for this statefulset.
replicas
Optional ¶
public readonly replicas: number;
- Type:
number
- Default: 1
Number of desired pods.
service
Optional ¶
public readonly service: Service;
- Type:
cdk8s-plus-29.Service
- Default: A new headless service will be created.
Service to associate with the statefulset.
strategy
Optional ¶
public readonly strategy: StatefulSetUpdateStrategy;
- Type:
cdk8s-plus-29.StatefulSetUpdateStrategy
- Default: RollingUpdate with partition set to 0
Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.
StatefulSetUpdateStrategyRollingUpdateOptions ¶
Options for StatefulSetUpdateStrategy.rollingUpdate
.
Initializer ¶
import { StatefulSetUpdateStrategyRollingUpdateOptions } from 'cdk8s-plus-29'
const statefulSetUpdateStrategyRollingUpdateOptions: StatefulSetUpdateStrategyRollingUpdateOptions = { ... }
partition
Optional ¶
public readonly partition: number;
- Type:
number
- Default: 0
If specified, all Pods with an ordinal that is greater than or equal to the partition will be updated when the StatefulSet’s .spec.template is updated. All Pods with an ordinal that is less than the partition will not be updated, and, even if they are deleted, they will be recreated at the previous version.
If the partition is greater than replicas, updates to the pod template will not be propagated to Pods. In most cases you will not need to use a partition, but they are useful if you want to stage an update, roll out a canary, or perform a phased roll out.
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
SubjectConfiguration ¶
Subject contains a reference to the object or user identities a role binding applies to.
This can either hold a direct API object reference, or a value for non-objects such as user and group names.
Initializer ¶
import { SubjectConfiguration } from 'cdk8s-plus-29'
const subjectConfiguration: SubjectConfiguration = { ... }
kind
Required ¶
public readonly kind: string;
- Type:
string
Kind of object being referenced.
Values defined by this API group are “User”, “Group”, and “ServiceAccount”. If the Authorizer does not recognized the kind value, the Authorizer should report an error.
name
Required ¶
public readonly name: string;
- Type:
string
Name of the object being referenced.
apiGroup
Optional ¶
public readonly apiGroup: string;
- Type:
string
APIGroup holds the API group of the referenced subject.
Defaults to “” for ServiceAccount subjects. Defaults to “rbac.authorization.k8s.io” for User and Group subjects.
namespace
Optional ¶
public readonly namespace: string;
- Type:
string
Namespace of the referenced object.
If the object kind is non-namespace, such as “User” or “Group”, and this value is not empty the Authorizer should report an error.
Sysctl ¶
Sysctl defines a kernel parameter to be set.
Initializer ¶
import { Sysctl } from 'cdk8s-plus-29'
const sysctl: Sysctl = { ... }
name
Required ¶
public readonly name: string;
- Type:
string
Name of a property to set.
value
Required ¶
public readonly value: string;
- Type:
string
Value of a property to set.
TcpSocketProbeOptions ¶
Options for Probe.fromTcpSocket()
.
Initializer ¶
import { TcpSocketProbeOptions } from 'cdk8s-plus-29'
const tcpSocketProbeOptions: TcpSocketProbeOptions = { ... }
failureThreshold
Optional ¶
public readonly failureThreshold: number;
- Type:
number
- Default: 3
Minimum consecutive failures for the probe to be considered failed after having succeeded.
Defaults to 3. Minimum value is 1.
initialDelaySeconds
Optional ¶
public readonly initialDelaySeconds: Duration;
- Type:
cdk8s.Duration
- Default: immediate
Number of seconds after the container has started before liveness probes are initiated.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
periodSeconds
Optional ¶
public readonly periodSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(10) Minimum value is 1.
How often (in seconds) to perform the probe.
Default to 10 seconds. Minimum value is 1.
successThreshold
Optional ¶
public readonly successThreshold: number;
- Type:
number
- Default: 1 Must be 1 for liveness and startup. Minimum value is 1.
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1.
Must be 1 for liveness and startup. Minimum value is 1.
timeoutSeconds
Optional ¶
public readonly timeoutSeconds: Duration;
- Type:
cdk8s.Duration
- Default: Duration.seconds(1)
Number of seconds after which the probe times out.
Defaults to 1 second. Minimum value is 1.
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
host
Optional ¶
public readonly host: string;
- Type:
string
- Default: defaults to the pod IP
The host name to connect to on the container.
port
Optional ¶
public readonly port: number;
- Type:
number
- Default: defaults to
container.port
.
The TCP port to connect to on the container.
TlsSecretProps ¶
Options for TlsSecret
.
Initializer ¶
import { TlsSecretProps } from 'cdk8s-plus-29'
const tlsSecretProps: TlsSecretProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
immutable
Optional ¶
public readonly immutable: boolean;
- Type:
boolean
- Default: false
If set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
If not set to true, the field can be modified at any time.
tlsCert
Required ¶
public readonly tlsCert: string;
- Type:
string
The TLS cert.
tlsKey
Required ¶
public readonly tlsKey: string;
- Type:
string
The TLS key.
VolumeMount ¶
Mount a volume from the pod to the container.
Initializer ¶
import { VolumeMount } from 'cdk8s-plus-29'
const volumeMount: VolumeMount = { ... }
propagation
Optional ¶
public readonly propagation: MountPropagation;
- Type:
cdk8s-plus-29.MountPropagation
- Default: MountPropagation.NONE
Determines how mounts are propagated from the host to container and the other way around.
When not set, MountPropagationNone is used.
Mount propagation allows for sharing volumes mounted by a Container to other Containers in the same Pod, or even to other Pods on the same node.
readOnly
Optional ¶
public readonly readOnly: boolean;
- Type:
boolean
- Default: false
Mounted read-only if true, read-write otherwise (false or unspecified).
Defaults to false.
subPath
Optional ¶
public readonly subPath: string;
- Type:
string
- Default: “” the volume’s root
Path within the volume from which the container’s volume should be mounted.).
subPathExpr
Optional ¶
public readonly subPathExpr: string;
- Type:
string
- Default: “” volume’s root.
Expanded path within the volume from which the container’s volume should be mounted.
Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container’s environment. Defaults to “” (volume’s root).
subPathExpr
and subPath
are mutually exclusive.
path
Required ¶
public readonly path: string;
- Type:
string
Path within the container at which the volume should be mounted.
Must not contain ‘:’.
volume
Required ¶
public readonly volume: Volume;
- Type:
cdk8s-plus-29.Volume
The volume to mount.
WorkloadProps ¶
Properties for Workload
.
Initializer ¶
import { WorkloadProps } from 'cdk8s-plus-29'
const workloadProps: WorkloadProps = { ... }
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
Metadata that all persisted resources must have, which includes all objects users must create.
automountServiceAccountToken
Optional ¶
public readonly automountServiceAccountToken: boolean;
- Type:
boolean
- Default: false
Indicates whether a service account token should be automatically mounted.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
containers
Optional ¶
public readonly containers: ContainerProps[];
- Type:
cdk8s-plus-29.ContainerProps
[] - Default: No containers. Note that a pod spec must include at least one container.
List of containers belonging to the pod.
Containers cannot currently be added or removed. There must be a