Class: DTK::CrdClient
Instance Attribute Summary collapse
-
#kubeclient ⇒ Object
Returns the value of attribute kubeclient.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CrdClient
constructor
opts can have keys kubernetes_client - already instantiated kubernetes client.
Constructor Details
#initialize(opts = {}) ⇒ CrdClient
opts can have keys
kubernetes_client - already instantiated kubernetes client
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/crd_client.rb', line 21 def initialize(opts = {}) if @kubeclient = opts[:kubernetes_client] return @kubeclient end = {} = { bearer_token_file: '/var/run/secrets/kubernetes.io/serviceaccount/token' } if File.exist?("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt") [:ca_file] = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" end = { socket_class: Celluloid::IO::TCPSocket, ssl_socket_class: Celluloid::IO::SSLSocket } @kubeclient = Kubeclient::Client.new( 'https://kubernetes.default.svc/apis/', 'dtk.io/v1alpha1', auth_options: , ssl_options: , socket_options: ) @kubeclient.discover unless @kubeclient.discovered @kubeclient end |
Instance Attribute Details
#kubeclient ⇒ Object
Returns the value of attribute kubeclient.
9 10 11 |
# File 'lib/crd_client.rb', line 9 def kubeclient @kubeclient end |