class TrinoK8sClient
TrinoK8sClient is the piece of the RealTrinoRuntime that talks to Kubernetes.
Public Class Methods
Source
# File app/services/trino_k8s_client.rb, line 6 def initialize(client: nil) @client = client || K8sClientFactory.build end
Wraps a K8sClient, building one when none is injected.
@param client [K8sClient, nil] the underlying client
Public Instance Methods
Source
# File app/services/trino_k8s_client.rb, line 56 def apply_spec(**args) @client.apply_spec(**args) end
Applies the engine node spec (replicas, resources, env) via a strategic-merge patch.
@param args [Hash] forwarded to K8sClient#apply_spec
Source
# File app/services/trino_k8s_client.rb, line 41 def deployment_exists? @client.deployment_exists? end
Whether the Trino Deployment exists.
@return [Boolean] true when present
Source
# File app/services/trino_k8s_client.rb, line 34 def live_replicas @client.live_replicas end
The Trino Deployment’s actual running/pending pod count.
@return [Integer] the status.replicas count
Source
# File app/services/trino_k8s_client.rb, line 20 def ready? @client.ready? end
Whether the Trino Deployment is ready.
@return [Boolean] true when ready
Source
# File app/services/trino_k8s_client.rb, line 27 def replicas @client.replicas end
The Trino Deployment’s desired replica count.
@return [Integer] the spec.replicas count
Source
# File app/services/trino_k8s_client.rb, line 48 def scale(replicas) @client.scale(replicas) end
Scales the Trino Deployment to the given replica count.
@param replicas [Integer] the desired replicas
Source
# File app/services/trino_k8s_client.rb, line 13 def target @client.target end
The addressed Deployment as “namespace/name”, for error messages.
@return [String] the namespace-qualified Deployment name