All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cdk8s.plus.PodSpecDefinition Maven / Gradle / Ivy

There is a newer version: 0.33.0
Show newest version
package org.cdk8s.plus;

/**
 * A description of a pod.
 * 

* EXPERIMENTAL */ @javax.annotation.Generated(value = "jsii-pacmak/1.7.0 (build 179a3a5)", date = "2020-06-29T13:29:38.526Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Jsii(module = org.cdk8s.plus.$Module.class, fqn = "cdk8s-plus.PodSpecDefinition") public class PodSpecDefinition extends software.amazon.jsii.JsiiObject { protected PodSpecDefinition(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected PodSpecDefinition(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } /** * EXPERIMENTAL *

* @param props */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public PodSpecDefinition(final @org.jetbrains.annotations.Nullable org.cdk8s.plus.PodSpec props) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { props }); } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public PodSpecDefinition() { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); } /** * Adds a container to this pod. *

* EXPERIMENTAL *

* @param container The container to add. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public void addContainer(final @org.jetbrains.annotations.NotNull org.cdk8s.plus.Container container) { this.jsiiCall("addContainer", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(container, "container is required") }); } /** * Adds a volume to this pod. *

* EXPERIMENTAL *

* @param volume The volume to add. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public void addVolume(final @org.jetbrains.annotations.NotNull org.cdk8s.plus.Volume volume) { this.jsiiCall("addVolume", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(volume, "volume is required") }); } /** * List of containers belonging to the pod. *

* EXPERIMENTAL *

* @return a copy - do not modify */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.util.List getContainers() { return java.util.Collections.unmodifiableList(this.jsiiGet("containers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus.Container.class)))); } /** * List of volumes that can be mounted by containers belonging to the pod. *

* Returns a copy. To add volumes, use addVolume(). *

* EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.util.List getVolumes() { return java.util.Collections.unmodifiableList(this.jsiiGet("volumes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus.Volume.class)))); } /** * Restart policy for all containers within the pod. *

* EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.Nullable org.cdk8s.plus.RestartPolicy getRestartPolicy() { return this.jsiiGet("restartPolicy", org.cdk8s.plus.RestartPolicy.class); } /** * The service account used to run this pod. *

* EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.Nullable org.cdk8s.plus.IServiceAccount getServiceAccount() { return this.jsiiGet("serviceAccount", org.cdk8s.plus.IServiceAccount.class); } /** * A fluent builder for {@link org.cdk8s.plus.PodSpecDefinition}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { /** * EXPERIMENTAL *

* @return a new instance of {@link Builder}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static Builder create() { return new Builder(); } private org.cdk8s.plus.PodSpec.Builder props; private Builder() { } /** * List of containers belonging to the pod. *

* Containers cannot currently be * added or removed. There must be at least one container in a Pod. *

* You can add additionnal containers using podSpec.addContainer() *

* Default: - No containers. Note that a pod spec must include at least one container. *

* EXPERIMENTAL *

* @return {@code this} * @param containers List of containers belonging to the pod. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder containers(final java.util.List containers) { this.props().containers(containers); return this; } /** * Restart policy for all containers within the pod. *

* Default: RestartPolicy.ALWAYS *

* EXPERIMENTAL *

* @return {@code this} * @see https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy * @param restartPolicy Restart policy for all containers within the pod. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder restartPolicy(final org.cdk8s.plus.RestartPolicy restartPolicy) { this.props().restartPolicy(restartPolicy); return this; } /** * A service account provides an identity for processes that run in a Pod. *

* When you (a human) access the cluster (for example, using kubectl), you are * authenticated by the apiserver as a particular User Account (currently this * is usually admin, unless your cluster administrator has customized your * cluster). Processes in containers inside pods can also contact the * apiserver. When they do, they are authenticated as a particular Service * Account (for example, default). *

* Default: - No service account. *

* EXPERIMENTAL *

* @return {@code this} * @see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ * @param serviceAccount A service account provides an identity for processes that run in a Pod. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder serviceAccount(final org.cdk8s.plus.IServiceAccount serviceAccount) { this.props().serviceAccount(serviceAccount); return this; } /** * List of volumes that can be mounted by containers belonging to the pod. *

* You can also add volumes later using podSpec.addVolume() *

* Default: - No volumes. *

* EXPERIMENTAL *

* @return {@code this} * @see https://kubernetes.io/docs/concepts/storage/volumes * @param volumes List of volumes that can be mounted by containers belonging to the pod. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder volumes(final java.util.List volumes) { this.props().volumes(volumes); return this; } /** * @returns a newly built instance of {@link org.cdk8s.plus.PodSpecDefinition}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public org.cdk8s.plus.PodSpecDefinition build() { return new org.cdk8s.plus.PodSpecDefinition( this.props != null ? this.props.build() : null ); } private org.cdk8s.plus.PodSpec.Builder props() { if (this.props == null) { this.props = new org.cdk8s.plus.PodSpec.Builder(); } return this.props; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy