cdk8s (TypeScript) ¶
Constructs ¶
ApiObject ¶
Initializers ¶
import { ApiObject } from 'cdk8s'
new ApiObject(scope: Construct, id: string, props: ApiObjectProps)
scope
Required ¶
- Type:
constructs.Construct
the construct scope.
id
Required ¶
- Type:
string
namespace.
props
Required ¶
- Type:
cdk8s.ApiObjectProps
options.
Methods ¶
addDependency
¶
public addDependency(dependencies: IConstruct)
dependencies
Required ¶
- Type:
constructs.IConstruct
the dependencies to add.
addJsonPatch
¶
public addJsonPatch(ops: JsonPatch)
ops
Required ¶
- Type:
cdk8s.JsonPatch
The JSON-Patch operations to apply.
toJson
¶
public toJson()
Static Functions ¶
isApiObject
¶
import { ApiObject } from 'cdk8s'
ApiObject.isApiObject(o: any)
o
Required ¶
- Type:
any
The object to check.
of
¶
import { ApiObject } from 'cdk8s'
ApiObject.of(c: IConstruct)
c
Required ¶
- Type:
constructs.IConstruct
The higher-level construct.
Properties ¶
apiGroup
Required ¶
public readonly apiGroup: string;
- Type:
string
The group portion of the API version (e.g. authorization.k8s.io
).
apiVersion
Required ¶
public readonly apiVersion: string;
- Type:
string
The object’s API version (e.g. authorization.k8s.io/v1
).
chart
Required ¶
public readonly chart: Chart;
- Type:
cdk8s.Chart
The chart in which this object is defined.
kind
Required ¶
public readonly kind: string;
- Type:
string
The object kind.
metadata
Required ¶
public readonly metadata: ApiObjectMetadataDefinition;
Metadata associated with this API object.
name
Required ¶
public readonly name: string;
- Type:
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 ¶
Represents a cdk8s application.
Initializers ¶
import { App } from 'cdk8s'
new App(props?: AppProps)
props
Optional ¶
- Type:
cdk8s.AppProps
configuration options.
Methods ¶
synth
¶
public synth()
synthYaml
¶
public synthYaml()
Properties ¶
charts
Required ¶
public readonly charts: Chart[];
- Type:
cdk8s.Chart
[]
Returns all the charts in this app, sorted topologically.
outdir
Required ¶
public readonly outdir: string;
- Type:
string
The output directory into which manifests will be synthesized.
outputFileExtension
Required ¶
public readonly outputFileExtension: string;
- Type:
string
- Default: .k8s.yaml
The file extension to use for rendered YAML files.
yamlOutputType
Required ¶
public readonly yamlOutputType: YamlOutputType;
- Type:
cdk8s.YamlOutputType
- Default: YamlOutputType.FILE_PER_CHART
How to divide the YAML output into files.
Chart ¶
Initializers ¶
import { Chart } from 'cdk8s'
new Chart(scope: Construct, id: string, props?: ChartProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Optional ¶
- Type:
cdk8s.ChartProps
Methods ¶
addDependency
¶
public addDependency(dependencies: IConstruct)
dependencies
Required ¶
- Type:
constructs.IConstruct
the dependencies to add.
generateObjectName
¶
public generateObjectName(apiObject: ApiObject)
apiObject
Required ¶
- Type:
cdk8s.ApiObject
The API object to generate a name for.
toJson
¶
public toJson()
Static Functions ¶
isChart
¶
import { Chart } from 'cdk8s'
Chart.isChart(x: any)
x
Required ¶
- Type:
any
of
¶
import { Chart } from 'cdk8s'
Chart.of(c: IConstruct)
c
Required ¶
- Type:
constructs.IConstruct
a construct node.
Properties ¶
labels
Required ¶
public readonly labels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
}
Labels applied to all resources in this chart.
This is an immutable copy.
namespace
Optional ¶
public readonly namespace: string;
- Type:
string
The default namespace for all objects in this chart.
Helm ¶
Represents a Helm deployment.
Use this construct to import an existing Helm chart and incorporate it into your constructs.
Initializers ¶
import { Helm } from 'cdk8s'
new Helm(scope: Construct, id: string, props: HelmProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
- Type:
cdk8s.HelmProps
Properties ¶
releaseName
Required ¶
public readonly releaseName: string;
- Type:
string
The helm release name.
Include ¶
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 ¶
import { Include } from 'cdk8s'
new Include(scope: Construct, id: string, props: IncludeProps)
scope
Required ¶
- Type:
constructs.Construct
id
Required ¶
- Type:
string
props
Required ¶
- Type:
cdk8s.IncludeProps
Properties ¶
apiObjects
Required ¶
public readonly apiObjects: ApiObject[];
- Type:
cdk8s.ApiObject
[]
Returns all the included API objects.
Structs ¶
ApiObjectMetadata ¶
Metadata associated with this object.
Initializer ¶
import { ApiObjectMetadata } from 'cdk8s'
const apiObjectMetadata: ApiObjectMetadata = { ... }
annotations
Optional ¶
public readonly annotations: {[ key: string ]: string};
- Type: {[ key: string ]:
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
finalizers
Optional ¶
public readonly finalizers: string[];
- Type:
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/
labels
Optional ¶
public readonly labels: {[ key: string ]: string};
- Type: {[ key: string ]:
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
name
Optional ¶
public readonly name: string;
- Type:
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
Optional ¶
public readonly namespace: string;
- Type:
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
Optional ¶
public readonly ownerReferences: OwnerReference[];
- Type:
cdk8s.OwnerReference
[] - 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/
ApiObjectProps ¶
Options for defining API objects.
Initializer ¶
import { ApiObjectProps } from 'cdk8s'
const apiObjectProps: ApiObjectProps = { ... }
apiVersion
Required ¶
public readonly apiVersion: string;
- Type:
string
API version.
kind
Required ¶
public readonly kind: string;
- Type:
string
Resource kind.
metadata
Optional ¶
public readonly metadata: ApiObjectMetadata;
- Type:
cdk8s.ApiObjectMetadata
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.
AppProps ¶
Initializer ¶
import { AppProps } from 'cdk8s'
const appProps: AppProps = { ... }
outdir
Optional ¶
public readonly outdir: string;
- Type:
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
Optional ¶
public readonly outputFileExtension: string;
- Type:
string
- Default: .k8s.yaml
The file extension to use for rendered YAML files.
recordConstructMetadata
Optional ¶
public readonly recordConstructMetadata: boolean;
- Type:
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.
yamlOutputType
Optional ¶
public readonly yamlOutputType: YamlOutputType;
- Type:
cdk8s.YamlOutputType
- Default: YamlOutputType.FILE_PER_CHART
How to divide the YAML output into files.
ChartProps ¶
Initializer ¶
import { ChartProps } from 'cdk8s'
const chartProps: ChartProps = { ... }
disableResourceNameHashes
Optional ¶
public readonly disableResourceNameHashes: boolean;
- Type:
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
Optional ¶
public readonly labels: {[ key: string ]: string};
- Type: {[ key: string ]:
string
} - Default: no common labels
Labels to apply to all resources in this chart.
namespace
Optional ¶
public readonly namespace: string;
- Type:
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.
CronOptions ¶
Options to configure a cron expression.
All fields are strings so you can use complex expressions. Absence of a field implies ‘*’
Initializer ¶
import { CronOptions } from 'cdk8s'
const cronOptions: CronOptions = { ... }
day
Optional ¶
public readonly day: string;
- Type:
string
- Default: Every day of the month
The day of the month to run this rule at.
hour
Optional ¶
public readonly hour: string;
- Type:
string
- Default: Every hour
The hour to run this rule at.
minute
Optional ¶
public readonly minute: string;
- Type:
string
- Default: Every minute
The minute to run this rule at.
month
Optional ¶
public readonly month: string;
- Type:
string
- Default: Every month
The month to run this rule at.
weekDay
Optional ¶
public readonly weekDay: string;
- Type:
string
- Default: Any day of the week
The day of the week to run this rule at.
GroupVersionKind ¶
Initializer ¶
import { GroupVersionKind } from 'cdk8s'
const groupVersionKind: GroupVersionKind = { ... }
apiVersion
Required ¶
public readonly apiVersion: string;
- Type:
string
The object’s API version (e.g. authorization.k8s.io/v1
).
kind
Required ¶
public readonly kind: string;
- Type:
string
The object kind.
HelmProps ¶
Options for Helm
.
Initializer ¶
import { HelmProps } from 'cdk8s'
const helmProps: HelmProps = { ... }
chart
Required ¶
public readonly chart: string;
- Type:
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.
helmExecutable
Optional ¶
public readonly helmExecutable: string;
- Type:
string
- Default: “helm”
The local helm executable to use in order to create the manifest the chart.
helmFlags
Optional ¶
public readonly helmFlags: string[];
- Type:
string
[] - Default: []
Additional flags to add to the helm
execution.
namespace
Optional ¶
public readonly namespace: string;
- Type:
string
Scope all resources in to a given namespace.
releaseName
Optional ¶
public readonly releaseName: string;
- Type:
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
repo
Optional ¶
public readonly repo: string;
- Type:
string
Chart repository url where to locate the requested chart.
values
Optional ¶
public readonly values: {[ key: string ]: any};
- Type: {[ key: string ]:
any
} - Default: If no values are specified, chart will use the defaults.
Values to pass to the chart.
version
Optional ¶
public readonly version: string;
- Type:
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.
IncludeProps ¶
Initializer ¶
import { IncludeProps } from 'cdk8s'
const includeProps: IncludeProps = { ... }
url
Required ¶
public readonly url: string;
- Type:
string
Local file path or URL which includes a Kubernetes YAML manifest.
NameOptions ¶
Options for name generation.
Initializer ¶
import { NameOptions } from 'cdk8s'
const nameOptions: NameOptions = { ... }
delimiter
Optional ¶
public readonly delimiter: string;
- Type:
string
- Default: “-“
Delimiter to use between components.
extra
Optional ¶
public readonly extra: string[];
- Type:
string
[] - Default: [] use the construct path components
Extra components to include in the name.
includeHash
Optional ¶
public readonly includeHash: boolean;
- Type:
boolean
- Default: true
Include a short hash as last part of the name.
maxLen
Optional ¶
public readonly maxLen: number;
- Type:
number
- Default: 63
Maximum allowed length for the name.
OwnerReference ¶
OwnerReference contains enough information to let you identify an owning object.
An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.
Initializer ¶
import { OwnerReference } from 'cdk8s'
const ownerReference: OwnerReference = { ... }
apiVersion
Required ¶
public readonly apiVersion: string;
- Type:
string
API version of the referent.
kind
Required ¶
public readonly kind: string;
- Type:
string
Kind of the referent.
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
name
Required ¶
public readonly name: string;
- Type:
string
Name of the referent.
http://kubernetes.io/docs/user-guide/identifiers#names
uid
Required ¶
public readonly uid: string;
- Type:
string
UID of the referent.
http://kubernetes.io/docs/user-guide/identifiers#uids
blockOwnerDeletion
Optional ¶
public readonly blockOwnerDeletion: boolean;
- Type:
boolean
- Default: false. To set this field, a user needs “delete” permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.
If true, AND if the owner has the “foregroundDeletion” finalizer, then the owner cannot be deleted from the key-value store until this reference is removed.
Defaults to false. To set this field, a user needs “delete” permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.
controller
Optional ¶
public readonly controller: boolean;
- Type:
boolean
If true, this reference points to the managing controller.
SizeConversionOptions ¶
Options for how to convert time to a different unit.
Initializer ¶
import { SizeConversionOptions } from 'cdk8s'
const sizeConversionOptions: SizeConversionOptions = { ... }
rounding
Optional ¶
public readonly rounding: SizeRoundingBehavior;
- Type:
cdk8s.SizeRoundingBehavior
- Default: SizeRoundingBehavior.FAIL
How conversions should behave when it encounters a non-integer result.
TimeConversionOptions ¶
Options for how to convert time to a different unit.
Initializer ¶
import { TimeConversionOptions } from 'cdk8s'
const timeConversionOptions: TimeConversionOptions = { ... }
integral
Optional ¶
public readonly integral: boolean;
- Type:
boolean
- Default: true
If true
, conversions into a larger time unit (e.g. Seconds
to Minutes
) will fail if the result is not an integer.
Classes ¶
ApiObjectMetadataDefinition ¶
Object metadata.
Initializers ¶
import { ApiObjectMetadataDefinition } from 'cdk8s'
new ApiObjectMetadataDefinition(options?: ApiObjectMetadata)
options
Optional ¶
- Type:
cdk8s.ApiObjectMetadata
Methods ¶
add
¶
public add(key: string, value: any)
key
Required ¶
- Type:
string
Metadata key.
value
Required ¶
- Type:
any
Metadata value.
addAnnotation
¶
public addAnnotation(key: string, value: string)
key
Required ¶
- Type:
string
The key.
value
Required ¶
- Type:
string
The value.
addFinalizers
¶
public addFinalizers(finalizers: string)
finalizers
Required ¶
- Type:
string
the finalizers.
addLabel
¶
public addLabel(key: string, value: string)
key
Required ¶
- Type:
string
The key.
value
Required ¶
- Type:
string
The value.
addOwnerReference
¶
public addOwnerReference(owner: OwnerReference)
owner
Required ¶
- Type:
cdk8s.OwnerReference
the owner.
getLabel
¶
public getLabel(key: string)
key
Required ¶
- Type:
string
the label.
toJson
¶
public toJson()
Properties ¶
name
Optional ¶
public readonly name: string;
- Type:
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.
namespace
Optional ¶
public readonly namespace: string;
- Type:
string
The object’s namespace.
Cron ¶
Represents a cron schedule.
Initializers ¶
import { Cron } from 'cdk8s'
new Cron(cronOptions?: CronOptions)
cronOptions
Optional ¶
- Type:
cdk8s.CronOptions
Static Functions ¶
annually
¶
import { Cron } from 'cdk8s'
Cron.annually()
daily
¶
import { Cron } from 'cdk8s'
Cron.daily()
everyMinute
¶
import { Cron } from 'cdk8s'
Cron.everyMinute()
hourly
¶
import { Cron } from 'cdk8s'
Cron.hourly()
monthly
¶
import { Cron } from 'cdk8s'
Cron.monthly()
schedule
¶
import { Cron } from 'cdk8s'
Cron.schedule(options: CronOptions)
options
Required ¶
- Type:
cdk8s.CronOptions
weekly
¶
import { Cron } from 'cdk8s'
Cron.weekly()
Properties ¶
expressionString
Required ¶
public readonly expressionString: string;
- Type:
string
Retrieve the expression for this schedule.
DependencyGraph ¶
Represents the dependency graph for a given Node.
This graph includes the dependency relationships between all nodes in the node (construct) sub-tree who’s root is this Node.
Note that this means that lonely nodes (no dependencies and no dependants) are also included in this graph as childless children of the root node of the graph.
The graph does not include cross-scope dependencies. That is, if a child on the current scope depends on a node from a different scope, that relationship is not represented in this graph.
Initializers ¶
import { DependencyGraph } from 'cdk8s'
new DependencyGraph(node: Node)
node
Required ¶
- Type:
constructs.Node
Methods ¶
topology
¶
public topology()
Properties ¶
root
Required ¶
public readonly root: DependencyVertex;
- Type:
cdk8s.DependencyVertex
Returns the root of the graph.
Note that this vertex will always have null
as its .value
since it is an artifical root
that binds all the connected spaces of the graph.
DependencyVertex ¶
Represents a vertex in the graph.
The value of each vertex is an IConstruct
that is accessible via the .value
getter.
Initializers ¶
import { DependencyVertex } from 'cdk8s'
new DependencyVertex(value?: IConstruct)
value
Optional ¶
- Type:
constructs.IConstruct
Methods ¶
addChild
¶
public addChild(dep: DependencyVertex)
dep
Required ¶
- Type:
cdk8s.DependencyVertex
The dependency.
topology
¶
public topology()
Properties ¶
inbound
Required ¶
public readonly inbound: DependencyVertex[];
- Type:
cdk8s.DependencyVertex
[]
Returns the parents of the vertex (i.e dependants).
outbound
Required ¶
public readonly outbound: DependencyVertex[];
- Type:
cdk8s.DependencyVertex
[]
Returns the children of the vertex (i.e dependencies).
value
Optional ¶
public readonly value: IConstruct;
- Type:
constructs.IConstruct
Returns the IConstruct this graph vertex represents.
null
in case this is the root of the graph.
Duration ¶
Represents a length of time.
The amount can be specified either as a literal value (e.g: 10
) which
cannot be negative.
Methods ¶
toDays
¶
public toDays(opts?: TimeConversionOptions)
opts
Optional ¶
toHours
¶
public toHours(opts?: TimeConversionOptions)
opts
Optional ¶
toHumanString
¶
public toHumanString()
toIsoString
¶
public toIsoString()
toMilliseconds
¶
public toMilliseconds(opts?: TimeConversionOptions)
opts
Optional ¶
toMinutes
¶
public toMinutes(opts?: TimeConversionOptions)
opts
Optional ¶
toSeconds
¶
public toSeconds(opts?: TimeConversionOptions)
opts
Optional ¶
unitLabel
¶
public unitLabel()
Static Functions ¶
days
¶
import { Duration } from 'cdk8s'
Duration.days(amount: number)
amount
Required ¶
- Type:
number
the amount of Days the Duration
will represent.
hours
¶
import { Duration } from 'cdk8s'
Duration.hours(amount: number)
amount
Required ¶
- Type:
number
the amount of Hours the Duration
will represent.
millis
¶
import { Duration } from 'cdk8s'
Duration.millis(amount: number)
amount
Required ¶
- Type:
number
the amount of Milliseconds the Duration
will represent.
minutes
¶
import { Duration } from 'cdk8s'
Duration.minutes(amount: number)
amount
Required ¶
- Type:
number
the amount of Minutes the Duration
will represent.
parse
¶
import { Duration } from 'cdk8s'
Duration.parse(duration: string)
duration
Required ¶
- Type:
string
an ISO-formtted duration to be parsed.
seconds
¶
import { Duration } from 'cdk8s'
Duration.seconds(amount: number)
amount
Required ¶
- Type:
number
the amount of Seconds the Duration
will represent.
JsonPatch ¶
Utility for applying RFC-6902 JSON-Patch to a document.
Use the the JsonPatch.apply(doc, ...ops)
function to apply a set of
operations to a JSON document and return the result.
Operations can be created using the factory methods JsonPatch.add()
,
JsonPatch.remove()
, etc.
Static Functions ¶
add
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.add(path: string, value: any)
path
Required ¶
- Type:
string
value
Required ¶
- Type:
any
apply
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.apply(document: any, ops: JsonPatch)
document
Required ¶
- Type:
any
The document to patch.
ops
Required ¶
- Type:
cdk8s.JsonPatch
The operations to apply.
copy
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.copy(from: string, path: string)
from
Required ¶
- Type:
string
path
Required ¶
- Type:
string
move
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.move(from: string, path: string)
from
Required ¶
- Type:
string
path
Required ¶
- Type:
string
remove
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.remove(path: string)
path
Required ¶
- Type:
string
replace
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.replace(path: string, value: any)
path
Required ¶
- Type:
string
value
Required ¶
- Type:
any
test
¶
import { JsonPatch } from 'cdk8s'
JsonPatch.test(path: string, value: any)
path
Required ¶
- Type:
string
value
Required ¶
- Type:
any
Lazy ¶
Methods ¶
produce
¶
public produce()
Static Functions ¶
any
¶
import { Lazy } from 'cdk8s'
Lazy.any(producer: IAnyProducer)
producer
Required ¶
- Type:
cdk8s.IAnyProducer
Names ¶
Utilities for generating unique and stable names.
Static Functions ¶
toDnsLabel
¶
import { Names } from 'cdk8s'
Names.toDnsLabel(scope: Construct, options?: NameOptions)
scope
Required ¶
- Type:
constructs.Construct
The construct for which to render the DNS label.
options
Optional ¶
- Type:
cdk8s.NameOptions
Name options.
toLabelValue
¶
import { Names } from 'cdk8s'
Names.toLabelValue(scope: Construct, options?: NameOptions)
scope
Required ¶
- Type:
constructs.Construct
The construct for which to render the DNS label.
options
Optional ¶
- Type:
cdk8s.NameOptions
Name options.
Size ¶
Represents the amount of digital storage.
The amount can be specified either as a literal value (e.g: 10
) which
cannot be negative.
When the amount is passed as a token, unit conversion is not possible.
Methods ¶
toGibibytes
¶
public toGibibytes(opts?: SizeConversionOptions)
opts
Optional ¶
toKibibytes
¶
public toKibibytes(opts?: SizeConversionOptions)
opts
Optional ¶
toMebibytes
¶
public toMebibytes(opts?: SizeConversionOptions)
opts
Optional ¶
toPebibytes
¶
public toPebibytes(opts?: SizeConversionOptions)
opts
Optional ¶
toTebibytes
¶
public toTebibytes(opts?: SizeConversionOptions)
opts
Optional ¶
Static Functions ¶
gibibytes
¶
import { Size } from 'cdk8s'
Size.gibibytes(amount: number)
amount
Required ¶
- Type:
number
kibibytes
¶
import { Size } from 'cdk8s'
Size.kibibytes(amount: number)
amount
Required ¶
- Type:
number
mebibytes
¶
import { Size } from 'cdk8s'
Size.mebibytes(amount: number)
amount
Required ¶
- Type:
number
pebibyte
¶
import { Size } from 'cdk8s'
Size.pebibyte(amount: number)
amount
Required ¶
- Type:
number
tebibytes
¶
import { Size } from 'cdk8s'
Size.tebibytes(amount: number)
amount
Required ¶
- Type:
number
Testing ¶
Testing utilities for cdk8s applications.
Static Functions ¶
app
¶
import { Testing } from 'cdk8s'
Testing.app(props?: AppProps)
props
Optional ¶
- Type:
cdk8s.AppProps
chart
¶
import { Testing } from 'cdk8s'
Testing.chart()
synth
¶
import { Testing } from 'cdk8s'
Testing.synth(chart: Chart)
chart
Required ¶
- Type:
cdk8s.Chart
Yaml ¶
YAML utilities.
Static Functions ¶
~~formatObjects
~~ ¶
import { Yaml } from 'cdk8s'
Yaml.formatObjects(docs: any[])
docs
Required ¶
- Type:
any
[]
load
¶
import { Yaml } from 'cdk8s'
Yaml.load(urlOrFile: string)
urlOrFile
Required ¶
- Type:
string
a URL of a file path to load from.
save
¶
import { Yaml } from 'cdk8s'
Yaml.save(filePath: string, docs: any[])
filePath
Required ¶
- Type:
string
The output path.
docs
Required ¶
- Type:
any
[]
The set of objects.
stringify
¶
import { Yaml } from 'cdk8s'
Yaml.stringify(docs: any)
docs
Required ¶
- Type:
any
A set of objects to convert to YAML.
tmp
¶
import { Yaml } from 'cdk8s'
Yaml.tmp(docs: any[])
docs
Required ¶
- Type:
any
[]
the set of documents to save.
Protocols ¶
IAnyProducer ¶
- Implemented By:
cdk8s.IAnyProducer
Methods ¶
produce
¶
public produce()
Enums ¶
SizeRoundingBehavior ¶
Rounding behaviour when converting between units of Size
.
FAIL
¶
Fail the conversion if the result is not an integer.
FLOOR
¶
If the result is not an integer, round it to the closest integer less than the result.
NONE
¶
Don’t round.
Return even if the result is a fraction.
YamlOutputType ¶
The method to divide YAML output into files.
FILE_PER_APP
¶
All resources are output into a single YAML file.
FILE_PER_CHART
¶
Resources are split into seperate files by chart.
FILE_PER_RESOURCE
¶
Each resource is output to its own file.
FOLDER_PER_CHART_FILE_PER_RESOURCE
¶
Each chart in its own folder and each resource in its own file.