@Generated(value="jsii-pacmak/1.71.0 (build f1f58ae)", date="2022-12-07T17:24:46.725Z") @Stability(value=Stable) public interface KubernetesManifestProps extends software.amazon.jsii.JsiiSerializable, KubernetesManifestOptions
Example:
Cluster cluster;
Map<String, String> appLabel = Map.of("app", "hello-kubernetes");
Map<String, Object> deployment = Map.of(
"apiVersion", "apps/v1",
"kind", "Deployment",
"metadata", Map.of("name", "hello-kubernetes"),
"spec", Map.of(
"replicas", 3,
"selector", Map.of("matchLabels", appLabel),
"template", Map.of(
"metadata", Map.of("labels", appLabel),
"spec", Map.of(
"containers", List.of(Map.of(
"name", "hello-kubernetes",
"image", "paulbouwer/hello-kubernetes:1.5",
"ports", List.of(Map.of("containerPort", 8080))))))));
Map<String, Object> service = Map.of(
"apiVersion", "v1",
"kind", "Service",
"metadata", Map.of("name", "hello-kubernetes"),
"spec", Map.of(
"type", "LoadBalancer",
"ports", List.of(Map.of("port", 80, "targetPort", 8080)),
"selector", appLabel));
// option 1: use a construct
// option 1: use a construct
KubernetesManifest.Builder.create(this, "hello-kub")
.cluster(cluster)
.manifest(List.of(deployment, service))
.build();
// or, option2: use `addManifest`
cluster.addManifest("hello-kub", service, deployment);
| Modifier and Type | Interface and Description |
|---|---|
static class |
KubernetesManifestProps.Builder
A builder for
KubernetesManifestProps |
static class |
KubernetesManifestProps.Jsii$Proxy
An implementation for
KubernetesManifestProps |
| Modifier and Type | Method and Description |
|---|---|
static KubernetesManifestProps.Builder |
builder() |
ICluster |
getCluster()
The EKS cluster to apply this manifest to.
|
List<Map<String,Object>> |
getManifest()
The manifest to apply.
|
default Boolean |
getOverwrite()
Overwrite any existing resources.
|
getIngressAlb, getIngressAlbScheme, getPrune, getSkipValidation@Stability(value=Stable) @NotNull ICluster getCluster()
[disable-awslint:ref-via-interface]
@Stability(value=Stable) @NotNull List<Map<String,Object>> getManifest()
Consists of any number of child resources.
When the resources are created/updated, this manifest will be applied to the
cluster through kubectl apply and when the resources or the stack is
deleted, the resources in the manifest will be deleted through kubectl delete.
Example:
List.of(Map.of(
"apiVersion", "v1",
"kind", "Pod",
"metadata", Map.of("name", "mypod"),
"spec", Map.of(
"containers", List.of(Map.of("name", "hello", "image", "paulbouwer/hello-kubernetes:1.5", "ports", List.of(Map.of("containerPort", 8080)))))));
@Stability(value=Stable) @Nullable default Boolean getOverwrite()
If this is set, we will use kubectl apply instead of kubectl create
when the resource is created. Otherwise, if there is already a resource
in the cluster with the same name, the operation will fail.
Default: false
@Stability(value=Stable) static KubernetesManifestProps.Builder builder()
builder in interface KubernetesManifestOptionsKubernetesManifestProps.Builder of KubernetesManifestPropsCopyright © 2022. All rights reserved.