@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:49.200Z") @Deprecated public class KubernetesResource extends Construct
Alternatively, you can use cluster.addResource(resource[, resource, ...])
to define resources on this cluster.
Applies/deletes the resources using kubectl
in sync with the resource.
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 KubernetesResource.Builder.create(this, "hello-kub") .cluster(cluster) .manifest(List.of(deployment, service)) .build(); // or, option2: use `addResource` cluster.addResource("hello-kub", service, deployment);
Modifier and Type | Class and Description |
---|---|
static class |
KubernetesResource.Builder
Deprecated.
|
IConstruct.Jsii$Default, IConstruct.Jsii$Proxy
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RESOURCE_TYPE
Deprecated.
|
Modifier | Constructor and Description |
---|---|
|
KubernetesResource(Construct scope,
java.lang.String id,
KubernetesResourceProps props)
Deprecated.
|
protected |
KubernetesResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
Deprecated.
|
protected |
KubernetesResource(software.amazon.jsii.JsiiObjectRef objRef)
Deprecated.
|
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
@Deprecated public static final java.lang.String RESOURCE_TYPE
protected KubernetesResource(software.amazon.jsii.JsiiObjectRef objRef)
protected KubernetesResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Deprecated public KubernetesResource(Construct scope, java.lang.String id, KubernetesResourceProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.