Class: AWSCDK::EKS::BootstrapOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
eks/bootstrap_options.rb

Overview

EKS node bootstrapping options.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(additional_args: nil, aws_api_retry_attempts: nil, dns_cluster_ip: nil, docker_config_json: nil, enable_docker_bridge: nil, kubelet_extra_args: nil, use_max_pods: nil) ⇒ BootstrapOptions

Returns a new instance of BootstrapOptions.

Parameters:

  • additional_args (String, nil) (defaults to: nil)

    Additional command line arguments to pass to the /etc/eks/bootstrap.sh command.

  • aws_api_retry_attempts (Numeric, nil) (defaults to: nil)

    Number of retry attempts for AWS API call (DescribeCluster).

  • dns_cluster_ip (String, nil) (defaults to: nil)

    Overrides the IP address to use for DNS queries within the cluster.

  • docker_config_json (String, nil) (defaults to: nil)

    The contents of the /etc/docker/daemon.json file. Useful if you want a custom config differing from the default one in the EKS AMI.

  • enable_docker_bridge (Boolean, nil) (defaults to: nil)

    Restores the docker default bridge network.

  • kubelet_extra_args (String, nil) (defaults to: nil)

    Extra arguments to add to the kubelet. Useful for adding labels or taints.

  • use_max_pods (Boolean, nil) (defaults to: nil)

    Sets --max-pods for the kubelet based on the capacity of the EC2 instance.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'eks/bootstrap_options.rb', line 14

def initialize(additional_args: nil, aws_api_retry_attempts: nil, dns_cluster_ip: nil, docker_config_json: nil, enable_docker_bridge: nil, kubelet_extra_args: nil, use_max_pods: nil)
  @additional_args = additional_args
  Jsii::Type.check_type(@additional_args, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "additionalArgs") unless @additional_args.nil?
  @aws_api_retry_attempts = aws_api_retry_attempts
  Jsii::Type.check_type(@aws_api_retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "awsApiRetryAttempts") unless @aws_api_retry_attempts.nil?
  @dns_cluster_ip = dns_cluster_ip
  Jsii::Type.check_type(@dns_cluster_ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dnsClusterIp") unless @dns_cluster_ip.nil?
  @docker_config_json = docker_config_json
  Jsii::Type.check_type(@docker_config_json, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dockerConfigJson") unless @docker_config_json.nil?
  @enable_docker_bridge = enable_docker_bridge
  Jsii::Type.check_type(@enable_docker_bridge, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableDockerBridge") unless @enable_docker_bridge.nil?
  @kubelet_extra_args = kubelet_extra_args
  Jsii::Type.check_type(@kubelet_extra_args, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kubeletExtraArgs") unless @kubelet_extra_args.nil?
  @use_max_pods = use_max_pods
  Jsii::Type.check_type(@use_max_pods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "useMaxPods") unless @use_max_pods.nil?
end

Instance Attribute Details

#additional_argsString? (readonly)

Note:

Default: - none

Additional command line arguments to pass to the /etc/eks/bootstrap.sh command.



36
37
38
# File 'eks/bootstrap_options.rb', line 36

def additional_args
  @additional_args
end

#aws_api_retry_attemptsNumeric? (readonly)

Note:

Default: 3

Number of retry attempts for AWS API call (DescribeCluster).

Returns:

  • (Numeric, nil)


41
42
43
# File 'eks/bootstrap_options.rb', line 41

def aws_api_retry_attempts
  @aws_api_retry_attempts
end

#dns_cluster_ipString? (readonly)

Note:

Default: - 10.100.0.10 or 172.20.0.10 based on the IP address of the primary interface.

Overrides the IP address to use for DNS queries within the cluster.

Returns:

  • (String, nil)


46
47
48
# File 'eks/bootstrap_options.rb', line 46

def dns_cluster_ip
  @dns_cluster_ip
end

#docker_config_jsonString? (readonly)

Note:

Default: - none

The contents of the /etc/docker/daemon.json file. Useful if you want a custom config differing from the default one in the EKS AMI.

Returns:

  • (String, nil)


51
52
53
# File 'eks/bootstrap_options.rb', line 51

def docker_config_json
  @docker_config_json
end

#enable_docker_bridgeBoolean? (readonly)

Note:

Default: false

Restores the docker default bridge network.

Returns:

  • (Boolean, nil)


56
57
58
# File 'eks/bootstrap_options.rb', line 56

def enable_docker_bridge
  @enable_docker_bridge
end

#kubelet_extra_argsString? (readonly)

Note:

Default: - none

Extra arguments to add to the kubelet. Useful for adding labels or taints.

For example, --node-labels foo=bar,goo=far.

Returns:

  • (String, nil)


63
64
65
# File 'eks/bootstrap_options.rb', line 63

def kubelet_extra_args
  @kubelet_extra_args
end

#use_max_podsBoolean? (readonly)

Note:

Default: true

Sets --max-pods for the kubelet based on the capacity of the EC2 instance.

Returns:

  • (Boolean, nil)


68
69
70
# File 'eks/bootstrap_options.rb', line 68

def use_max_pods
  @use_max_pods
end

Class Method Details

.jsii_propertiesObject



70
71
72
73
74
75
76
77
78
79
80
# File 'eks/bootstrap_options.rb', line 70

def self.jsii_properties
  {
    :additional_args => "additionalArgs",
    :aws_api_retry_attempts => "awsApiRetryAttempts",
    :dns_cluster_ip => "dnsClusterIp",
    :docker_config_json => "dockerConfigJson",
    :enable_docker_bridge => "enableDockerBridge",
    :kubelet_extra_args => "kubeletExtraArgs",
    :use_max_pods => "useMaxPods",
  }
end

Instance Method Details

#to_jsiiObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'eks/bootstrap_options.rb', line 82

def to_jsii
  result = {}
  result.merge!({
    "additionalArgs" => @additional_args,
    "awsApiRetryAttempts" => @aws_api_retry_attempts,
    "dnsClusterIp" => @dns_cluster_ip,
    "dockerConfigJson" => @docker_config_json,
    "enableDockerBridge" => @enable_docker_bridge,
    "kubeletExtraArgs" => @kubelet_extra_args,
    "useMaxPods" => @use_max_pods,
  })
  result.compact
end