class CronKubernetes::Context::WellKnown
Kubeclient Context
from well-known locations within a Kubernetes cluster.
Constants
- CA_FILE
- NAMESPACE_FILE
- TOKEN_FILE
Public Instance Methods
applicable?()
click to toggle source
# File lib/cron_kubernetes/context/well_known.rb, line 11 def applicable? File.exist?(TOKEN_FILE) end
context()
click to toggle source
# File lib/cron_kubernetes/context/well_known.rb, line 15 def context CronKubernetes::KubeclientContext::Context.new( "https://kubernetes.default.svc", "v1", namespace, auth_options: {bearer_token_file: TOKEN_FILE}, ssl_options: ssl_options ) end
Private Instance Methods
namespace()
click to toggle source
# File lib/cron_kubernetes/context/well_known.rb, line 27 def namespace return nil unless File.exist?(NAMESPACE_FILE) File.read(NAMESPACE_FILE) end
ssl_options()
click to toggle source
# File lib/cron_kubernetes/context/well_known.rb, line 32 def ssl_options return {} unless File.exist?(CA_FILE) {ca_file: CA_FILE} end