@Generated(value="jsii-pacmak/1.13.0 (build 385c325)", date="2020-10-21T06:58:44.652Z") @Stability(value=Experimental) public class Deployment extends Resource implements IPodTemplate
You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
Note: Do not manage ReplicaSets owned by a Deployment. Consider opening an issue in the main Kubernetes repository if your use case is not covered below.
The following are typical use cases for Deployments:
| Modifier and Type | Class and Description |
|---|---|
static class |
Deployment.Builder
(experimental) A fluent builder for
Deployment. |
software.amazon.jsii.JsiiObject.InitializationModeIPodTemplate.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Deployment(software.constructs.Construct scope,
String id) |
|
Deployment(software.constructs.Construct scope,
String id,
DeploymentProps props) |
protected |
Deployment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Deployment(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContainer(Container container)
(experimental) Add a container to the pod.
|
void |
addVolume(Volume volume)
(experimental) Add a volume to the pod.
|
Service |
expose(Number port)
(experimental) Expose a deployment via a service.
|
Service |
expose(Number port,
ExposeOptions options)
(experimental) Expose a deployment via a service.
|
protected ApiObject |
getApiObject()
(experimental) The underlying cdk8s API object.
|
List<Container> |
getContainers()
(experimental) The containers belonging to the pod.
|
Map<String,String> |
getLabelSelector()
(experimental) The labels this deployment will match against in order to select pods.
|
ApiObjectMetadataDefinition |
getPodMetadata()
(experimental) Provides read/write access to the underlying pod metadata of the resource.
|
Number |
getReplicas()
(experimental) Number of desired pods.
|
RestartPolicy |
getRestartPolicy()
(experimental) Restart policy for all containers within the pod.
|
IServiceAccount |
getServiceAccount()
(experimental) The service account used to run this pod.
|
List<Volume> |
getVolumes()
(experimental) The volumes associated with this pod.
|
void |
selectByLabel(String key,
String value)
(experimental) Configure a label selector to this deployment.
|
getMetadata, getNameonPrepare, onSynthesize, onValidate, toStringjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSetprotected Deployment(software.amazon.jsii.JsiiObjectRef objRef)
protected Deployment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Deployment(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
DeploymentProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Experimental)
public Deployment(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Experimental)
public void addContainer(@NotNull
Container container)
addContainer in interface IPodSpeccontainer - This parameter is required.@Stability(value=Experimental)
public void addVolume(@NotNull
Volume volume)
@Stability(value=Experimental) @NotNull public Service expose(@NotNull Number port, @Nullable ExposeOptions options)
This is equivalent to running kubectl expose deployment <deployment-name>.
port - The port number the service will bind to. This parameter is required.options - Options.@Stability(value=Experimental) @NotNull public Service expose(@NotNull Number port)
This is equivalent to running kubectl expose deployment <deployment-name>.
port - The port number the service will bind to. This parameter is required.@Stability(value=Experimental)
public void selectByLabel(@NotNull
String key,
@NotNull
String value)
Pods that have the label will be selected by deployments configured with this spec.
key - - The label key. This parameter is required.value - - The label value. This parameter is required.@Stability(value=Experimental) @NotNull protected ApiObject getApiObject()
getApiObject in class Resourcebase.Resource.apiObject@Stability(value=Experimental) @NotNull public List<Container> getContainers()
Use addContainer to add containers.
getContainers in interface IPodSpec@Stability(value=Experimental) @NotNull public Map<String,String> getLabelSelector()
Returns a a copy. Use selectByLabel() to add labels.
@Stability(value=Experimental) @NotNull public ApiObjectMetadataDefinition getPodMetadata()
getPodMetadata in interface IPodTemplate@Stability(value=Experimental) @NotNull public Number getReplicas()
@Stability(value=Experimental) @NotNull public List<Volume> getVolumes()
Use addVolume to add volumes.
getVolumes in interface IPodSpec@Stability(value=Experimental) @Nullable public RestartPolicy getRestartPolicy()
getRestartPolicy in interface IPodSpec@Stability(value=Experimental) @Nullable public IServiceAccount getServiceAccount()
getServiceAccount in interface IPodSpecCopyright © 2020. All rights reserved.