cdk8s
Version:
This is the core library of Cloud Development Kit (CDK) for Kubernetes (cdk8s). cdk8s apps synthesize into standard Kubernetes manifests which can be applied to any Kubernetes cluster.
1,486 lines (928 loc) • 142 kB
Markdown
# API Reference <a name="API Reference" id="api-reference"></a>
## Constructs <a name="Constructs" id="Constructs"></a>
### ApiObject <a name="ApiObject" id="cdk8s.ApiObject"></a>
#### Initializers <a name="Initializers" id="cdk8s.ApiObject.Initializer"></a>
```java
import org.cdk8s.ApiObject;
ApiObject.Builder.create(Construct scope, java.lang.String id)
.apiVersion(java.lang.String)
.kind(java.lang.String)
// .metadata(ApiObjectMetadata)
.build();
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.ApiObject.Initializer.parameter.scope">scope</a></code> | <code>software.constructs.Construct</code> | the construct scope. |
| <code><a href="#cdk8s.ApiObject.Initializer.parameter.id">id</a></code> | <code>java.lang.String</code> | namespace. |
| <code><a href="#cdk8s.ApiObject.Initializer.parameter.apiVersion">apiVersion</a></code> | <code>java.lang.String</code> | API version. |
| <code><a href="#cdk8s.ApiObject.Initializer.parameter.kind">kind</a></code> | <code>java.lang.String</code> | Resource kind. |
| <code><a href="#cdk8s.ApiObject.Initializer.parameter.metadata">metadata</a></code> | <code><a href="#cdk8s.ApiObjectMetadata">ApiObjectMetadata</a></code> | Object metadata. |
---
##### `scope`<sup>Required</sup> <a name="scope" id="cdk8s.ApiObject.Initializer.parameter.scope"></a>
- *Type:* software.constructs.Construct
the construct scope.
---
##### `id`<sup>Required</sup> <a name="id" id="cdk8s.ApiObject.Initializer.parameter.id"></a>
- *Type:* java.lang.String
namespace.
---
##### `apiVersion`<sup>Required</sup> <a name="apiVersion" id="cdk8s.ApiObject.Initializer.parameter.apiVersion"></a>
- *Type:* java.lang.String
API version.
---
##### `kind`<sup>Required</sup> <a name="kind" id="cdk8s.ApiObject.Initializer.parameter.kind"></a>
- *Type:* java.lang.String
Resource kind.
---
##### `metadata`<sup>Optional</sup> <a name="metadata" id="cdk8s.ApiObject.Initializer.parameter.metadata"></a>
- *Type:* <a href="#cdk8s.ApiObjectMetadata">ApiObjectMetadata</a>
Object metadata.
If `name` is not specified, an app-unique name will be allocated by the
framework based on the path of the construct within thes construct tree.
---
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.ApiObject.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#cdk8s.ApiObject.addDependency">addDependency</a></code> | Create a dependency between this ApiObject and other constructs. |
| <code><a href="#cdk8s.ApiObject.addJsonPatch">addJsonPatch</a></code> | Applies a set of RFC-6902 JSON-Patch operations to the manifest synthesized for this API object. |
| <code><a href="#cdk8s.ApiObject.toJson">toJson</a></code> | Renders the object to Kubernetes JSON. |
---
##### `toString` <a name="toString" id="cdk8s.ApiObject.toString"></a>
```java
public java.lang.String toString()
```
Returns a string representation of this construct.
##### `addDependency` <a name="addDependency" id="cdk8s.ApiObject.addDependency"></a>
```java
public void addDependency(IConstruct... dependencies)
```
Create a dependency between this ApiObject and other constructs.
These can be other ApiObjects, Charts, or custom.
###### `dependencies`<sup>Required</sup> <a name="dependencies" id="cdk8s.ApiObject.addDependency.parameter.dependencies"></a>
- *Type:* software.constructs.IConstruct...
the dependencies to add.
---
##### `addJsonPatch` <a name="addJsonPatch" id="cdk8s.ApiObject.addJsonPatch"></a>
```java
public void addJsonPatch(JsonPatch... ops)
```
Applies a set of RFC-6902 JSON-Patch operations to the manifest synthesized for this API object.
*Example*
```java
// Example automatically generated from non-compiling source. May contain errors.
kubePod.addJsonPatch(JsonPatch.replace("/spec/enableServiceLinks", true));
```
###### `ops`<sup>Required</sup> <a name="ops" id="cdk8s.ApiObject.addJsonPatch.parameter.ops"></a>
- *Type:* <a href="#cdk8s.JsonPatch">JsonPatch</a>...
The JSON-Patch operations to apply.
---
##### `toJson` <a name="toJson" id="cdk8s.ApiObject.toJson"></a>
```java
public java.lang.Object toJson()
```
Renders the object to Kubernetes JSON.
To disable sorting of dictionary keys in output object set the
`CDK8S_DISABLE_SORT` environment variable to any non-empty value.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.ApiObject.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
| <code><a href="#cdk8s.ApiObject.isApiObject">isApiObject</a></code> | Return whether the given object is an `ApiObject`. |
| <code><a href="#cdk8s.ApiObject.of">of</a></code> | Returns the `ApiObject` named `Resource` which is a child of the given construct. |
---
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk8s.ApiObject.isConstruct"></a>
```java
import org.cdk8s.ApiObject;
ApiObject.isConstruct(java.lang.Object x)
```
Checks if `x` is a construct.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s.ApiObject.isConstruct.parameter.x"></a>
- *Type:* java.lang.Object
Any object.
---
##### `isApiObject` <a name="isApiObject" id="cdk8s.ApiObject.isApiObject"></a>
```java
import org.cdk8s.ApiObject;
ApiObject.isApiObject(java.lang.Object o)
```
Return whether the given object is an `ApiObject`.
We do attribute detection since we can't reliably use 'instanceof'.
###### `o`<sup>Required</sup> <a name="o" id="cdk8s.ApiObject.isApiObject.parameter.o"></a>
- *Type:* java.lang.Object
The object to check.
---
##### `of` <a name="of" id="cdk8s.ApiObject.of"></a>
```java
import org.cdk8s.ApiObject;
ApiObject.of(IConstruct c)
```
Returns the `ApiObject` named `Resource` which is a child of the given construct.
If `c` is an `ApiObject`, it is returned directly. Throws an
exception if the construct does not have a child named `Default` *or* if
this child is not an `ApiObject`.
###### `c`<sup>Required</sup> <a name="c" id="cdk8s.ApiObject.of.parameter.c"></a>
- *Type:* software.constructs.IConstruct
The higher-level construct.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.ApiObject.property.node">node</a></code> | <code>software.constructs.Node</code> | The tree node. |
| <code><a href="#cdk8s.ApiObject.property.apiGroup">apiGroup</a></code> | <code>java.lang.String</code> | The group portion of the API version (e.g. `authorization.k8s.io`). |
| <code><a href="#cdk8s.ApiObject.property.apiVersion">apiVersion</a></code> | <code>java.lang.String</code> | The object's API version (e.g. `authorization.k8s.io/v1`). |
| <code><a href="#cdk8s.ApiObject.property.chart">chart</a></code> | <code><a href="#cdk8s.Chart">Chart</a></code> | The chart in which this object is defined. |
| <code><a href="#cdk8s.ApiObject.property.kind">kind</a></code> | <code>java.lang.String</code> | The object kind. |
| <code><a href="#cdk8s.ApiObject.property.metadata">metadata</a></code> | <code><a href="#cdk8s.ApiObjectMetadataDefinition">ApiObjectMetadataDefinition</a></code> | Metadata associated with this API object. |
| <code><a href="#cdk8s.ApiObject.property.name">name</a></code> | <code>java.lang.String</code> | The name of the API object. |
---
##### `node`<sup>Required</sup> <a name="node" id="cdk8s.ApiObject.property.node"></a>
```java
public Node getNode();
```
- *Type:* software.constructs.Node
The tree node.
---
##### `apiGroup`<sup>Required</sup> <a name="apiGroup" id="cdk8s.ApiObject.property.apiGroup"></a>
```java
public java.lang.String getApiGroup();
```
- *Type:* java.lang.String
The group portion of the API version (e.g. `authorization.k8s.io`).
---
##### `apiVersion`<sup>Required</sup> <a name="apiVersion" id="cdk8s.ApiObject.property.apiVersion"></a>
```java
public java.lang.String getApiVersion();
```
- *Type:* java.lang.String
The object's API version (e.g. `authorization.k8s.io/v1`).
---
##### `chart`<sup>Required</sup> <a name="chart" id="cdk8s.ApiObject.property.chart"></a>
```java
public Chart getChart();
```
- *Type:* <a href="#cdk8s.Chart">Chart</a>
The chart in which this object is defined.
---
##### `kind`<sup>Required</sup> <a name="kind" id="cdk8s.ApiObject.property.kind"></a>
```java
public java.lang.String getKind();
```
- *Type:* java.lang.String
The object kind.
---
##### `metadata`<sup>Required</sup> <a name="metadata" id="cdk8s.ApiObject.property.metadata"></a>
```java
public ApiObjectMetadataDefinition getMetadata();
```
- *Type:* <a href="#cdk8s.ApiObjectMetadataDefinition">ApiObjectMetadataDefinition</a>
Metadata associated with this API object.
---
##### `name`<sup>Required</sup> <a name="name" id="cdk8s.ApiObject.property.name"></a>
```java
public java.lang.String getName();
```
- *Type:* java.lang.String
The name of the API object.
If a name is specified in `metadata.name` this will be the name returned.
Otherwise, a name will be generated by calling
`Chart.of(this).generatedObjectName(this)`, which by default uses the
construct path to generate a DNS-compatible name for the resource.
---
### App <a name="App" id="cdk8s.App"></a>
Represents a cdk8s application.
#### Initializers <a name="Initializers" id="cdk8s.App.Initializer"></a>
```java
import org.cdk8s.App;
App.Builder.create()
// .outdir(java.lang.String)
// .outputFileExtension(java.lang.String)
// .recordConstructMetadata(java.lang.Boolean)
// .resolvers(java.util.List<IResolver>)
// .yamlOutputType(YamlOutputType)
.build();
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.App.Initializer.parameter.outdir">outdir</a></code> | <code>java.lang.String</code> | The directory to output Kubernetes manifests. |
| <code><a href="#cdk8s.App.Initializer.parameter.outputFileExtension">outputFileExtension</a></code> | <code>java.lang.String</code> | The file extension to use for rendered YAML files. |
| <code><a href="#cdk8s.App.Initializer.parameter.recordConstructMetadata">recordConstructMetadata</a></code> | <code>java.lang.Boolean</code> | When set to true, the output directory will contain a `construct-metadata.json` file that holds construct related metadata on every resource in the app. |
| <code><a href="#cdk8s.App.Initializer.parameter.resolvers">resolvers</a></code> | <code>java.util.List<<a href="#cdk8s.IResolver">IResolver</a>></code> | A list of resolvers that can be used to replace property values before they are written to the manifest file. |
| <code><a href="#cdk8s.App.Initializer.parameter.yamlOutputType">yamlOutputType</a></code> | <code><a href="#cdk8s.YamlOutputType">YamlOutputType</a></code> | How to divide the YAML output into files. |
---
##### `outdir`<sup>Optional</sup> <a name="outdir" id="cdk8s.App.Initializer.parameter.outdir"></a>
- *Type:* java.lang.String
- *Default:* CDK8S_OUTDIR if defined, otherwise "dist"
The directory to output Kubernetes manifests.
If you synthesize your application using `cdk8s synth`, you must
also pass this value to the CLI using the `--output` option or
the `output` property in the `cdk8s.yaml` configuration file.
Otherwise, the CLI will not know about the output directory,
and synthesis will fail.
This property is intended for internal and testing use.
---
##### `outputFileExtension`<sup>Optional</sup> <a name="outputFileExtension" id="cdk8s.App.Initializer.parameter.outputFileExtension"></a>
- *Type:* java.lang.String
- *Default:* .k8s.yaml
The file extension to use for rendered YAML files.
---
##### `recordConstructMetadata`<sup>Optional</sup> <a name="recordConstructMetadata" id="cdk8s.App.Initializer.parameter.recordConstructMetadata"></a>
- *Type:* java.lang.Boolean
- *Default:* false
When set to true, the output directory will contain a `construct-metadata.json` file that holds construct related metadata on every resource in the app.
---
##### `resolvers`<sup>Optional</sup> <a name="resolvers" id="cdk8s.App.Initializer.parameter.resolvers"></a>
- *Type:* java.util.List<<a href="#cdk8s.IResolver">IResolver</a>>
- *Default:* no resolvers.
A list of resolvers that can be used to replace property values before they are written to the manifest file.
When multiple resolvers are passed,
they are invoked by order in the list, and only the first one that applies
(e.g calls `context.replaceValue`) is invoked.
> [https://cdk8s.io/docs/latest/basics/app/#resolvers](https://cdk8s.io/docs/latest/basics/app/#resolvers)
---
##### `yamlOutputType`<sup>Optional</sup> <a name="yamlOutputType" id="cdk8s.App.Initializer.parameter.yamlOutputType"></a>
- *Type:* <a href="#cdk8s.YamlOutputType">YamlOutputType</a>
- *Default:* YamlOutputType.FILE_PER_CHART
How to divide the YAML output into files.
---
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.App.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#cdk8s.App.synth">synth</a></code> | Synthesizes all manifests to the output directory. |
| <code><a href="#cdk8s.App.synthYaml">synthYaml</a></code> | Synthesizes the app into a YAML string. |
---
##### `toString` <a name="toString" id="cdk8s.App.toString"></a>
```java
public java.lang.String toString()
```
Returns a string representation of this construct.
##### `synth` <a name="synth" id="cdk8s.App.synth"></a>
```java
public void synth()
```
Synthesizes all manifests to the output directory.
##### `synthYaml` <a name="synthYaml" id="cdk8s.App.synthYaml"></a>
```java
public java.lang.String synthYaml()
```
Synthesizes the app into a YAML string.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.App.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
| <code><a href="#cdk8s.App.of">of</a></code> | *No description.* |
---
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk8s.App.isConstruct"></a>
```java
import org.cdk8s.App;
App.isConstruct(java.lang.Object x)
```
Checks if `x` is a construct.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s.App.isConstruct.parameter.x"></a>
- *Type:* java.lang.Object
Any object.
---
##### `of` <a name="of" id="cdk8s.App.of"></a>
```java
import org.cdk8s.App;
App.of(IConstruct c)
```
###### `c`<sup>Required</sup> <a name="c" id="cdk8s.App.of.parameter.c"></a>
- *Type:* software.constructs.IConstruct
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.App.property.node">node</a></code> | <code>software.constructs.Node</code> | The tree node. |
| <code><a href="#cdk8s.App.property.charts">charts</a></code> | <code>java.util.List<<a href="#cdk8s.Chart">Chart</a>></code> | Returns all the charts in this app, sorted topologically. |
| <code><a href="#cdk8s.App.property.outdir">outdir</a></code> | <code>java.lang.String</code> | The output directory into which manifests will be synthesized. |
| <code><a href="#cdk8s.App.property.outputFileExtension">outputFileExtension</a></code> | <code>java.lang.String</code> | The file extension to use for rendered YAML files. |
| <code><a href="#cdk8s.App.property.resolvers">resolvers</a></code> | <code>java.util.List<<a href="#cdk8s.IResolver">IResolver</a>></code> | Resolvers used by this app. |
| <code><a href="#cdk8s.App.property.yamlOutputType">yamlOutputType</a></code> | <code><a href="#cdk8s.YamlOutputType">YamlOutputType</a></code> | How to divide the YAML output into files. |
---
##### `node`<sup>Required</sup> <a name="node" id="cdk8s.App.property.node"></a>
```java
public Node getNode();
```
- *Type:* software.constructs.Node
The tree node.
---
##### `charts`<sup>Required</sup> <a name="charts" id="cdk8s.App.property.charts"></a>
```java
public java.util.List<Chart> getCharts();
```
- *Type:* java.util.List<<a href="#cdk8s.Chart">Chart</a>>
Returns all the charts in this app, sorted topologically.
---
##### `outdir`<sup>Required</sup> <a name="outdir" id="cdk8s.App.property.outdir"></a>
```java
public java.lang.String getOutdir();
```
- *Type:* java.lang.String
The output directory into which manifests will be synthesized.
---
##### `outputFileExtension`<sup>Required</sup> <a name="outputFileExtension" id="cdk8s.App.property.outputFileExtension"></a>
```java
public java.lang.String getOutputFileExtension();
```
- *Type:* java.lang.String
- *Default:* .k8s.yaml
The file extension to use for rendered YAML files.
---
##### `resolvers`<sup>Required</sup> <a name="resolvers" id="cdk8s.App.property.resolvers"></a>
```java
public java.util.List<IResolver> getResolvers();
```
- *Type:* java.util.List<<a href="#cdk8s.IResolver">IResolver</a>>
Resolvers used by this app.
This includes both custom resolvers
passed by the `resolvers` property, as well as built-in resolvers.
---
##### `yamlOutputType`<sup>Required</sup> <a name="yamlOutputType" id="cdk8s.App.property.yamlOutputType"></a>
```java
public YamlOutputType getYamlOutputType();
```
- *Type:* <a href="#cdk8s.YamlOutputType">YamlOutputType</a>
- *Default:* YamlOutputType.FILE_PER_CHART
How to divide the YAML output into files.
---
### Chart <a name="Chart" id="cdk8s.Chart"></a>
#### Initializers <a name="Initializers" id="cdk8s.Chart.Initializer"></a>
```java
import org.cdk8s.Chart;
Chart.Builder.create(Construct scope, java.lang.String id)
// .disableResourceNameHashes(java.lang.Boolean)
// .labels(java.util.Map<java.lang.String, java.lang.String>)
// .namespace(java.lang.String)
.build();
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.Chart.Initializer.parameter.scope">scope</a></code> | <code>software.constructs.Construct</code> | *No description.* |
| <code><a href="#cdk8s.Chart.Initializer.parameter.id">id</a></code> | <code>java.lang.String</code> | *No description.* |
| <code><a href="#cdk8s.Chart.Initializer.parameter.disableResourceNameHashes">disableResourceNameHashes</a></code> | <code>java.lang.Boolean</code> | The autogenerated resource name by default is suffixed with a stable hash of the construct path. |
| <code><a href="#cdk8s.Chart.Initializer.parameter.labels">labels</a></code> | <code>java.util.Map<java.lang.String, java.lang.String></code> | Labels to apply to all resources in this chart. |
| <code><a href="#cdk8s.Chart.Initializer.parameter.namespace">namespace</a></code> | <code>java.lang.String</code> | The default namespace for all objects defined in this chart (directly or indirectly). |
---
##### `scope`<sup>Required</sup> <a name="scope" id="cdk8s.Chart.Initializer.parameter.scope"></a>
- *Type:* software.constructs.Construct
---
##### `id`<sup>Required</sup> <a name="id" id="cdk8s.Chart.Initializer.parameter.id"></a>
- *Type:* java.lang.String
---
##### `disableResourceNameHashes`<sup>Optional</sup> <a name="disableResourceNameHashes" id="cdk8s.Chart.Initializer.parameter.disableResourceNameHashes"></a>
- *Type:* java.lang.Boolean
- *Default:* false
The autogenerated resource name by default is suffixed with a stable hash of the construct path.
Setting this property to true drops the hash suffix.
---
##### `labels`<sup>Optional</sup> <a name="labels" id="cdk8s.Chart.Initializer.parameter.labels"></a>
- *Type:* java.util.Map<java.lang.String, java.lang.String>
- *Default:* no common labels
Labels to apply to all resources in this chart.
---
##### `namespace`<sup>Optional</sup> <a name="namespace" id="cdk8s.Chart.Initializer.parameter.namespace"></a>
- *Type:* java.lang.String
- *Default:* no namespace is synthesized (usually this implies "default")
The default namespace for all objects defined in this chart (directly or indirectly).
This namespace will only apply to objects that don't have a
`namespace` explicitly defined for them.
---
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.Chart.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#cdk8s.Chart.addDependency">addDependency</a></code> | Create a dependency between this Chart and other constructs. |
| <code><a href="#cdk8s.Chart.generateObjectName">generateObjectName</a></code> | Generates a app-unique name for an object given it's construct node path. |
| <code><a href="#cdk8s.Chart.toJson">toJson</a></code> | Renders this chart to a set of Kubernetes JSON resources. |
---
##### `toString` <a name="toString" id="cdk8s.Chart.toString"></a>
```java
public java.lang.String toString()
```
Returns a string representation of this construct.
##### `addDependency` <a name="addDependency" id="cdk8s.Chart.addDependency"></a>
```java
public void addDependency(IConstruct... dependencies)
```
Create a dependency between this Chart and other constructs.
These can be other ApiObjects, Charts, or custom.
###### `dependencies`<sup>Required</sup> <a name="dependencies" id="cdk8s.Chart.addDependency.parameter.dependencies"></a>
- *Type:* software.constructs.IConstruct...
the dependencies to add.
---
##### `generateObjectName` <a name="generateObjectName" id="cdk8s.Chart.generateObjectName"></a>
```java
public java.lang.String generateObjectName(ApiObject apiObject)
```
Generates a app-unique name for an object given it's construct node path.
Different resource types may have different constraints on names
(`metadata.name`). The previous version of the name generator was
compatible with DNS_SUBDOMAIN but not with DNS_LABEL.
For example, `Deployment` names must comply with DNS_SUBDOMAIN while
`Service` names must comply with DNS_LABEL.
Since there is no formal specification for this, the default name
generation scheme for kubernetes objects in cdk8s was changed to DNS_LABEL,
since it’s the common denominator for all kubernetes resources
(supposedly).
You can override this method if you wish to customize object names at the
chart level.
###### `apiObject`<sup>Required</sup> <a name="apiObject" id="cdk8s.Chart.generateObjectName.parameter.apiObject"></a>
- *Type:* <a href="#cdk8s.ApiObject">ApiObject</a>
The API object to generate a name for.
---
##### `toJson` <a name="toJson" id="cdk8s.Chart.toJson"></a>
```java
public java.util.List<java.lang.Object> toJson()
```
Renders this chart to a set of Kubernetes JSON resources.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.Chart.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
| <code><a href="#cdk8s.Chart.isChart">isChart</a></code> | Return whether the given object is a Chart. |
| <code><a href="#cdk8s.Chart.of">of</a></code> | Finds the chart in which a node is defined. |
---
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk8s.Chart.isConstruct"></a>
```java
import org.cdk8s.Chart;
Chart.isConstruct(java.lang.Object x)
```
Checks if `x` is a construct.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s.Chart.isConstruct.parameter.x"></a>
- *Type:* java.lang.Object
Any object.
---
##### `isChart` <a name="isChart" id="cdk8s.Chart.isChart"></a>
```java
import org.cdk8s.Chart;
Chart.isChart(java.lang.Object x)
```
Return whether the given object is a Chart.
We do attribute detection since we can't reliably use 'instanceof'.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s.Chart.isChart.parameter.x"></a>
- *Type:* java.lang.Object
---
##### `of` <a name="of" id="cdk8s.Chart.of"></a>
```java
import org.cdk8s.Chart;
Chart.of(IConstruct c)
```
Finds the chart in which a node is defined.
###### `c`<sup>Required</sup> <a name="c" id="cdk8s.Chart.of.parameter.c"></a>
- *Type:* software.constructs.IConstruct
a construct node.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.Chart.property.node">node</a></code> | <code>software.constructs.Node</code> | The tree node. |
| <code><a href="#cdk8s.Chart.property.apiObjects">apiObjects</a></code> | <code>java.util.List<<a href="#cdk8s.ApiObject">ApiObject</a>></code> | Returns all the included API objects. |
| <code><a href="#cdk8s.Chart.property.labels">labels</a></code> | <code>java.util.Map<java.lang.String, java.lang.String></code> | Labels applied to all resources in this chart. |
| <code><a href="#cdk8s.Chart.property.namespace">namespace</a></code> | <code>java.lang.String</code> | The default namespace for all objects in this chart. |
---
##### `node`<sup>Required</sup> <a name="node" id="cdk8s.Chart.property.node"></a>
```java
public Node getNode();
```
- *Type:* software.constructs.Node
The tree node.
---
##### `apiObjects`<sup>Required</sup> <a name="apiObjects" id="cdk8s.Chart.property.apiObjects"></a>
```java
public java.util.List<ApiObject> getApiObjects();
```
- *Type:* java.util.List<<a href="#cdk8s.ApiObject">ApiObject</a>>
Returns all the included API objects.
---
##### `labels`<sup>Required</sup> <a name="labels" id="cdk8s.Chart.property.labels"></a>
```java
public java.util.Map<java.lang.String, java.lang.String> getLabels();
```
- *Type:* java.util.Map<java.lang.String, java.lang.String>
Labels applied to all resources in this chart.
This is an immutable copy.
---
##### `namespace`<sup>Optional</sup> <a name="namespace" id="cdk8s.Chart.property.namespace"></a>
```java
public java.lang.String getNamespace();
```
- *Type:* java.lang.String
The default namespace for all objects in this chart.
---
### Helm <a name="Helm" id="cdk8s.Helm"></a>
Represents a Helm deployment.
Use this construct to import an existing Helm chart and incorporate it into your constructs.
#### Initializers <a name="Initializers" id="cdk8s.Helm.Initializer"></a>
```java
import org.cdk8s.Helm;
Helm.Builder.create(Construct scope, java.lang.String id)
.chart(java.lang.String)
// .helmExecutable(java.lang.String)
// .helmFlags(java.util.List<java.lang.String>)
// .namespace(java.lang.String)
// .releaseName(java.lang.String)
// .repo(java.lang.String)
// .values(java.util.Map<java.lang.String, java.lang.Object>)
// .version(java.lang.String)
.build();
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.Helm.Initializer.parameter.scope">scope</a></code> | <code>software.constructs.Construct</code> | *No description.* |
| <code><a href="#cdk8s.Helm.Initializer.parameter.id">id</a></code> | <code>java.lang.String</code> | *No description.* |
| <code><a href="#cdk8s.Helm.Initializer.parameter.chart">chart</a></code> | <code>java.lang.String</code> | The chart name to use. It can be a chart from a helm repository or a local directory. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.helmExecutable">helmExecutable</a></code> | <code>java.lang.String</code> | The local helm executable to use in order to create the manifest the chart. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.helmFlags">helmFlags</a></code> | <code>java.util.List<java.lang.String></code> | Additional flags to add to the `helm` execution. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.namespace">namespace</a></code> | <code>java.lang.String</code> | Scope all resources in to a given namespace. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.releaseName">releaseName</a></code> | <code>java.lang.String</code> | The release name. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.repo">repo</a></code> | <code>java.lang.String</code> | Chart repository url where to locate the requested chart. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.values">values</a></code> | <code>java.util.Map<java.lang.String, java.lang.Object></code> | Values to pass to the chart. |
| <code><a href="#cdk8s.Helm.Initializer.parameter.version">version</a></code> | <code>java.lang.String</code> | Version constraint for the chart version to use. |
---
##### `scope`<sup>Required</sup> <a name="scope" id="cdk8s.Helm.Initializer.parameter.scope"></a>
- *Type:* software.constructs.Construct
---
##### `id`<sup>Required</sup> <a name="id" id="cdk8s.Helm.Initializer.parameter.id"></a>
- *Type:* java.lang.String
---
##### `chart`<sup>Required</sup> <a name="chart" id="cdk8s.Helm.Initializer.parameter.chart"></a>
- *Type:* java.lang.String
The chart name to use. It can be a chart from a helm repository or a local directory.
This name is passed to `helm template` and has all the relevant semantics.
---
*Example*
```java
"bitnami/redis";
```
##### `helmExecutable`<sup>Optional</sup> <a name="helmExecutable" id="cdk8s.Helm.Initializer.parameter.helmExecutable"></a>
- *Type:* java.lang.String
- *Default:* "helm"
The local helm executable to use in order to create the manifest the chart.
---
##### `helmFlags`<sup>Optional</sup> <a name="helmFlags" id="cdk8s.Helm.Initializer.parameter.helmFlags"></a>
- *Type:* java.util.List<java.lang.String>
- *Default:* []
Additional flags to add to the `helm` execution.
---
##### `namespace`<sup>Optional</sup> <a name="namespace" id="cdk8s.Helm.Initializer.parameter.namespace"></a>
- *Type:* java.lang.String
Scope all resources in to a given namespace.
---
##### `releaseName`<sup>Optional</sup> <a name="releaseName" id="cdk8s.Helm.Initializer.parameter.releaseName"></a>
- *Type:* java.lang.String
- *Default:* if unspecified, a name will be allocated based on the construct path
The release name.
> [https://helm.sh/docs/intro/using_helm/#three-big-concepts](https://helm.sh/docs/intro/using_helm/#three-big-concepts)
---
##### `repo`<sup>Optional</sup> <a name="repo" id="cdk8s.Helm.Initializer.parameter.repo"></a>
- *Type:* java.lang.String
Chart repository url where to locate the requested chart.
---
##### `values`<sup>Optional</sup> <a name="values" id="cdk8s.Helm.Initializer.parameter.values"></a>
- *Type:* java.util.Map<java.lang.String, java.lang.Object>
- *Default:* If no values are specified, chart will use the defaults.
Values to pass to the chart.
---
##### `version`<sup>Optional</sup> <a name="version" id="cdk8s.Helm.Initializer.parameter.version"></a>
- *Type:* java.lang.String
Version constraint for the chart version to use.
This constraint can be a specific tag (e.g. 1.1.1)
or it may reference a valid range (e.g. ^2.0.0).
If this is not specified, the latest version is used
This name is passed to `helm template --version` and has all the relevant semantics.
---
*Example*
```java
"^2.0.0";
```
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.Helm.toString">toString</a></code> | Returns a string representation of this construct. |
---
##### `toString` <a name="toString" id="cdk8s.Helm.toString"></a>
```java
public java.lang.String toString()
```
Returns a string representation of this construct.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.Helm.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
---
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk8s.Helm.isConstruct"></a>
```java
import org.cdk8s.Helm;
Helm.isConstruct(java.lang.Object x)
```
Checks if `x` is a construct.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s.Helm.isConstruct.parameter.x"></a>
- *Type:* java.lang.Object
Any object.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.Helm.property.node">node</a></code> | <code>software.constructs.Node</code> | The tree node. |
| <code><a href="#cdk8s.Helm.property.apiObjects">apiObjects</a></code> | <code>java.util.List<<a href="#cdk8s.ApiObject">ApiObject</a>></code> | Returns all the included API objects. |
| <code><a href="#cdk8s.Helm.property.releaseName">releaseName</a></code> | <code>java.lang.String</code> | The helm release name. |
---
##### `node`<sup>Required</sup> <a name="node" id="cdk8s.Helm.property.node"></a>
```java
public Node getNode();
```
- *Type:* software.constructs.Node
The tree node.
---
##### `apiObjects`<sup>Required</sup> <a name="apiObjects" id="cdk8s.Helm.property.apiObjects"></a>
```java
public java.util.List<ApiObject> getApiObjects();
```
- *Type:* java.util.List<<a href="#cdk8s.ApiObject">ApiObject</a>>
Returns all the included API objects.
---
##### `releaseName`<sup>Required</sup> <a name="releaseName" id="cdk8s.Helm.property.releaseName"></a>
```java
public java.lang.String getReleaseName();
```
- *Type:* java.lang.String
The helm release name.
---
### Include <a name="Include" id="cdk8s.Include"></a>
Reads a YAML manifest from a file or a URL and defines all resources as API objects within the defined scope.
The names (`metadata.name`) of imported resources will be preserved as-is
from the manifest.
#### Initializers <a name="Initializers" id="cdk8s.Include.Initializer"></a>
```java
import org.cdk8s.Include;
Include.Builder.create(Construct scope, java.lang.String id)
.url(java.lang.String)
.build();
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.Include.Initializer.parameter.scope">scope</a></code> | <code>software.constructs.Construct</code> | *No description.* |
| <code><a href="#cdk8s.Include.Initializer.parameter.id">id</a></code> | <code>java.lang.String</code> | *No description.* |
| <code><a href="#cdk8s.Include.Initializer.parameter.url">url</a></code> | <code>java.lang.String</code> | Local file path or URL which includes a Kubernetes YAML manifest. |
---
##### `scope`<sup>Required</sup> <a name="scope" id="cdk8s.Include.Initializer.parameter.scope"></a>
- *Type:* software.constructs.Construct
---
##### `id`<sup>Required</sup> <a name="id" id="cdk8s.Include.Initializer.parameter.id"></a>
- *Type:* java.lang.String
---
##### `url`<sup>Required</sup> <a name="url" id="cdk8s.Include.Initializer.parameter.url"></a>
- *Type:* java.lang.String
Local file path or URL which includes a Kubernetes YAML manifest.
---
*Example*
```java
// Example automatically generated from non-compiling source. May contain errors.
mymanifest.getYaml();
```
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.Include.toString">toString</a></code> | Returns a string representation of this construct. |
---
##### `toString` <a name="toString" id="cdk8s.Include.toString"></a>
```java
public java.lang.String toString()
```
Returns a string representation of this construct.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s.Include.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
---
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk8s.Include.isConstruct"></a>
```java
import org.cdk8s.Include;
Include.isConstruct(java.lang.Object x)
```
Checks if `x` is a construct.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s.Include.isConstruct.parameter.x"></a>
- *Type:* java.lang.Object
Any object.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.Include.property.node">node</a></code> | <code>software.constructs.Node</code> | The tree node. |
| <code><a href="#cdk8s.Include.property.apiObjects">apiObjects</a></code> | <code>java.util.List<<a href="#cdk8s.ApiObject">ApiObject</a>></code> | Returns all the included API objects. |
---
##### `node`<sup>Required</sup> <a name="node" id="cdk8s.Include.property.node"></a>
```java
public Node getNode();
```
- *Type:* software.constructs.Node
The tree node.
---
##### `apiObjects`<sup>Required</sup> <a name="apiObjects" id="cdk8s.Include.property.apiObjects"></a>
```java
public java.util.List<ApiObject> getApiObjects();
```
- *Type:* java.util.List<<a href="#cdk8s.ApiObject">ApiObject</a>>
Returns all the included API objects.
---
## Structs <a name="Structs" id="Structs"></a>
### ApiObjectMetadata <a name="ApiObjectMetadata" id="cdk8s.ApiObjectMetadata"></a>
Metadata associated with this object.
#### Initializer <a name="Initializer" id="cdk8s.ApiObjectMetadata.Initializer"></a>
```java
import org.cdk8s.ApiObjectMetadata;
ApiObjectMetadata.builder()
// .annotations(java.util.Map<java.lang.String, java.lang.String>)
// .finalizers(java.util.List<java.lang.String>)
// .labels(java.util.Map<java.lang.String, java.lang.String>)
// .name(java.lang.String)
// .namespace(java.lang.String)
// .ownerReferences(java.util.List<OwnerReference>)
.build();
```
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.ApiObjectMetadata.property.annotations">annotations</a></code> | <code>java.util.Map<java.lang.String, java.lang.String></code> | Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. |
| <code><a href="#cdk8s.ApiObjectMetadata.property.finalizers">finalizers</a></code> | <code>java.util.List<java.lang.String></code> | Namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion. |
| <code><a href="#cdk8s.ApiObjectMetadata.property.labels">labels</a></code> | <code>java.util.Map<java.lang.String, java.lang.String></code> | Map of string keys and values that can be used to organize and categorize (scope and select) objects. |
| <code><a href="#cdk8s.ApiObjectMetadata.property.name">name</a></code> | <code>java.lang.String</code> | The unique, namespace-global, name of this object inside the Kubernetes cluster. |
| <code><a href="#cdk8s.ApiObjectMetadata.property.namespace">namespace</a></code> | <code>java.lang.String</code> | Namespace defines the space within each name must be unique. |
| <code><a href="#cdk8s.ApiObjectMetadata.property.ownerReferences">ownerReferences</a></code> | <code>java.util.List<<a href="#cdk8s.OwnerReference">OwnerReference</a>></code> | List of objects depended by this object. |
---
##### `annotations`<sup>Optional</sup> <a name="annotations" id="cdk8s.ApiObjectMetadata.property.annotations"></a>
```java
public java.util.Map<java.lang.String, java.lang.String> getAnnotations();
```
- *Type:* java.util.Map<java.lang.String, java.lang.String>
- *Default:* No annotations.
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be
preserved when modifying objects.
> [http://kubernetes.io/docs/user-guide/annotations](http://kubernetes.io/docs/user-guide/annotations)
---
##### `finalizers`<sup>Optional</sup> <a name="finalizers" id="cdk8s.ApiObjectMetadata.property.finalizers"></a>
```java
public java.util.List<java.lang.String> getFinalizers();
```
- *Type:* java.util.List<java.lang.String>
- *Default:* No finalizers.
Namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion.
Must be empty before the object is deleted from the registry. Each entry is
an identifier for the responsible component that will remove the entry from
the list. If the deletionTimestamp of the object is non-nil, entries in
this list can only be removed. Finalizers may be processed and removed in
any order. Order is NOT enforced because it introduces significant risk of
stuck finalizers. finalizers is a shared field, any actor with permission
can reorder it. If the finalizer list is processed in order, then this can
lead to a situation in which the component responsible for the first
finalizer in the list is waiting for a signal (field value, external
system, or other) produced by a component responsible for a finalizer later
in the list, resulting in a deadlock. Without enforced ordering finalizers
are free to order amongst themselves and are not vulnerable to ordering
changes in the list.
> [https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/)
---
##### `labels`<sup>Optional</sup> <a name="labels" id="cdk8s.ApiObjectMetadata.property.labels"></a>
```java
public java.util.Map<java.lang.String, java.lang.String> getLabels();
```
- *Type:* java.util.Map<java.lang.String, java.lang.String>
- *Default:* No labels.
Map of string keys and values that can be used to organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
> [http://kubernetes.io/docs/user-guide/labels](http://kubernetes.io/docs/user-guide/labels)
---
##### `name`<sup>Optional</sup> <a name="name" id="cdk8s.ApiObjectMetadata.property.name"></a>
```java
public java.lang.String getName();
```
- *Type:* java.lang.String
- *Default:* an app-unique name generated by the chart
The unique, namespace-global, name of this object inside the Kubernetes cluster.
Normally, you shouldn't specify names for objects and let the CDK generate
a name for you that is application-unique. The names CDK generates are
composed from the construct path components, separated by dots and a suffix
that is based on a hash of the entire path, to ensure uniqueness.
You can supply custom name allocation logic by overriding the
`chart.generateObjectName` method.
If you use an explicit name here, bear in mind that this reduces the
composability of your construct because it won't be possible to include
more than one instance in any app. Therefore it is highly recommended to
leave this unspecified.
---
##### `namespace`<sup>Optional</sup> <a name="namespace" id="cdk8s.ApiObjectMetadata.property.namespace"></a>
```java
public java.lang.String getNamespace();
```
- *Type:* java.lang.String
- *Default:* undefined (will be assigned to the 'default' namespace)
Namespace defines the space within each name must be unique.
An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
---
##### `ownerReferences`<sup>Optional</sup> <a name="ownerReferences" id="cdk8s.ApiObjectMetadata.property.ownerReferences"></a>
```java
public java.util.List<OwnerReference> getOwnerReferences();
```
- *Type:* java.util.List<<a href="#cdk8s.OwnerReference">OwnerReference</a>>
- *Default:* automatically set by Kubernetes
List of objects depended by this object.
If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
Kubernetes sets the value of this field automatically for objects that are
dependents of other objects like ReplicaSets, DaemonSets, Deployments, Jobs
and CronJobs, and ReplicationControllers. You can also configure these
relationships manually by changing the value of this field. However, you
usually don't need to and can allow Kubernetes to automatically manage the
relationships.
> [https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/](https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/)
---
### ApiObjectMetadataDefinitionOptions <a name="ApiObjectMetadataDefinitionOptions" id="cdk8s.ApiObjectMetadataDefinitionOptions"></a>
Options for `ApiObjectMetadataDefinition`.
#### Initializer <a name="Initializer" id="cdk8s.ApiObjectMetadataDefinitionOptions.Initializer"></a>
```java
import org.cdk8s.ApiObjectMetadataDefinitionOptions;
ApiObjectMetadataDefinitionOptions.builder()
// .annotations(java.util.Map<java.lang.String, java.lang.String>)
// .finalizers(java.util.List<java.lang.String>)
// .labels(java.util.Map<java.lang.String, java.lang.String>)
// .name(java.lang.String)
// .namespace(java.lang.String)
// .ownerReferences(java.util.List<OwnerReference>)
.apiObject(ApiObject)
.build();
```
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.annotations">annotations</a></code> | <code>java.util.Map<java.lang.String, java.lang.String></code> | Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.finalizers">finalizers</a></code> | <code>java.util.List<java.lang.String></code> | Namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion. |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.labels">labels</a></code> | <code>java.util.Map<java.lang.String, java.lang.String></code> | Map of string keys and values that can be used to organize and categorize (scope and select) objects. |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.name">name</a></code> | <code>java.lang.String</code> | The unique, namespace-global, name of this object inside the Kubernetes cluster. |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.namespace">namespace</a></code> | <code>java.lang.String</code> | Namespace defines the space within each name must be unique. |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.ownerReferences">ownerReferences</a></code> | <code>java.util.List<<a href="#cdk8s.OwnerReference">OwnerReference</a>></code> | List of objects depended by this object. |
| <code><a href="#cdk8s.ApiObjectMetadataDefinitionOptions.property.apiObject">apiObject</a></code> | <code><a href="#cdk8s.ApiObject">ApiObject</a></code> | Which ApiObject instance is the metadata attached to. |
---
##### `annotations`<sup>Optional</sup> <a name="annotations" id="cdk8s.ApiObjectMetadataDefinitionOptions.property.annotations"></a>
```java
public java.util.Map<java.lang.String, java.lang.String> getAnnotations();
```
- *Type:* java.util.Map<java.lang.String, java.lang.String>
- *Default:* No annotations.
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be
preserved when modifying objects.
> [http://kubernetes.io/docs/user-guide/annotations](http://kubernetes.io/docs/user-guide/annotations)
---
##### `finalizers`<sup>Optional</sup> <a name="finalizers" id="cdk8s.ApiObjectMetadataDefinitionOptions.property.finalizers"></a>
```java
public java.util.List<java.lang.String> getFinalizers();
```
- *Type:* java.util.List<java.lang.String>
- *Default:* No finalizers.
Namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion.
Must be empty before the object is deleted from the registry. Each entry is
an identifier for the responsible component that will remove the entry from
the list. If the deletionTimestamp of the object is non-nil, entries in
this list can only be removed. Finalizers may be processed and removed in
any order. Order is NOT enforced because it introduces significant risk of
stuck finalizers. finalizers is a shared field, any actor with permission
can reorder it. If the finalizer list is processed in order, then this can
lead to a situation in which the component responsible for the first
finalizer in the list is waiting for a signal (field value, external
system, or other) produced by a component responsible for a finalizer later
in the list, resulting in a deadlock. Without enforced ordering finalizers
are free to order amongst themselves and are not vulnerable to ordering
changes in the list.
> [https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/)
---
##### `labels`<sup>Optional</sup> <a name="labels" id="cdk8s.ApiObjectMetadataDefinitionOptions.property.labels"></a>
```java
public java.util.Map<java.lang.String, java.lang.String> getLabels();
```
- *Type:* java.util.Map<java.lang.String, java.lang.String>
- *Default:* No labels.
Map of string keys and values that can be used to organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
> [http://kubernetes.io/docs/user-guide/labels](http://kubernetes.io/docs/user-guide/labels)
---
##### `name`<sup>Optional</sup> <a name="name" id="cdk8s.ApiObjectMetadataDefinitionOptions.property.name"></a>
```java
public java.lang.String getName();
```
- *Type:* java.lang.String
- *Default:* an app-unique name generated by the chart
The unique, namespace-global, name of this object inside the Kubernetes cluster.
Normally, you shouldn't specify names for objects and let the CDK generate
a name for you that is application-unique. The names CDK generates are
composed from the construct path components, separated by dots and a suffix
that is based on a hash of the entire path, to ensure uniqueness.
You can supply custom name allocation logic by overriding the
`chart.generateObjectName` method.
I