class Kube::Client
- Kube::Client
- Reference
- Object
Included Modules
Extended Modules
Defined in:
kube-client/version.crkube/client.cr
kube/client/api.cr
kube/client/config.cr
kube/client/config/auth_provider.cr
kube/client/config/context.cr
kube/client/error.cr
kube/client/service_account.cr
Constant Summary
-
VERSION =
"0.2.0"
Constructors
- .new(kube_file : String)
-
.new
Initialize a Client using the
KUBECONFIG
env TODO: handle multiple config files
Class Method Summary
Instance Method Summary
- #add_pod_label(pod_name : String, key : String, value : String, namespace : String | Nil = nil)
- #api : Kube::Client::Api
-
#change_context(context_name : String)
Change the current context
- #config : Kube::Client::Config
- #context : Hash(Symbol, String | YAML::Any | Nil)
- #context=(context : Hash(Symbol, String | YAML::Any | Nil))
- #del_pod_label(pod_name : String, key : String, namespace : String | Nil = nil)
-
#delete_pod(name : String, namespace : String | Nil = nil)
Delete pod
- #logger
- #mod_pod_label(mod, pod_name : String, key : String, value : String, namespace : String | Nil = nil)
- #namespaces(label_selector : Hash(String, String) | Nil = nil)
- #nodes(label_selector : Hash(String, String) | Nil = nil)
- #patch(path, data)
-
#pods(namespace : String | Nil = nil, label_selector : Hash(String, String) | Nil = nil)
Gathers all the pods
- #secrets(namespace : String | Nil = nil, label_selector : Hash(String, String) | Nil = nil)
-
#select_pods(namespace : String | Nil = nil, label_selector : Hash(String, String) | Nil = nil, status : String | Nil = nil) : Array(JSON::Any)
Will select pods with the provided status
- #stream
- #watch_nodes(label_selector : Hash(String, String) | Nil = nil)
- #watch_pods(namespace : String | Nil = nil, label_selector : Hash(String, String) | Nil = nil)
Constructor Detail
Class Method Detail
Instance Method Detail
def add_pod_label(pod_name : String, key : String, value : String, namespace : String | Nil = nil)
#
def change_context(context_name : String)
#
Change the current context
@example
client = Kube::Client.new("~/.kube/config")
client.context[:name] => "mysql-test"
client.change_context("mysql-helper")
client.context[:name] => "mysql-helper"
def mod_pod_label(mod, pod_name : String, key : String, value : String, namespace : String | Nil = nil)
#
Gathers all the pods
def select_pods(namespace : String | Nil = nil, label_selector : Hash(String, String) | Nil = nil, status : String | Nil = nil) : Array(JSON::Any)
#
Will select pods with the provided status