Class: AWSCDK::EKS::FargateProfile

Inherits:
Constructs::Construct
  • Object
show all
Includes:
ITaggable
Defined in:
eks/fargate_profile.rb

Overview

Fargate profiles allows an administrator to declare which pods run on Fargate.

This declaration is done through the profile’s selectors. Each profile can have up to five selectors that contain a namespace and optional labels. You must define a namespace for every selector. The label field consists of multiple optional key-value pairs. Pods that match a selector (by matching a namespace for the selector and all of the labels specified in the selector) are scheduled on Fargate. If a namespace selector is defined without any labels, Amazon EKS will attempt to schedule all pods that run in that namespace onto Fargate using the profile. If a to-be-scheduled pod matches any of the selectors in the Fargate profile, then that pod is scheduled on Fargate.

If a pod matches multiple Fargate profiles, Amazon EKS picks one of the matches at random. In this case, you can specify which profile a pod should use by adding the following Kubernetes label to the pod specification: eks.amazonaws.com/fargate-profile: profile_name. However, the pod must still match a selector in that profile in order to be scheduled onto Fargate.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ FargateProfile

Returns a new instance of FargateProfile.

Parameters:



29
30
31
32
33
34
35
# File 'eks/fargate_profile.rb', line 29

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::EKS::FargateProfileProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkZhcmdhdGVQcm9maWxlUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



37
38
39
40
41
42
43
44
45
46
47
# File 'eks/fargate_profile.rb', line 37

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :fargate_profile_arn => { kind: :property, name: "fargateProfileArn", is_optional: false },
    :fargate_profile_name => { kind: :property, name: "fargateProfileName", is_optional: false },
    :pod_execution_role => { kind: :property, name: "podExecutionRole", is_optional: false },
    :tags => { kind: :property, name: "tags", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
  }
end

Instance Method Details

#fargate_profile_arnString

The full Amazon Resource Name (ARN) of the Fargate profile.

Returns:

  • (String)


59
60
61
# File 'eks/fargate_profile.rb', line 59

def fargate_profile_arn()
  jsii_get_property("fargateProfileArn")
end

#fargate_profile_nameString

The name of the Fargate profile.

Returns:

  • (String)


66
67
68
# File 'eks/fargate_profile.rb', line 66

def fargate_profile_name()
  jsii_get_property("fargateProfileName")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


52
53
54
# File 'eks/fargate_profile.rb', line 52

def node()
  jsii_get_property("node")
end

#pod_execution_roleAWSCDK::IAM::IRole

The pod execution role to use for pods that match the selectors in the Fargate profile.

The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it provides read access to Amazon ECR image repositories.

Returns:



77
78
79
# File 'eks/fargate_profile.rb', line 77

def pod_execution_role()
  jsii_get_property("podExecutionRole")
end

#tagsAWSCDK::TagManager

Resource tags.

Returns:



84
85
86
# File 'eks/fargate_profile.rb', line 84

def tags()
  jsii_get_property("tags")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


91
92
93
# File 'eks/fargate_profile.rb', line 91

def to_string()
  jsii_call_method("toString", [])
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



104
105
106
107
108
109
# File 'eks/fargate_profile.rb', line 104

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end