require "kce"
# using instance methods
# if path is omitted, KUBECONFIG env variable will be used
# if env variable is unset, it defaults to "~/.kube/config"
kce = KCE::Extractor.new("my-context", "/path/to/kubeconfig")
puts kce.config # => config as Object (from YAML)
puts kce.config.to_yaml # => config as String (from YAML)
# using class methods
kubeconfig = KCE::Extractor.config("my-context", "/path/to/kubeconfig")
Class methods
config(kubecontext :
String, kubeconfig :
String |
Nil = nil)
Returns KUBECONFIG Object for kubecontext
SourceInstance methods
config
Returns KUBECONFIG Object for kubecontext
Sourcekubecontext
Context to extract config for
Source