Package org.cdk8s.plus20
Class DaemonSet
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus20.Resource
-
- org.cdk8s.plus20.DaemonSet
-
- All Implemented Interfaces:
IPodSpec,IPodTemplate,IResource,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.57.0 (build f614666)", date="2022-04-26T09:02:10.451Z") @Stability(Stable) public class DaemonSet extends Resource implements IPodTemplate
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDaemonSet.BuilderA fluent builder forDaemonSet.-
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IPodTemplate
IPodTemplate.Jsii$Default, IPodTemplate.Jsii$Proxy
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IResource
IResource.Jsii$Default
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDaemonSet(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedDaemonSet(software.amazon.jsii.JsiiObjectRef objRef)DaemonSet(software.constructs.Construct scope, String id)DaemonSet(software.constructs.Construct scope, String id, DaemonSetProps props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContaineraddContainer(ContainerProps cont)Add a container to the pod.voidaddHostAlias(HostAlias hostAlias)ContaineraddInitContainer(ContainerProps cont)Add an init container to the pod.voidaddVolume(Volume vol)Add a volume to the pod.protected org.cdk8s.ApiObjectgetApiObject()The underlying cdk8s API object.List<Container>getContainers()The containers belonging to the pod.PodDnsgetDns()The pod's DNS settings.List<HostAlias>getHostAliases()An optional list of hosts and IPs that will be injected into the pod's hosts file if specified.List<Container>getInitContainers()The init containers belonging to the pod.Map<String,String>getLabelSelector()The labels this daemon set will match against in order to select pods.NumbergetMinReadySeconds()org.cdk8s.ApiObjectMetadataDefinitiongetPodMetadata()Provides read/write access to the underlying pod metadata of the resource.RestartPolicygetRestartPolicy()Restart policy for all containers within the pod.PodSecurityContextgetSecurityContext()The pod's security context.IServiceAccountgetServiceAccount()The service account used to run this pod.List<Volume>getVolumes()The volumes associated with this pod.voidselectByLabel(String key, String value)Configure a label selector to this daemon set.-
Methods inherited from class org.cdk8s.plus20.Resource
getMetadata, getName
-
Methods inherited from class software.constructs.Construct
onPrepare, onSynthesize, onValidate, toString
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
DaemonSet
protected DaemonSet(software.amazon.jsii.JsiiObjectRef objRef)
-
DaemonSet
protected DaemonSet(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
DaemonSet
@Stability(Stable) public DaemonSet(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable DaemonSetProps props)- Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
DaemonSet
@Stability(Stable) public DaemonSet(@NotNull software.constructs.Construct scope, @NotNull String id)- Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Detail
-
addContainer
@Stability(Stable) @NotNull public Container addContainer(@NotNull ContainerProps cont)
Add a container to the pod.- Specified by:
addContainerin interfaceIPodSpec- Parameters:
cont- This parameter is required.
-
addHostAlias
@Stability(Stable) public void addHostAlias(@NotNull HostAlias hostAlias)- Parameters:
hostAlias- This parameter is required.
-
addInitContainer
@Stability(Stable) @NotNull public Container addInitContainer(@NotNull ContainerProps cont)
Add an init container to the pod.- Specified by:
addInitContainerin interfaceIPodSpec- Parameters:
cont- This parameter is required.
-
addVolume
@Stability(Stable) public void addVolume(@NotNull Volume vol)Add a volume to the pod.
-
selectByLabel
@Stability(Stable) public void selectByLabel(@NotNull String key, @NotNull String value)Configure a label selector to this daemon set.- Parameters:
key- This parameter is required.value- This parameter is required.
-
getApiObject
@Stability(Stable) @NotNull protected org.cdk8s.ApiObject getApiObject()
The underlying cdk8s API object.- Specified by:
getApiObjectin classResource- See Also:
base.Resource.apiObject
-
getContainers
@Stability(Stable) @NotNull public List<Container> getContainers()
The containers belonging to the pod.Use
addContainerto add containers.- Specified by:
getContainersin interfaceIPodSpec
-
getDns
@Stability(Stable) @NotNull public PodDns getDns()
The pod's DNS settings.
-
getHostAliases
@Stability(Stable) @NotNull public List<HostAlias> getHostAliases()
An optional list of hosts and IPs that will be injected into the pod's hosts file if specified.This is only valid for non-hostNetwork pods.
- Specified by:
getHostAliasesin interfaceIPodSpec
-
getInitContainers
@Stability(Stable) @NotNull public List<Container> getInitContainers()
The init containers belonging to the pod.Use
addInitContainerto add init containers.- Specified by:
getInitContainersin interfaceIPodSpec
-
getLabelSelector
@Stability(Stable) @NotNull public Map<String,String> getLabelSelector()
The labels this daemon set will match against in order to select pods.Returns a a copy. Use
selectByLabel()to add labels.
-
getMinReadySeconds
@Stability(Stable) @NotNull public Number getMinReadySeconds()
-
getPodMetadata
@Stability(Stable) @NotNull public org.cdk8s.ApiObjectMetadataDefinition getPodMetadata()
Provides read/write access to the underlying pod metadata of the resource.- Specified by:
getPodMetadatain interfaceIPodTemplate
-
getSecurityContext
@Stability(Stable) @NotNull public PodSecurityContext getSecurityContext()
The pod's security context.- Specified by:
getSecurityContextin interfaceIPodSpec
-
getVolumes
@Stability(Stable) @NotNull public List<Volume> getVolumes()
The volumes associated with this pod.Use
addVolumeto add volumes.- Specified by:
getVolumesin interfaceIPodSpec
-
getRestartPolicy
@Stability(Stable) @Nullable public RestartPolicy getRestartPolicy()
Restart policy for all containers within the pod.- Specified by:
getRestartPolicyin interfaceIPodSpec
-
getServiceAccount
@Stability(Stable) @Nullable public IServiceAccount getServiceAccount()
The service account used to run this pod.- Specified by:
getServiceAccountin interfaceIPodSpec
-
-