class Kubernetes::Client

Defined in:

kubernetes.cr:15
kubernetes.cr:1153
kubernetes.cr:1157
kubernetes.cr:1162
kubernetes.cr:1167
kubernetes.cr:1172
kubernetes.cr:1178
kubernetes.cr:1184

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(server : URI, token : String = File.read("/var/run/secrets/kubernetes.io/serviceaccount/token"), certificate_file : String = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt", client_cert_file : String | Nil = nil, private_key_file : String | Nil = nil, log = Log.for("kubernetes.client")) #

[View source]
def self.new #

[View source]
def self.new(*, server : URI = URI.parse("https://#{ENV["KUBERNETES_SERVICE_HOST"]}:#{ENV["KUBERNETES_SERVICE_PORT"]}"), token : String = File.read("/var/run/secrets/kubernetes.io/serviceaccount/token"), tls : OpenSSL::SSL::Context::Client | Nil, log : Log = Log.for("kubernetes.client")) #

[View source]

Class Method Detail

def self.from_config(config : Config, *, context context_name : String = config.current_context) #

[View source]
def self.from_config(*, file : String = "#{ENV["HOME"]?}/.kube/config", context context_name : String | Nil = nil) #

[View source]

Instance Method Detail

def api_resources(group : String) #

[View source]
def apis #

[View source]
def apply_deployment(resource : Deployment, spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_deployment(metadata : NamedTuple | Metadata, api_version : String = "apps/v1", kind : String = "Deployment", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def apply_ingress(resource : Resource(Networking::Ingress), spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_ingress(metadata : NamedTuple | Metadata, api_version : String = "networking.k8s.io/v1", kind : String = "Ingress", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def apply_job(resource : Resource(Job), spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_job(metadata : NamedTuple | Metadata, api_version : String = "batch/v1", kind : String = "Job", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def apply_persistentvolumeclaim(resource : Resource(JSON::Any), spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_persistentvolumeclaim(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "PersistentVolumeClaim", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def apply_pod(resource : Pod, spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_pod(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "Pod", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def apply_service(resource : Service, spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_service(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "Service", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def apply_statefulset(resource : Resource(StatefulSet), spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil) #

[View source]
def apply_statefulset(metadata : NamedTuple | Metadata, api_version : String = "apps/v1", kind : String = "StatefulSet", force : Bool = false, field_manager : String | Nil = nil, **kwargs) #

[View source]
def close : Nil #

[View source]
def delete(path : String, headers = HTTP::Headers.new) #

[View source]
def delete_deployment(resource : Deployment) #

[View source]
def delete_deployment(name : String, namespace : String = "default") #

[View source]
def delete_ingress(resource : Resource(Networking::Ingress)) #

[View source]
def delete_ingress(name : String, namespace : String = "default") #

[View source]
def delete_job(resource : Resource(Job)) #

[View source]
def delete_job(name : String, namespace : String = "default") #

[View source]
def delete_persistentvolumeclaim(resource : Resource(JSON::Any)) #

[View source]
def delete_persistentvolumeclaim(name : String, namespace : String = "default") #

[View source]
def delete_pod(resource : Pod) #

[View source]
def delete_pod(name : String, namespace : String = "default") #

[View source]
def delete_service(resource : Service) #

[View source]
def delete_service(name : String, namespace : String = "default") #

[View source]
def delete_statefulset(resource : Resource(StatefulSet)) #

[View source]
def delete_statefulset(name : String, namespace : String = "default") #

[View source]
def deployment(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def deployments(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def get(path : String, headers = HTTP::Headers.new, *, as type : T.class) : T | Nil forall T #

[View source]
def get(path : String, headers = HTTP::Headers.new, &) #

[View source]
def ingress(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def ingresses(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def job(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def jobs(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def patch(path : String, body, headers = HTTP::Headers.new) #

[View source]
def patch_deployment(name : String, namespace, **kwargs) #

[View source]
def patch_deployment_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def patch_ingress(name : String, namespace, **kwargs) #

[View source]
def patch_ingress_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def patch_job(name : String, namespace, **kwargs) #

[View source]
def patch_job_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def patch_persistentvolumeclaim(name : String, namespace, **kwargs) #

[View source]
def patch_persistentvolumeclaim_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def patch_pod(name : String, namespace, **kwargs) #

[View source]
def patch_pod_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def patch_service(name : String, namespace, **kwargs) #

[View source]
def patch_service_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def patch_statefulset(name : String, namespace, **kwargs) #

[View source]
def patch_statefulset_subresource(name : String, subresource : String, namespace : String = "default", **args) #

[View source]
def persistentvolumeclaim(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def persistentvolumeclaims(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def pod(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def pods(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def put(path : String, body, headers = HTTP::Headers.new) #

[View source]
def raw_patch(path : String, body, headers = HTTP::Headers.new) #

[View source]
def service(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def services(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def statefulset(name : String, namespace : String = "default", resource_version : String = "") #

[View source]
def statefulsets(namespace : String | Nil = "default", label_selector = nil) #

[View source]
def watch_deployments(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]
def watch_ingresses(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]
def watch_jobs(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]
def watch_persistentvolumeclaims(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]
def watch_pods(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]
def watch_services(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]
def watch_statefulsets(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &) #

[View source]