Class EphemeralContainer.Builder

  • Enclosing class:
    EphemeralContainer

    public static class EphemeralContainer.Builder
    extends java.lang.Object
    • Method Detail

      • image

        public EphemeralContainer.Builder image​(java.lang.String image)
        Container image name. More info: https://kubernetes.io/docs/concepts/containers/images
        Returns:
        this.
      • imagePullPolicy

        public EphemeralContainer.Builder imagePullPolicy​(java.lang.String imagePullPolicy)
        Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
        Returns:
        this.
      • name

        public EphemeralContainer.Builder name​(@NonNull
                                               @NonNull java.lang.String name)
        Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.
        Returns:
        this.
      • restartPolicy

        public EphemeralContainer.Builder restartPolicy​(java.lang.String restartPolicy)
        Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.
        Returns:
        this.
      • stdin

        public EphemeralContainer.Builder stdin​(java.lang.Boolean stdin)
        Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.
        Returns:
        this.
      • stdinOnce

        public EphemeralContainer.Builder stdinOnce​(java.lang.Boolean stdinOnce)
        Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false
        Returns:
        this.
      • targetContainerName

        public EphemeralContainer.Builder targetContainerName​(java.lang.String targetContainerName)
        If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.


        The container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.

        Returns:
        this.
      • terminationMessagePath

        public EphemeralContainer.Builder terminationMessagePath​(java.lang.String terminationMessagePath)
        Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.
        Returns:
        this.
      • terminationMessagePolicy

        public EphemeralContainer.Builder terminationMessagePolicy​(java.lang.String terminationMessagePolicy)
        Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.
        Returns:
        this.
      • tty

        public EphemeralContainer.Builder tty​(java.lang.Boolean tty)
        Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.
        Returns:
        this.
      • workingDir

        public EphemeralContainer.Builder workingDir​(java.lang.String workingDir)
        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.
        Returns:
        this.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object