Interface KubernetesManifestProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,KubernetesManifestOptions
- All Known Implementing Classes:
KubernetesManifestProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:46.638Z")
@Stability(Stable)
public interface KubernetesManifestProps
extends software.amazon.jsii.JsiiSerializable, KubernetesManifestOptions
Properties for KubernetesManifest.
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);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forKubernetesManifestPropsstatic final classAn implementation forKubernetesManifestProps -
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.eks.KubernetesManifestOptions
getIngressAlb, getIngressAlbScheme, getPrune, getSkipValidation
-
Method Details
-
getCluster
The EKS cluster to apply this manifest to.[disable-awslint:ref-via-interface]
-
getManifest
The manifest to apply.Consists of any number of child resources.
When the resources are created/updated, this manifest will be applied to the cluster through
kubectl applyand when the resources or the stack is deleted, the resources in the manifest will be deleted throughkubectl 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))))))); -
getOverwrite
Overwrite any existing resources.If this is set, we will use
kubectl applyinstead ofkubectl createwhen the resource is created. Otherwise, if there is already a resource in the cluster with the same name, the operation will fail.Default: false
-
builder
- Returns:
- a
KubernetesManifestProps.BuilderofKubernetesManifestProps
-