Class: CDK8sPlus25::K8S::PodDNSConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
k8_s/pod_dns_config.rb

Overview

PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nameservers: nil, options: nil, searches: nil) ⇒ PodDNSConfig

Returns a new instance of PodDNSConfig.

Parameters:

  • nameservers (Array<String>, nil) (defaults to: nil)

    A list of DNS name server IP addresses.

  • options (Array<CDK8sPlus25::K8S::PodDNSConfigOption>, nil) (defaults to: nil)

    A list of DNS resolver options.

  • searches (Array<String>, nil) (defaults to: nil)

    A list of DNS search domains for host-name lookup.



10
11
12
13
14
15
16
17
# File 'k8_s/pod_dns_config.rb', line 10

def initialize(nameservers: nil, options: nil, searches: nil)
  @nameservers = nameservers
  Jsii::Type.check_type(@nameservers, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=", "nameservers") unless @nameservers.nil?
  @options = options.is_a?(Array) ? options.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::CDK8sPlus25::K8S::PodDNSConfigOption.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : options
  Jsii::Type.check_type(@options, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImNkazhzLXBsdXMtMjUuazhzLlBvZERuc0NvbmZpZ09wdGlvbiJ9LCJraW5kIjoiYXJyYXkifX0=", "options") unless @options.nil?
  @searches = searches
  Jsii::Type.check_type(@searches, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=", "searches") unless @searches.nil?
end

Instance Attribute Details

#nameserversArray<String>? (readonly)

A list of DNS name server IP addresses.

This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.

Returns:

  • (Array<String>, nil)


24
25
26
# File 'k8_s/pod_dns_config.rb', line 24

def nameservers
  @nameservers
end

#optionsArray<CDK8sPlus25::K8S::PodDNSConfigOption>? (readonly)

A list of DNS resolver options.

This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.

Returns:



30
31
32
# File 'k8_s/pod_dns_config.rb', line 30

def options
  @options
end

#searchesArray<String>? (readonly)

A list of DNS search domains for host-name lookup.

This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.

Returns:

  • (Array<String>, nil)


36
37
38
# File 'k8_s/pod_dns_config.rb', line 36

def searches
  @searches
end

Class Method Details

.jsii_propertiesObject



38
39
40
41
42
43
44
# File 'k8_s/pod_dns_config.rb', line 38

def self.jsii_properties
  {
    :nameservers => "nameservers",
    :options => "options",
    :searches => "searches",
  }
end

Instance Method Details

#to_jsiiObject



46
47
48
49
50
51
52
53
54
# File 'k8_s/pod_dns_config.rb', line 46

def to_jsii
  result = {}
  result.merge!({
    "nameservers" => @nameservers,
    "options" => @options,
    "searches" => @searches,
  })
  result.compact
end