Class Container

  • All Implemented Interfaces:
    software.amazon.jsii.JsiiSerializable

    @Generated(value="jsii-pacmak/1.55.1 (build 07d2d90)",
               date="2022-04-02T02:38:57.515Z")
    @Stability(Stable)
    public class Container
    extends software.amazon.jsii.JsiiObject
    A single application container that you want to run within a pod.
    • Constructor Detail

      • Container

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

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

        @Stability(Stable)
        public Container​(@NotNull
                         ContainerProps props)
        Parameters:
        props - This parameter is required.
    • Method Detail

      • addEnv

        @Stability(Stable)
        public void addEnv​(@NotNull
                           String name,
                           @NotNull
                           EnvValue value)
        Add an environment value to the container.

        The variable value can come from various dynamic sources such a secrets of config maps.

        Parameters:
        name - - The variable name. This parameter is required.
        value - - The variable value. This parameter is required.
        See Also:
        EnvValue.fromXXX
      • mount

        @Stability(Stable)
        public void mount​(@NotNull
                          String path,
                          @NotNull
                          Volume volume,
                          @Nullable
                          MountOptions options)
        Mount a volume to a specific path so that it is accessible by the container.

        Every pod that is configured to use this container will autmoatically have access to the volume.

        Parameters:
        path - - The desired path in the container. This parameter is required.
        volume - - The volume to mount. This parameter is required.
        options -
      • mount

        @Stability(Stable)
        public void mount​(@NotNull
                          String path,
                          @NotNull
                          Volume volume)
        Mount a volume to a specific path so that it is accessible by the container.

        Every pod that is configured to use this container will autmoatically have access to the volume.

        Parameters:
        path - - The desired path in the container. This parameter is required.
        volume - - The volume to mount. This parameter is required.
      • getEnv

        @Stability(Stable)
        @NotNull
        public Map<String,​EnvValue> getEnv()
        The environment variables for this container.

        Returns a copy. To add environment variables use addEnv().

      • getImage

        @Stability(Stable)
        @NotNull
        public String getImage()
        The container image.
      • getImagePullPolicy

        @Stability(Stable)
        @NotNull
        public ImagePullPolicy getImagePullPolicy()
        Image pull policy for this container.
      • getMounts

        @Stability(Stable)
        @NotNull
        public List<VolumeMount> getMounts()
        Volume mounts configured for this container.
      • getName

        @Stability(Stable)
        @NotNull
        public String getName()
        The name of the container.
      • getArgs

        @Stability(Stable)
        @Nullable
        public List<String> getArgs()
        Arguments to the entrypoint.

        Returns:
        a copy of the arguments array, cannot be modified.
      • getCommand

        @Stability(Stable)
        @Nullable
        public List<String> getCommand()
        Entrypoint array (the command to execute when the container starts).

        Returns:
        a copy of the entrypoint array, cannot be modified
      • getPort

        @Stability(Stable)
        @Nullable
        public Number getPort()
        The port this container exposes.
      • getResources

        @Stability(Stable)
        @Nullable
        public Resources getResources()
        Compute resources (CPU and memory requests and limits) required by the container.

      • getWorkingDir

        @Stability(Stable)
        @Nullable
        public String getWorkingDir()
        The working directory inside the container.