Class: Ruboty::K8s::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboty/k8s/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
# File 'lib/ruboty/k8s/client.rb', line 7

def initialize(config)
  @config = config
  @v1 = setup_versions('api/', 'v1')
  @v1beta1 = setup_versions('apis/extensions/', 'v1beta1')
end

Instance Attribute Details

#v1Object (readonly)

Returns the value of attribute v1.



5
6
7
# File 'lib/ruboty/k8s/client.rb', line 5

def v1
  @v1
end

#v1beta1Object (readonly)

Returns the value of attribute v1beta1.



5
6
7
# File 'lib/ruboty/k8s/client.rb', line 5

def v1beta1
  @v1beta1
end

Instance Method Details

#setup_versions(api_prefix, api_version) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/ruboty/k8s/client.rb', line 13

def setup_versions(api_prefix, api_version)
  ::Kubeclient::Client.new(
    "#{@config['api_endpoint']}#{api_prefix}",
    api_version,
    auth_options: auth_options,
    ssl_options: ssl_options
  )
end