Class: AWSCDK::EKSv2::Selector

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ek_sv2/selector.rb

Overview

Fargate profile selector.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace:, labels: nil) ⇒ Selector

Returns a new instance of Selector.

Parameters:

  • namespace (String)

    The Kubernetes namespace that the selector should match.

  • labels (Hash{String => String}, nil) (defaults to: nil)

    The Kubernetes labels that the selector should match.



9
10
11
12
13
14
# File 'ek_sv2/selector.rb', line 9

def initialize(namespace:, labels: nil)
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace")
  @labels = labels
  Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "labels") unless @labels.nil?
end

Instance Attribute Details

#labelsHash{String => String}? (readonly)

Note:

Default: - all pods within the namespace will be selected.

The Kubernetes labels that the selector should match.

A pod must contain all of the labels that are specified in the selector for it to be considered a match.

Returns:

  • (Hash{String => String}, nil)


32
33
34
# File 'ek_sv2/selector.rb', line 32

def labels
  @labels
end

#namespaceString (readonly)

The Kubernetes namespace that the selector should match.

You must specify a namespace for a selector. The selector only matches pods that are created in this namespace, but you can create multiple selectors to target multiple namespaces.

Returns:

  • (String)


23
24
25
# File 'ek_sv2/selector.rb', line 23

def namespace
  @namespace
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
# File 'ek_sv2/selector.rb', line 34

def self.jsii_properties
  {
    :namespace => "namespace",
    :labels => "labels",
  }
end

Instance Method Details

#to_jsiiObject



41
42
43
44
45
46
47
48
# File 'ek_sv2/selector.rb', line 41

def to_jsii
  result = {}
  result.merge!({
    "namespace" => @namespace,
    "labels" => @labels,
  })
  result.compact
end