Module: K8y::Client

Defined in:
lib/k8y/client.rb,
lib/k8y/client/api.rb,
lib/k8y/client/apis.rb,
lib/k8y/client/client.rb,
lib/k8y/client/api_builder.rb,
lib/k8y/client/resource_description.rb

Defined Under Namespace

Classes: API, APIBuilder, APIs, Client, ResourceDescription

Constant Summary collapse

Error =
Class.new(Error)
ContextNotFoundError =
Class.new(Error)
APINameConflictError =
Class.new(Error)
DEFAULT_GROUP_VERSIONS =
[
  GroupVersion.new(group: "core", version: "v1"),
  GroupVersion.new(group: "apps", version: "v1"),
]

Class Method Summary collapse

Class Method Details

.from_config(config, context: nil, group_versions: DEFAULT_GROUP_VERSIONS) ⇒ Object



16
17
18
# File 'lib/k8y/client.rb', line 16

def self.from_config(config, context: nil, group_versions: DEFAULT_GROUP_VERSIONS)
  Client.new(config: config, context: context || config.current_context, group_versions: group_versions)
end

.from_in_cluster(group_versions: DEFAULT_GROUP_VERSIONS) ⇒ Object



20
21
22
23
# File 'lib/k8y/client.rb', line 20

def self.from_in_cluster(group_versions: DEFAULT_GROUP_VERSIONS)
  config = Kubeconfig.in_cluster_config
  Client.new(config: config, context: Kubeconfig::IN_CLUSTER_NAME, group_versions: group_versions)
end