kubernetes/src/kubernetes/utils.rb
#
# Loads configuration the same as load_kube_config but returns an ApiClient
# to be used with any API object. This will allow the caller to concurrently
# talk with multiple clusters.
# @param config_file [String] Path of the kube-config file.
# @param context [String] Set the active context. If is set to nil,
#    current_context from config file will be used.
# @return [Kubernetes::ApiClient] Api client for Kubernetes cluster
Loads configuration the same as load_kube_config but returns an ApiClient
to be used with any API object. This will allow the caller to concurrently
talk with multiple clusters.
Loads configuration the same as load_kube_config but returns an ApiClient to be used with any API object . This will allow the caller to concurrently talk with multiple clusters .
def new_client_from_config(
    config_file = ENV['KUBECONFIG'],
    context: nil
  )
    config_file ||= KubeConfig::KUBE_CONFIG_DEFAULT_LOCATION
    client_configuration = Configuration.new
    load_kube_config(config_file,
                     context: context,
                     client_configuration: client_configuration)
    ApiClient.new(client_configuration)
  end
def new_client_from_config ( config_file = ENV [ 'KUBECONFIG' ] , context : nil ) config_file ||= KubeConfig :: KUBE_CONFIG_DEFAULT_LOCATION client_configuration = Configuration . new load_kube_config ( config_file , context : context , client_configuration : client_configuration ) ApiClient . new ( client_configuration ) end
Loads configuration the same as load_kube_config but returns an ApiClient
to be used with any API object.
Loads configuration the same as load_kube_config but returns an ApiClient to be used with any API object .
Api client for Kubernetes cluster
Api client for Kubernetes cluster
Kubernetes::ApiClient
config_file
Path of the kube-config file.
Path of the kube - config file .
context
Set the active context. If is set to nil, current_context from config file will be used.
Set the active context . If is set to nil current_context from config file will be used .