Class Pod

  • All Implemented Interfaces:
    IPodSpec, IResource, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

    @Generated(value="jsii-pacmak/1.55.1 (build 07d2d90)",
               date="2022-04-02T02:38:57.562Z")
    @Stability(Stable)
    public class Pod
    extends Resource
    implements IPodSpec
    Pod is a collection of containers that can run on a host.

    This resource is created by clients and scheduled onto hosts.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Pod.Builder
      A fluent builder for Pod.
      • 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
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Pod​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  
      protected Pod​(software.amazon.jsii.JsiiObjectRef objRef)  
        Pod​(software.constructs.Construct scope, String id)  
        Pod​(software.constructs.Construct scope, String id, PodProps props)  
    • Constructor Detail

      • Pod

        protected Pod​(software.amazon.jsii.JsiiObjectRef objRef)
      • Pod

        protected Pod​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
      • Pod

        @Stability(Stable)
        public Pod​(@NotNull
                   software.constructs.Construct scope,
                   @NotNull
                   String id,
                   @Nullable
                   PodProps props)
        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
        props -
      • Pod

        @Stability(Stable)
        public Pod​(@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 container)
        Add a container to the pod.

        Specified by:
        addContainer in interface IPodSpec
        Parameters:
        container - This parameter is required.
      • addVolume

        @Stability(Stable)
        public void addVolume​(@NotNull
                              Volume volume)
        Add a volume to the pod.

        Specified by:
        addVolume in interface IPodSpec
        Parameters:
        volume - This parameter is required.
      • getApiObject

        @Stability(Stable)
        @NotNull
        protected org.cdk8s.ApiObject getApiObject()
        The underlying cdk8s API object.

        Specified by:
        getApiObject in class Resource
        See Also:
        base.Resource.apiObject
      • getContainers

        @Stability(Stable)
        @NotNull
        public List<Container> getContainers()
        The containers belonging to the pod.

        Use addContainer to add containers.

        Specified by:
        getContainers in interface IPodSpec
      • getVolumes

        @Stability(Stable)
        @NotNull
        public List<Volume> getVolumes()
        The volumes associated with this pod.

        Use addVolume to add volumes.

        Specified by:
        getVolumes in interface IPodSpec
      • getRestartPolicy

        @Stability(Stable)
        @Nullable
        public RestartPolicy getRestartPolicy()
        Restart policy for all containers within the pod.
        Specified by:
        getRestartPolicy in interface IPodSpec