Class: CronKubernetes::Context::Kubectl

Inherits:
Object
  • Object
show all
Defined in:
lib/cron_kubernetes/context/kubectl.rb

Overview

Kubeclient Context from ‘kubectl` config file.

Instance Method Summary collapse

Instance Method Details

#applicable?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/cron_kubernetes/context/kubectl.rb', line 7

def applicable?
  File.exist?(kubeconfig)
end

#contextObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cron_kubernetes/context/kubectl.rb', line 11

def context
  config = Kubeclient::Config.read(kubeconfig)

  CronKubernetes::KubeclientContext::Context.new(
    config.context.api_endpoint,
    config.context.api_version,
    config.context.namespace,
    auth_options: auth_options(config),
    ssl_options:  config.context.ssl_options
  )
end