Class KubernetesResource

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.eks.legacy.KubernetesResource
All Implemented Interfaces:
IConstruct, IDependable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.782Z") @Stability(Deprecated) @Deprecated public class KubernetesResource extends Construct
Deprecated.
(deprecated) Represents a resource within the Kubernetes system.

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);
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct

    IConstruct.Jsii$Default, IConstruct.Jsii$Proxy

    Nested classes/interfaces inherited from interface software.constructs.IConstruct

    software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Deprecated.
    protected
    KubernetesResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    Deprecated.
     
    protected
    KubernetesResource(software.amazon.jsii.JsiiObjectRef objRef)
    Deprecated.
     
  • Method Summary

    Methods inherited from class software.amazon.awscdk.core.Construct

    getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate

    Methods inherited from class software.constructs.Construct

    toString

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • RESOURCE_TYPE

      @Stability(Deprecated) @Deprecated public static final String RESOURCE_TYPE
      Deprecated.
      (deprecated) The CloudFormation reosurce type.
  • Constructor Details

    • KubernetesResource

      protected KubernetesResource(software.amazon.jsii.JsiiObjectRef objRef)
      Deprecated.
    • KubernetesResource

      protected KubernetesResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
      Deprecated.
    • KubernetesResource

      @Stability(Deprecated) @Deprecated public KubernetesResource(@NotNull Construct scope, @NotNull String id, @NotNull KubernetesResourceProps props)
      Deprecated.
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.