@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
32 lines • 1.47 kB
TypeScript
import type { ICluster } from "../../entities";
import type { KubeConfig, KubeConfigContext } from "../../interfaces";
export declare function getKubeConfig(filePath?: string): Promise<KubeConfig>;
/**
* Get current context of KUBE_CONFIG
*/
export declare function currentContext(): Promise<string>;
/**
* Get current cluster of KUBE_CONFIG
*/
export declare function currentCluster(): Promise<KubeConfigContext>;
/**
* Get all available Kubernetes contexts of the build server
*/
export declare const getAllContexts: (filePath?: string) => Promise<KubeConfigContext[]>;
/**
* Get KUBE_CONTEXT by {Cluster} instance
* @param cluster - A cluster
* @param filePath - [optional] - A ".kubeconfig" YAML file path
* @returns
*/
export declare function getKubeContextByCluster(cluster: ICluster, filePath?: string): Promise<KubeConfigContext>;
/**
* Get KUBE_CONTEXT by cluster's short name & cloud provider's short name
* @param slug - A cluster slug on the cloud provider (**NOT** a cluster in `kubeconfig`)
* @param provider - A cloud provider short name. One of "digitalocean", "gcloud" or "custom"
* @param filePath - [optional] - A service account file path
* @returns
*/
export declare function getKubeContextByClusterSlug(slug: string, provider: string, filePath?: string): Promise<KubeConfigContext>;
export declare function deleteClusterInKubeConfig(cluster: ICluster, filePath?: string): Promise<KubeConfig>;
//# sourceMappingURL=kube-config.d.ts.map