class Kubernetes::Client
- Kubernetes::Client
- Reference
- Object
Defined in:
kubernetes.cr:15kubernetes.cr:1049
kubernetes.cr:1053
kubernetes.cr:1058
kubernetes.cr:1063
kubernetes.cr:1068
kubernetes.cr:1074
kubernetes.cr:1080
Constructors
- .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"), certificate_file : String = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt", log : Log = Log.for("kubernetes.client"))
- .new(*, config_file : String, context context_name : String)
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, &)
- #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_ingress(name : String, namespace, **kwargs)
- #patch_job(name : String, namespace, **kwargs)
- #patch_persistentvolumeclaim(name : String, namespace, **kwargs)
- #patch_pod(name : String, namespace, **kwargs)
- #patch_service(name : String, namespace, **kwargs)
- #patch_statefulset(name : String, namespace, **kwargs)
- #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 = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_ingresses(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_jobs(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_persistentvolumeclaims(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_pods(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_services(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
- #watch_statefulsets(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
Constructor Detail
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"), certificate_file : String = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt", log : Log = Log.for("kubernetes.client"))
#
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 persistentvolumeclaim(name : String, namespace : String = "default", resource_version : String = "")
#
def watch_deployments(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_ingresses(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_jobs(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_persistentvolumeclaims(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_pods(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_services(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#
def watch_statefulsets(resource_version = "0", timeout : Time::Span = 1.hour, namespace : String | Nil = nil, labels label_selector : String = "", &)
#