class Kubernetes::Client
- Kubernetes::Client
- Reference
- Object
Defined in:
kubernetes.cr:15kubernetes.cr:1153
kubernetes.cr:1157
kubernetes.cr:1162
kubernetes.cr:1167
kubernetes.cr:1172
kubernetes.cr:1178
kubernetes.cr:1184
Constructors
- .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"))
- .new
- .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"))
Class Method Summary
- .from_config(config : Config, *, context context_name : String = config.current_context)
- .from_config(*, file : String = "#{ENV["HOME"]?}/.kube/config", context context_name : String | Nil = nil)
Instance Method Summary
- #api_resources(group : String)
- #apis
- #apply_deployment(resource : Deployment, spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil)
- #apply_deployment(metadata : NamedTuple | Metadata, api_version : String = "apps/v1", kind : String = "Deployment", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #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)
- #apply_ingress(metadata : NamedTuple | Metadata, api_version : String = "networking.k8s.io/v1", kind : String = "Ingress", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #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)
- #apply_job(metadata : NamedTuple | Metadata, api_version : String = "batch/v1", kind : String = "Job", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #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)
- #apply_persistentvolumeclaim(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "PersistentVolumeClaim", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #apply_pod(resource : Pod, spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil)
- #apply_pod(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "Pod", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #apply_service(resource : Service, spec, name : String = resource.metadata.name, namespace : String | Nil = resource.metadata.namespace, force : Bool = false, field_manager : String | Nil = nil)
- #apply_service(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "Service", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #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)
- #apply_statefulset(metadata : NamedTuple | Metadata, api_version : String = "apps/v1", kind : String = "StatefulSet", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
- #close : Nil
- #delete(path : String, headers = HTTP::Headers.new)
- #delete_deployment(resource : Deployment)
- #delete_deployment(name : String, namespace : String = "default")
- #delete_ingress(resource : Resource(Networking::Ingress))
- #delete_ingress(name : String, namespace : String = "default")
- #delete_job(resource : Resource(Job))
- #delete_job(name : String, namespace : String = "default")
- #delete_persistentvolumeclaim(resource : Resource(JSON::Any))
- #delete_persistentvolumeclaim(name : String, namespace : String = "default")
- #delete_pod(resource : Pod)
- #delete_pod(name : String, namespace : String = "default")
- #delete_service(resource : Service)
- #delete_service(name : String, namespace : String = "default")
- #delete_statefulset(resource : Resource(StatefulSet))
- #delete_statefulset(name : String, namespace : String = "default")
- #deployment(name : String, namespace : String = "default", resource_version : String = "")
- #deployments(namespace : String | Nil = "default", label_selector = nil)
- #get(path : String, headers = HTTP::Headers.new, *, as type : T.class) : T | Nil forall T
- #get(path : String, headers = HTTP::Headers.new, &)
- #ingress(name : String, namespace : String = "default", resource_version : String = "")
- #ingresses(namespace : String | Nil = "default", label_selector = nil)
- #job(name : String, namespace : String = "default", resource_version : String = "")
- #jobs(namespace : String | Nil = "default", label_selector = nil)
- #patch(path : String, body, headers = HTTP::Headers.new)
- #patch_deployment(name : String, namespace, **kwargs)
- #patch_deployment_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #patch_ingress(name : String, namespace, **kwargs)
- #patch_ingress_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #patch_job(name : String, namespace, **kwargs)
- #patch_job_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #patch_persistentvolumeclaim(name : String, namespace, **kwargs)
- #patch_persistentvolumeclaim_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #patch_pod(name : String, namespace, **kwargs)
- #patch_pod_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #patch_service(name : String, namespace, **kwargs)
- #patch_service_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #patch_statefulset(name : String, namespace, **kwargs)
- #patch_statefulset_subresource(name : String, subresource : String, namespace : String = "default", **args)
- #persistentvolumeclaim(name : String, namespace : String = "default", resource_version : String = "")
- #persistentvolumeclaims(namespace : String | Nil = "default", label_selector = nil)
- #pod(name : String, namespace : String = "default", resource_version : String = "")
- #pods(namespace : String | Nil = "default", label_selector = nil)
- #put(path : String, body, headers = HTTP::Headers.new)
- #raw_patch(path : String, body, headers = HTTP::Headers.new)
- #service(name : String, namespace : String = "default", resource_version : String = "")
- #services(namespace : String | Nil = "default", label_selector = nil)
- #statefulset(name : String, namespace : String = "default", resource_version : String = "")
- #statefulsets(namespace : String | Nil = "default", label_selector = nil)
- #watch_deployments(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_ingresses(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_jobs(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_persistentvolumeclaims(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_pods(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_services(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_statefulsets(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
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"))
#
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"))
#
Class Method Detail
def self.from_config(*, file : String = "#{ENV["HOME"]?}/.kube/config", context context_name : String | Nil = nil)
#
Instance Method Detail
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)
#
def apply_deployment(metadata : NamedTuple | Metadata, api_version : String = "apps/v1", kind : String = "Deployment", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
#
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)
#
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)
#
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)
#
def apply_job(metadata : NamedTuple | Metadata, api_version : String = "batch/v1", kind : String = "Job", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
#
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)
#
def apply_persistentvolumeclaim(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "PersistentVolumeClaim", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
#
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)
#
def apply_pod(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "Pod", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
#
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)
#
def apply_service(metadata : NamedTuple | Metadata, api_version : String = "/v1", kind : String = "Service", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
#
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)
#
def apply_statefulset(metadata : NamedTuple | Metadata, api_version : String = "apps/v1", kind : String = "StatefulSet", force : Bool = false, field_manager : String | Nil = nil, **kwargs)
#
def patch_deployment_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def patch_ingress_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def patch_job_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def patch_persistentvolumeclaim_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def patch_pod_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def patch_service_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def patch_statefulset_subresource(name : String, subresource : String, namespace : String = "default", **args)
#
def persistentvolumeclaim(name : String, namespace : String = "default", resource_version : String = "")
#
def watch_deployments(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_ingresses(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_jobs(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_persistentvolumeclaims(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_pods(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_services(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_statefulsets(resource_version = "0", timeout : Time::Span = 10.minutes, namespace : String | Nil = nil, labels label_selector : String = "", &)
#