Class EphemeralContainer.Builder
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.core.v1.EphemeralContainer.Builder
-
- Enclosing class:
- EphemeralContainer
public static class EphemeralContainer.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EphemeralContainer.Builder
addToArgs(java.lang.String addToArgs)
EphemeralContainer.Builder
addToCommand(java.lang.String addToCommand)
EphemeralContainer.Builder
addToEnv(EnvVar addToEnv)
EphemeralContainer.Builder
addToEnvFrom(EnvFromSource addToEnvFrom)
EphemeralContainer.Builder
addToPorts(ContainerPort addToPorts)
EphemeralContainer.Builder
addToResizePolicy(ContainerResizePolicy addToResizePolicy)
EphemeralContainer.Builder
addToVolumeDevices(VolumeDevice addToVolumeDevices)
EphemeralContainer.Builder
addToVolumeMounts(VolumeMount addToVolumeMounts)
EphemeralContainer.Builder
args(java.util.Collection<? extends java.lang.String> args)
EphemeralContainer
build()
EphemeralContainer.Builder
clearArgs()
EphemeralContainer.Builder
clearCommand()
EphemeralContainer.Builder
clearEnv()
EphemeralContainer.Builder
clearEnvFrom()
EphemeralContainer.Builder
clearPorts()
EphemeralContainer.Builder
clearResizePolicy()
EphemeralContainer.Builder
clearVolumeDevices()
EphemeralContainer.Builder
clearVolumeMounts()
EphemeralContainer.Builder
command(java.util.Collection<? extends java.lang.String> command)
EphemeralContainer.Builder
env(java.util.Collection<? extends EnvVar> env)
EphemeralContainer.Builder
envFrom(java.util.Collection<? extends EnvFromSource> envFrom)
EphemeralContainer.Builder
image(java.lang.String image)
Container image name.EphemeralContainer.Builder
imagePullPolicy(java.lang.String imagePullPolicy)
Image pull policy.EphemeralContainer.Builder
lifecycle(Lifecycle lifecycle)
EphemeralContainer.Builder
livenessProbe(Probe livenessProbe)
EphemeralContainer.Builder
name(@NonNull java.lang.String name)
Name of the ephemeral container specified as a DNS_LABEL.EphemeralContainer.Builder
ports(java.util.Collection<? extends ContainerPort> ports)
EphemeralContainer.Builder
readinessProbe(Probe readinessProbe)
EphemeralContainer.Builder
resizePolicy(java.util.Collection<? extends ContainerResizePolicy> resizePolicy)
EphemeralContainer.Builder
resources(ResourceRequirements resources)
EphemeralContainer.Builder
restartPolicy(java.lang.String restartPolicy)
Restart policy for the container to manage the restart behavior of each container within a pod.EphemeralContainer.Builder
securityContext(SecurityContext securityContext)
EphemeralContainer.Builder
startupProbe(Probe startupProbe)
EphemeralContainer.Builder
stdin(java.lang.Boolean stdin)
Whether this container should allocate a buffer for stdin in the container runtime.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.EphemeralContainer.Builder
targetContainerName(java.lang.String targetContainerName)
If set, the name of the container from PodSpec that this ephemeral container targets.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.EphemeralContainer.Builder
terminationMessagePolicy(java.lang.String terminationMessagePolicy)
Indicate how the termination message should be populated.java.lang.String
toString()
EphemeralContainer.Builder
tty(java.lang.Boolean tty)
Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.EphemeralContainer.Builder
volumeDevices(java.util.Collection<? extends VolumeDevice> volumeDevices)
EphemeralContainer.Builder
volumeMounts(java.util.Collection<? extends VolumeMount> volumeMounts)
EphemeralContainer.Builder
workingDir(java.lang.String workingDir)
Container's working directory.
-
-
-
Method Detail
-
addToArgs
public EphemeralContainer.Builder addToArgs(java.lang.String addToArgs)
-
args
public EphemeralContainer.Builder args(java.util.Collection<? extends java.lang.String> args)
-
clearArgs
public EphemeralContainer.Builder clearArgs()
-
addToCommand
public EphemeralContainer.Builder addToCommand(java.lang.String addToCommand)
-
command
public EphemeralContainer.Builder command(java.util.Collection<? extends java.lang.String> command)
-
clearCommand
public EphemeralContainer.Builder clearCommand()
-
addToEnv
public EphemeralContainer.Builder addToEnv(EnvVar addToEnv)
-
env
public EphemeralContainer.Builder env(java.util.Collection<? extends EnvVar> env)
-
clearEnv
public EphemeralContainer.Builder clearEnv()
-
addToEnvFrom
public EphemeralContainer.Builder addToEnvFrom(EnvFromSource addToEnvFrom)
-
envFrom
public EphemeralContainer.Builder envFrom(java.util.Collection<? extends EnvFromSource> envFrom)
-
clearEnvFrom
public EphemeralContainer.Builder clearEnvFrom()
-
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
.
-
lifecycle
public EphemeralContainer.Builder lifecycle(Lifecycle lifecycle)
- Returns:
this
.
-
livenessProbe
public EphemeralContainer.Builder livenessProbe(Probe livenessProbe)
- 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
.
-
addToPorts
public EphemeralContainer.Builder addToPorts(ContainerPort addToPorts)
-
ports
public EphemeralContainer.Builder ports(java.util.Collection<? extends ContainerPort> ports)
-
clearPorts
public EphemeralContainer.Builder clearPorts()
-
readinessProbe
public EphemeralContainer.Builder readinessProbe(Probe readinessProbe)
- Returns:
this
.
-
addToResizePolicy
public EphemeralContainer.Builder addToResizePolicy(ContainerResizePolicy addToResizePolicy)
-
resizePolicy
public EphemeralContainer.Builder resizePolicy(java.util.Collection<? extends ContainerResizePolicy> resizePolicy)
-
clearResizePolicy
public EphemeralContainer.Builder clearResizePolicy()
-
resources
public EphemeralContainer.Builder resources(ResourceRequirements resources)
- 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
.
-
securityContext
public EphemeralContainer.Builder securityContext(SecurityContext securityContext)
- Returns:
this
.
-
startupProbe
public EphemeralContainer.Builder startupProbe(Probe startupProbe)
- 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
.
-
addToVolumeDevices
public EphemeralContainer.Builder addToVolumeDevices(VolumeDevice addToVolumeDevices)
-
volumeDevices
public EphemeralContainer.Builder volumeDevices(java.util.Collection<? extends VolumeDevice> volumeDevices)
-
clearVolumeDevices
public EphemeralContainer.Builder clearVolumeDevices()
-
addToVolumeMounts
public EphemeralContainer.Builder addToVolumeMounts(VolumeMount addToVolumeMounts)
-
volumeMounts
public EphemeralContainer.Builder volumeMounts(java.util.Collection<? extends VolumeMount> volumeMounts)
-
clearVolumeMounts
public EphemeralContainer.Builder clearVolumeMounts()
-
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
.
-
build
public EphemeralContainer build()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-