1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

address review comments, added vpa endpoint to endpoints export list

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2023-01-27 16:37:27 -05:00
parent a55a37b29f
commit 7158a2b291
6 changed files with 46 additions and 29 deletions

View File

@ -8,6 +8,7 @@ import type { DerivedKubeApiOptions, KubeApiDependencies } from "../kube-api";
import { KubeApi } from "../kube-api"; import { KubeApi } from "../kube-api";
import type { BaseKubeObjectCondition, LabelSelector, NamespaceScopedMetadata } from "../kube-object"; import type { BaseKubeObjectCondition, LabelSelector, NamespaceScopedMetadata } from "../kube-object";
import { KubeObject } from "../kube-object"; import { KubeObject } from "../kube-object";
import type { CrossVersionObjectReference } from "./types/cross-version-object-reference";
export enum HpaMetricType { export enum HpaMetricType {
Resource = "Resource", Resource = "Resource",
@ -299,12 +300,6 @@ export type HorizontalPodAutoscalerMetricStatus =
| OptionVarient<HpaMetricType.Pods, BaseHorizontalPodAutoscalerMetricStatus, "pods"> | OptionVarient<HpaMetricType.Pods, BaseHorizontalPodAutoscalerMetricStatus, "pods">
| OptionVarient<HpaMetricType.ContainerResource, BaseHorizontalPodAutoscalerMetricStatus, "containerResource">; | OptionVarient<HpaMetricType.ContainerResource, BaseHorizontalPodAutoscalerMetricStatus, "containerResource">;
export interface CrossVersionObjectReference {
kind: string;
name: string;
apiVersion: string;
}
export interface HorizontalPodAutoscalerSpec { export interface HorizontalPodAutoscalerSpec {
scaleTargetRef: CrossVersionObjectReference; scaleTargetRef: CrossVersionObjectReference;
minReplicas?: number; minReplicas?: number;

View File

@ -44,3 +44,4 @@ export * from "./service-account.api";
export * from "./stateful-set.api"; export * from "./stateful-set.api";
export * from "./storage-class.api"; export * from "./storage-class.api";
export * from "./types"; export * from "./types";
export * from "./vertical-pod-autoscaler.api";

View File

@ -0,0 +1,11 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
export interface CrossVersionObjectReference {
kind: string;
name: string;
apiVersion: string;
}

View File

@ -7,6 +7,7 @@ export * from "./aggregation-rule";
export * from "./capabilities"; export * from "./capabilities";
export * from "./container"; export * from "./container";
export * from "./container-port"; export * from "./container-port";
export * from "./cross-version-object-reference";
export * from "./env-from-source"; export * from "./env-from-source";
export * from "./env-source"; export * from "./env-source";
export * from "./env-var-key-selector"; export * from "./env-var-key-selector";

View File

@ -7,12 +7,7 @@ import type { BaseKubeObjectCondition, NamespaceScopedMetadata } from "../kube-o
import { KubeObject } from "../kube-object"; import { KubeObject } from "../kube-object";
import type { DerivedKubeApiOptions, KubeApiDependencies } from "../kube-api"; import type { DerivedKubeApiOptions, KubeApiDependencies } from "../kube-api";
import { KubeApi } from "../kube-api"; import { KubeApi } from "../kube-api";
import type { CrossVersionObjectReference } from "./types/cross-version-object-reference";
export interface CrossVersionObjectReference {
kind: string;
name: string;
apiVersion?: string;
}
export enum ResourceName { export enum ResourceName {
ResourceCPU = "cpu", ResourceCPU = "cpu",
@ -52,7 +47,10 @@ export enum ControlledValues {
ControlledValueRequestsOnly = "RequestsOnly", ControlledValueRequestsOnly = "RequestsOnly",
} }
// ContainerResourcePolicy controls how autoscaler computes the recommended resources for a specific container. /**
* ContainerResourcePolicy controls how autoscaler computes the recommended resources for
* a specific container.
*/
export interface ContainerResourcePolicy { export interface ContainerResourcePolicy {
containerName?: string; containerName?: string;
mode?: ContainerScalingMode; mode?: ContainerScalingMode;
@ -62,29 +60,41 @@ export interface ContainerResourcePolicy {
controlledValues?: ControlledValues; controlledValues?: ControlledValues;
} }
// Controls how the autoscaler computes recommended resources. /**
// The resource policy may be used to set constraints on the recommendations for individual containers. * Controls how the autoscaler computes recommended resources.
// If not specified, the autoscaler computes recommended resources for all containers in the pod, without additional constraints. * The resource policy may be used to set constraints on the recommendations for individual
* containers.
* If not specified, the autoscaler computes recommended resources for all containers in the
* pod, without additional constraints.
*/
export interface PodResourcePolicy { export interface PodResourcePolicy {
containerPolicies?: ContainerResourcePolicy[]; // Per-container resource policies. containerPolicies?: ContainerResourcePolicy[]; // Per-container resource policies.
} }
export enum UpdateMode { export enum UpdateMode {
// UpdateModeOff means that autoscaler never changes Pod resources. /**
// The recommender still sets the recommended resources in the * UpdateModeOff means that autoscaler never changes Pod resources.
// VerticalPodAutoscaler object. This can be used for a "dry run". * The recommender still sets the recommended resources in the
* VerticalPodAutoscaler object. This can be used for a "dry run".
*/
UpdateModeOff = "Off", UpdateModeOff = "Off",
// UpdateModeInitial means that autoscaler only assigns resources on pod /**
// creation and does not change them during the lifetime of the pod. * UpdateModeInitial means that autoscaler only assigns resources on pod
* creation and does not change them during the lifetime of the pod.
*/
UpdateModeInitial = "Initial", UpdateModeInitial = "Initial",
// UpdateModeRecreate means that autoscaler assigns resources on pod /**
// creation and additionally can update them during the lifetime of the * UpdateModeRecreate means that autoscaler assigns resources on pod
// pod by deleting and recreating the pod. * creation and additionally can update them during the lifetime of the
* pod by deleting and recreating the pod.
*/
UpdateModeRecreate = "Recreate", UpdateModeRecreate = "Recreate",
// UpdateModeAuto means that autoscaler assigns resources on pod creation /**
// and additionally can update them during the lifetime of the pod, * UpdateModeAuto means that autoscaler assigns resources on pod creation
// using any available update method. Currently this is equivalent to * and additionally can update them during the lifetime of the pod,
// Recreate, which is the only available update method. * using any available update method. Currently this is equivalent to
* Recreate, which is the only available update method.
*/
UpdateModeAuto = "Auto", UpdateModeAuto = "Auto",
} }
export interface PodUpdatePolicy { export interface PodUpdatePolicy {

View File

@ -8,7 +8,6 @@ import "./vpa.scss";
import React from "react"; import React from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { KubeObjectListLayout } from "../kube-object-list-layout"; import { KubeObjectListLayout } from "../kube-object-list-layout";
// import type { VerticalPodAutoscaler } from "../../../common/k8s-api/endpoints/vertical-pod-autoscaler.api";
import { Badge } from "../badge"; import { Badge } from "../badge";
import { cssNames, prevDefault } from "../../utils"; import { cssNames, prevDefault } from "../../utils";
import { KubeObjectStatusIcon } from "../kube-object-status-icon"; import { KubeObjectStatusIcon } from "../kube-object-status-icon";