import type { Logger } from '@aztec/foundation/log';
import { type ChildProcess } from 'child_process';
import { GrafanaClient } from '../../quality_of_service/grafana_client.js';
/**
 * Represents an endpoint to reach a K8s service.
 * May be a LoadBalancer external IP or a port-forward.
 */
export interface ServiceEndpoint {
    url: string;
    process?: ChildProcess;
}
export declare function startPortForward({ resource, namespace, containerPort, hostPort }: {
    resource: string;
    namespace: string;
    containerPort: number;
    hostPort?: number;
}): Promise<{
    process: ChildProcess;
    port: number;
}>;
export declare function getExternalIP(namespace: string, serviceName: string): Promise<string>;
/**
 * Gets an endpoint for a K8s service.
 * By default, tries to get the external IP first and falls back to port-forward if unavailable.
 *
 * @param opts.namespace - K8s namespace
 * @param opts.serviceName - Service name suffix (e.g., 'rpc-aztec-node', 'eth-execution')
 * @param opts.containerPort - Port the service exposes
 * @param opts.usePortForward - If true, skip external IP check and always use port-forward
 */
export declare function getServiceEndpoint(opts: {
    namespace: string;
    serviceName: string;
    containerPort: number;
    forcePortForward?: boolean;
}): Promise<ServiceEndpoint>;
/**
 * Gets an endpoint for the RPC node service.
 * Tries external IP first, falls back to port-forward.
 *
 * @param namespace - K8s namespace
 * @param usePortForward - If true, skip external IP and use port-forward directly
 */
export declare function getRPCEndpoint(namespace: string, forcePortForward?: boolean): Promise<ServiceEndpoint>;
/**
 * Gets an endpoint for the Ethereum execution service.
 * Tries external IP first, falls back to port-forward.
 *
 * @param namespace - K8s namespace
 * @param usePortForward - If true, skip external IP and use port-forward directly
 */
export declare function getEthereumEndpoint(namespace: string, forcePortForward?: boolean): Promise<ServiceEndpoint>;
export declare function startPortForwardForPrometeheus(namespace: string): Promise<{
    process: ChildProcess;
    port: number;
}>;
export declare function startPortForwardForRPC(namespace: string, index?: number): Promise<{
    process: ChildProcess;
    port: number;
}>;
export declare function startPortForwardForEthereum(namespace: string): Promise<{
    process: ChildProcess;
    port: number;
}>;
export declare function deleteResourceByName({ resource, namespace, name, force }: {
    resource: string;
    namespace: string;
    name: string;
    force?: boolean;
}): Promise<string>;
export declare function deleteResourceByLabel({ resource, namespace, label, timeout, force }: {
    resource: string;
    namespace: string;
    label: string;
    timeout?: string;
    force?: boolean;
}): Promise<string>;
export declare function waitForResourceByLabel({ resource, label, namespace, condition, timeout }: {
    resource: string;
    label: string;
    namespace: string;
    condition?: string;
    timeout?: string;
}): Promise<string>;
export declare function waitForResourceByName({ resource, name, namespace, condition, timeout }: {
    resource: string;
    name: string;
    namespace: string;
    condition?: string;
    timeout?: string;
}): Promise<string>;
export declare function waitForResourcesByName({ resource, names, namespace, condition, timeout }: {
    resource: string;
    names: string[];
    namespace: string;
    condition?: string;
    timeout?: string;
}): Promise<void>;
/**
 * Waits for all StatefulSets matching a label to have all their replicas ready.
 *
 * @param namespace - Kubernetes namespace
 * @param label - Label selector for StatefulSets (e.g., "app.kubernetes.io/component=sequencer-node")
 * @param timeoutSeconds - Maximum time to wait in seconds
 * @param pollIntervalSeconds - How often to check status
 */
export declare function waitForStatefulSetsReady({ namespace, label, timeoutSeconds, pollIntervalSeconds }: {
    namespace: string;
    label: string;
    timeoutSeconds?: number;
    pollIntervalSeconds?: number;
}): Promise<void>;
/**
 * Creates a Prometheus connection that can re-establish port-forward on failure.
 * Returns functions to connect and run alert checks that automatically reconnect if needed.
 *
 * @param namespace - K8s namespace to fall back to if metrics namespace doesn't have Prometheus
 * @param endpoints - Array to track created endpoints for cleanup
 * @param log - Logger instance
 */
export declare function createResilientPrometheusConnection(namespace: string, endpoints: ServiceEndpoint[], log: Logger): {
    connect: () => Promise<GrafanaClient>;
    runAlertCheck: (alerts: Parameters<GrafanaClient['runAlertCheck']>[0]) => Promise<void>;
};
/** Scales the prover-agent Deployment to the given number of replicas. */
export declare function scaleProverAgents(namespace: string, replicas: number, log: Logger): Promise<void>;
export declare function getChartDir(spartanDir: string, chartName: string): string;
//# sourceMappingURL=data:application/json;base64, 