Skip to content

Class: Cluster#

Cluster

beta

Hierarchy#

  • Cluster

Implements#

Index#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

+ new Cluster(model: ClusterModel): Cluster

Defined in src/main/cluster.ts:256

Parameters:

Name Type
model ClusterModel

Returns: Cluster

Properties#

accessible#

accessible: boolean = false

Defined in src/main/cluster.ts:149

Can user access cluster resources

observable


accessibleNamespaces#

accessibleNamespaces: string[] = []

Implementation of ClusterModel.accessibleNamespaces

Defined in src/main/cluster.ts:217

List of accessible namespaces provided by user in the Cluster Settings

observable


Protected activated#

activated: boolean = false

Defined in src/main/cluster.ts:82


allowedNamespaces#

allowedNamespaces: string[] = []

Defined in src/main/cluster.ts:204

List of allowed namespaces verified via K8S::SelfSubjectAccessReview api

observable


allowedResources#

allowedResources: string[] = []

Defined in src/main/cluster.ts:211

List of allowed resources

observable

internal


apiUrl#

apiUrl: string

Defined in src/main/cluster.ts:124

Kubernetes API server URL

observable


contextHandler#

contextHandler: ContextHandler

Defined in src/main/cluster.ts:73

Context handler

internal


contextName#

contextName: string

Implementation of ClusterModel.contextName

Defined in src/main/cluster.ts:106

Kubeconfig context name

observable


disconnected#

disconnected: boolean = true

Defined in src/main/cluster.ts:167

Is cluster disconnected. False if user has selected to connect.

observable


enabled#

enabled: boolean = false

Defined in src/main/cluster.ts:137

Is cluster instance enabled (disabled clusters are currently hidden)

observable


Protected eventDisposers#

eventDisposers: Function[] = []

Defined in src/main/cluster.ts:81


failureReason#

failureReason: string

Defined in src/main/cluster.ts:173

Connection failure reason

observable


id#

id: ClusterId

Implementation of ClusterModel.id

Defined in src/main/cluster.ts:61

Unique id for a cluster


initialized#

initialized: boolean = false

Defined in src/main/cluster.ts:100

Is cluster object initialized

observable


initializing#

initializing: boolean = false

Defined in src/main/cluster.ts:93

Is cluster object initializinng on-going

observable


isAdmin#

isAdmin: boolean = false

Defined in src/main/cluster.ts:179

Does user have admin like access

observable


isGlobalWatchEnabled#

isGlobalWatchEnabled: boolean = false

Defined in src/main/cluster.ts:186

Global watch-api accessibility , e.g. "/api/v1/services?watch=1"

observable


kubeConfigPath#

kubeConfigPath: string

Implementation of ClusterModel.kubeConfigPath

Defined in src/main/cluster.ts:118

Path to kubeconfig

observable


kubeCtl#

kubeCtl: Kubectl

Defined in src/main/cluster.ts:67

Kubectl

internal


kubeProxyUrl#

kubeProxyUrl: string

Defined in src/main/cluster.ts:131

Internal authentication proxy URL

observable

internal


Protected kubeconfigManager#

kubeconfigManager: KubeconfigManager

Defined in src/main/cluster.ts:80


metadata#

metadata: ClusterMetadata

Implementation of ClusterModel.metadata

Defined in src/main/cluster.ts:198

Metadata

observable


online#

online: boolean = false

Defined in src/main/cluster.ts:143

Is cluster online

observable


ownerRef#

ownerRef: string

Implementation of ClusterModel.ownerRef

Defined in src/main/cluster.ts:79

Owner reference

If extension sets this it needs to also mark cluster as enabled on activate (or when added to a store)


preferences#

preferences: ClusterPreferences

Implementation of ClusterModel.preferences

Defined in src/main/cluster.ts:192

Preferences

observable


ready#

ready: boolean = false

Defined in src/main/cluster.ts:155

Is cluster instance in usable state

observable


reconnecting#

reconnecting: boolean = false

Defined in src/main/cluster.ts:161

Is cluster currently reconnecting

observable


whenInitialized#

whenInitialized: Promise‹void› & object = when(() => this.initialized)

Defined in src/main/cluster.ts:85


whenReady#

whenReady: Promise‹void› & object = when(() => this.ready)

Defined in src/main/cluster.ts:86


workspace#

workspace: WorkspaceId

Implementation of ClusterModel.workspace

Defined in src/main/cluster.ts:112

Workspace id

observable

Accessors#

available#

get available(): boolean

Defined in src/main/cluster.ts:224

Is cluster available

computed

Returns: boolean


isManaged#

get isManaged(): boolean

Defined in src/main/cluster.ts:276

Is cluster managed by an extension

Returns: boolean


name#

get name(): string

Defined in src/main/cluster.ts:233

Cluster name

computed

Returns: string


prometheusPreferences#

get prometheusPreferences(): ClusterPrometheusPreferences

Defined in src/main/cluster.ts:243

Prometheus preferences

computed

internal

Returns: ClusterPrometheusPreferences


version#

get version(): string

Defined in src/main/cluster.ts:254

Kubernetes version

Returns: string

Methods#

activate#

activate(force: boolean): Promise‹void›

Defined in src/main/cluster.ts:352

internal

Parameters:

Name Type Default Description
force boolean false force activation

Returns: Promise‹void›


Protected bindEvents#

bindEvents(): void

Defined in src/main/cluster.ts:321

internal

Returns: void


canI#

canI(resourceAttributes: V1ResourceAttributes): Promise‹boolean›

Defined in src/main/cluster.ts:567

internal

Parameters:

Name Type Description
resourceAttributes V1ResourceAttributes resource attributes

Returns: Promise‹boolean›


canUseWatchApi#

canUseWatchApi(customizeResource: V1ResourceAttributes): Promise‹boolean›

Defined in src/main/cluster.ts:599

internal

Parameters:

Name Type Default
customizeResource V1ResourceAttributes {}

Returns: Promise‹boolean›


disconnect#

disconnect(): void

Defined in src/main/cluster.ts:400

internal

Returns: void


Protected ensureKubectl#

ensureKubectl(): Promise‹boolean›

Defined in src/main/cluster.ts:380

internal

Returns: Promise‹boolean›


Protected getAllowedNamespaces#

getAllowedNamespaces(): Promise‹string[]›

Defined in src/main/cluster.ts:678

Returns: Promise‹string[]›


Protected getAllowedResources#

getAllowedResources(): Promise‹("namespaces" | "nodes" | "events" | "resourcequotas" | "services" | "limitranges" | "secrets" | "configmaps" | "ingresses" | "networkpolicies" | "persistentvolumeclaims" | "persistentvolumes" | "storageclasses" | "pods" | "daemonsets" | "deployments" | "statefulsets" | "replicasets" | "jobs" | "cronjobs" | "endpoints" | "customresourcedefinitions" | "horizontalpodautoscalers" | "podsecuritypolicies" | "poddisruptionbudgets")[]›

Defined in src/main/cluster.ts:698

Returns: Promise‹("namespaces" | "nodes" | "events" | "resourcequotas" | "services" | "limitranges" | "secrets" | "configmaps" | "ingresses" | "networkpolicies" | "persistentvolumeclaims" | "persistentvolumes" | "storageclasses" | "pods" | "daemonsets" | "deployments" | "statefulsets" | "replicasets" | "jobs" | "cronjobs" | "endpoints" | "customresourcedefinitions" | "horizontalpodautoscalers" | "podsecuritypolicies" | "poddisruptionbudgets")[]›


Protected getConnectionStatus#

getConnectionStatus(): Promise‹ClusterStatus›

Defined in src/main/cluster.ts:523

Returns: Promise‹ClusterStatus›


Protected getKubeconfig#

getKubeconfig(): KubeConfig

Defined in src/main/cluster.ts:478

Returns: KubeConfig


getMeta#

getMeta(): object

Defined in src/main/cluster.ts:666

Returns: object

  • accessible: boolean = this.accessible

  • disconnected: boolean = this.disconnected

  • id: string = this.id

  • initialized: boolean = this.initialized

  • name: string = this.contextName

  • online: boolean = this.online

  • ready: boolean = this.ready


getMetrics#

getMetrics(prometheusPath: string, queryParams: IMetricsReqParams & object): Promise‹any›

Defined in src/main/cluster.ts:511

internal

Parameters:

Name Type Description
prometheusPath string path to prometheus service
queryParams IMetricsReqParams & object query parameters

Returns: Promise‹any›


getProxyKubeconfig#

getProxyKubeconfig(): KubeConfig

Defined in src/main/cluster.ts:485

internal

Returns: KubeConfig


getProxyKubeconfigPath#

getProxyKubeconfigPath(): string

Defined in src/main/cluster.ts:492

internal

Returns: string


getState#

getState(): ClusterState

Defined in src/main/cluster.ts:627

Serializable cluster-state used for sync btw main <-> renderer

Returns: ClusterState


init#

init(port: number): Promise‹void›

Defined in src/main/cluster.ts:296

Initialize a cluster (can be done only in main process)

internal

Parameters:

Name Type Description
port number port where internal auth proxy is listening

Returns: Promise‹void›


isAllowedResource#

isAllowedResource(kind: string): boolean

Defined in src/main/cluster.ts:733

Parameters:

Name Type
kind string

Returns: boolean


isClusterAdmin#

isClusterAdmin(): Promise‹boolean›

Defined in src/main/cluster.ts:588

internal

Returns: Promise‹boolean›


Protected k8sRequest#

k8sRequestT›(path: string, options: RequestPromiseOptions): Promise‹T›

Defined in src/main/cluster.ts:496

Type parameters:

T

Parameters:

Name Type Default
path string -
options RequestPromiseOptions {}

Returns: Promise‹T›


pushState#

pushState(state: ClusterState): void

Defined in src/main/cluster.ts:660

internal

Parameters:

Name Type Default Description
state ClusterState this.getState() cluster state

Returns: void


reconnect#

reconnect(): Promise‹void›

Defined in src/main/cluster.ts:390

internal

Returns: Promise‹void›


refresh#

refresh(opts: ClusterRefreshOptions): Promise‹void›

Defined in src/main/cluster.ts:419

internal

Parameters:

Name Type Default Description
opts ClusterRefreshOptions {} refresh options

Returns: Promise‹void›


refreshAllowedResources#

refreshAllowedResources(): Promise‹void›

Defined in src/main/cluster.ts:473

internal

Returns: Promise‹void›


refreshConnectionStatus#

refreshConnectionStatus(): Promise‹void›

Defined in src/main/cluster.ts:462

internal

Returns: Promise‹void›


refreshMetadata#

refreshMetadata(): Promise‹void›

Defined in src/main/cluster.ts:438

internal

Returns: Promise‹void›


setState#

setState(state: ClusterState): void

Defined in src/main/cluster.ts:652

internal

Parameters:

Name Type Description
state ClusterState cluster state

Returns: void


toJSON#

toJSON(): ClusterModel

Defined in src/main/cluster.ts:607

Returns: ClusterModel


Protected unbindEvents#

unbindEvents(): void

Defined in src/main/cluster.ts:341

internal

Returns: void


updateModel#

updateModel(model: ClusterModel): void

Defined in src/main/cluster.ts:285

Update cluster data model

Parameters:

Name Type Description
model ClusterModel

Returns: void