Class: AWSCDK::EKS::KubernetesManifestProps
- Inherits:
-
KubernetesManifestOptions
- Object
- KubernetesManifestOptions
- AWSCDK::EKS::KubernetesManifestProps
- Defined in:
- eks/kubernetes_manifest_props.rb
Overview
Properties for KubernetesManifest.
Instance Attribute Summary collapse
-
#cluster ⇒ AWSCDK::EKS::ICluster
readonly
The EKS cluster to apply this manifest to.
-
#ingress_alb ⇒ Boolean?
readonly
Automatically detect
Ingressresources in the manifest and annotate them so they are picked up by an ALB Ingress Controller. -
#ingress_alb_scheme ⇒ AWSCDK::EKS::ALBScheme?
readonly
Specify the ALB scheme that should be applied to
Ingressresources. -
#manifest ⇒ Array<Hash{String => Object}>
readonly
The manifest to apply.
-
#overwrite ⇒ Boolean?
readonly
Overwrite any existing resources.
-
#prune ⇒ Boolean?
readonly
When a resource is removed from a Kubernetes manifest, it no longer appears in the manifest, and there is no way to know that this resource needs to be deleted.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removal policy applied to the custom resource that manages the Kubernetes manifest.
-
#skip_validation ⇒ Boolean?
readonly
A flag to signify if the manifest validation should be skipped.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ingress_alb: nil, ingress_alb_scheme: nil, prune: nil, removal_policy: nil, skip_validation: nil, cluster:, manifest:, overwrite: nil) ⇒ KubernetesManifestProps
constructor
A new instance of KubernetesManifestProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(ingress_alb: nil, ingress_alb_scheme: nil, prune: nil, removal_policy: nil, skip_validation: nil, cluster:, manifest:, overwrite: nil) ⇒ KubernetesManifestProps
Returns a new instance of KubernetesManifestProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'eks/kubernetes_manifest_props.rb', line 15 def initialize(ingress_alb: nil, ingress_alb_scheme: nil, prune: nil, removal_policy: nil, skip_validation: nil, cluster:, manifest:, overwrite: nil) @ingress_alb = ingress_alb Jsii::Type.check_type(@ingress_alb, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ingressAlb") unless @ingress_alb.nil? @ingress_alb_scheme = ingress_alb_scheme Jsii::Type.check_type(@ingress_alb_scheme, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkFsYlNjaGVtZSJ9")), "ingressAlbScheme") unless @ingress_alb_scheme.nil? @prune = prune Jsii::Type.check_type(@prune, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "prune") unless @prune.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @skip_validation = skip_validation Jsii::Type.check_type(@skip_validation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "skipValidation") unless @skip_validation.nil? @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklDbHVzdGVyIn0=")), "cluster") @manifest = manifest Jsii::Type.check_type(@manifest, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoiYW55In0sImtpbmQiOiJtYXAifX0sImtpbmQiOiJhcnJheSJ9fQ==")), "manifest") @overwrite = overwrite Jsii::Type.check_type(@overwrite, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "overwrite") unless @overwrite.nil? end |
Instance Attribute Details
#cluster ⇒ AWSCDK::EKS::ICluster (readonly)
The EKS cluster to apply this manifest to.
[disable-awslint:ref-via-interface]
88 89 90 |
# File 'eks/kubernetes_manifest_props.rb', line 88 def cluster @cluster end |
#ingress_alb ⇒ Boolean? (readonly)
Default: false
Automatically detect Ingress resources in the manifest and annotate them so they are picked up by an ALB Ingress Controller.
38 39 40 |
# File 'eks/kubernetes_manifest_props.rb', line 38 def ingress_alb @ingress_alb end |
#ingress_alb_scheme ⇒ AWSCDK::EKS::ALBScheme? (readonly)
Default: AlbScheme.INTERNAL
Specify the ALB scheme that should be applied to Ingress resources.
Only applicable if ingress_alb is set to true.
45 46 47 |
# File 'eks/kubernetes_manifest_props.rb', line 45 def ingress_alb_scheme @ingress_alb_scheme end |
#manifest ⇒ Array<Hash{String => Object}> (readonly)
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 apply and when the resources or the stack is
deleted, the resources in the manifest will be deleted through kubectl delete.
109 110 111 |
# File 'eks/kubernetes_manifest_props.rb', line 109 def manifest @manifest end |
#overwrite ⇒ Boolean? (readonly)
Default: false
Overwrite any existing resources.
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.
118 119 120 |
# File 'eks/kubernetes_manifest_props.rb', line 118 def overwrite @overwrite end |
#prune ⇒ Boolean? (readonly)
Default: - based on the prune option of the cluster, which is true unless otherwise specified.
When a resource is removed from a Kubernetes manifest, it no longer appears in the manifest, and there is no way to know that this resource needs to be deleted.
To address this, kubectl apply has a --prune option which will
query the cluster for all resources with a specific label and will remove
all the labeld resources that are not part of the applied manifest. If this
option is disabled and a resource is removed, it will become "orphaned" and
will not be deleted from the cluster.
When this option is enabled (default), the construct will inject a label to
all Kubernetes resources included in this manifest which will be used to
prune resources when the manifest changes via kubectl apply --prune.
The label name will be aws.cdk.eks/prune-<ADDR> where <ADDR> is the
42-char unique address of this construct in the construct tree. Value is
empty.
65 66 67 |
# File 'eks/kubernetes_manifest_props.rb', line 65 def prune @prune end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
The removal policy applied to the custom resource that manages the Kubernetes manifest.
The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:
- The resource is removed from the template, so CloudFormation stops managing it
- A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
- The stack is deleted, so CloudFormation stops managing all resources in it
77 78 79 |
# File 'eks/kubernetes_manifest_props.rb', line 77 def removal_policy @removal_policy end |
#skip_validation ⇒ Boolean? (readonly)
Default: false
A flag to signify if the manifest validation should be skipped.
82 83 84 |
# File 'eks/kubernetes_manifest_props.rb', line 82 def skip_validation @skip_validation end |
Class Method Details
.jsii_properties ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'eks/kubernetes_manifest_props.rb', line 120 def self.jsii_properties { :ingress_alb => "ingressAlb", :ingress_alb_scheme => "ingressAlbScheme", :prune => "prune", :removal_policy => "removalPolicy", :skip_validation => "skipValidation", :cluster => "cluster", :manifest => "manifest", :overwrite => "overwrite", } end |
Instance Method Details
#to_jsii ⇒ Object
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'eks/kubernetes_manifest_props.rb', line 133 def to_jsii result = {} result.merge!(super) result.merge!({ "ingressAlb" => @ingress_alb, "ingressAlbScheme" => @ingress_alb_scheme, "prune" => @prune, "removalPolicy" => @removal_policy, "skipValidation" => @skip_validation, "cluster" => @cluster, "manifest" => @manifest, "overwrite" => @overwrite, }) result.compact end |