@backstage/plugin-kubernetes-common 0.1.5 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @backstage/plugin-kubernetes-common
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7ac0bd2c66: implement dashboard link formatter for GKE
8
+
9
+ ## 0.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - c010632f88: Add pod metrics lookup and display in pod table.
14
+
15
+ ## Backwards incompatible changes
16
+
17
+ If your Kubernetes distribution does not have the [metrics server](https://github.com/kubernetes-sigs/metrics-server) installed,
18
+ you will need to set the `skipMetricsLookup` config flag to `false`.
19
+
20
+ See the [configuration docs](https://backstage.io/docs/features/kubernetes/configuration) for more details.
21
+
22
+ ## 0.1.7
23
+
24
+ ### Patch Changes
25
+
26
+ - 59677fadb1: Improvements to API Reference documentation
27
+
28
+ ## 0.1.6
29
+
30
+ ### Patch Changes
31
+
32
+ - 37dc844728: Include CronJobs and Jobs as default objects returned by the kubernetes backend and add/update relevant types.
33
+
3
34
  ## 0.1.5
4
35
 
5
36
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { V1Pod, V1Service, V1ConfigMap, V1Deployment, V1ReplicaSet, V1HorizontalPodAutoscaler, ExtensionsV1beta1Ingress } from '@kubernetes/client-node';
1
+ import { JsonObject } from '@backstage/types';
2
+ import { V1Pod, V1Service, V1ConfigMap, V1Deployment, V1ReplicaSet, V1HorizontalPodAutoscaler, V1Job, V1CronJob, V1Ingress } from '@kubernetes/client-node';
2
3
  import { Entity } from '@backstage/catalog-model';
3
4
 
4
5
  interface KubernetesRequestBody {
@@ -18,6 +19,7 @@ interface ClusterAttributes {
18
19
  * Note that you should specify the app used for the dashboard
19
20
  * using the dashboardApp property, in order to properly format
20
21
  * links to kubernetes resources, otherwise it will assume that you're running the standard one.
22
+ * Also, for cloud clusters such as GKE, you should provide addititonal parameters using dashboardParameters.
21
23
  * @see dashboardApp
22
24
  */
23
25
  dashboardUrl?: string;
@@ -37,17 +39,23 @@ interface ClusterAttributes {
37
39
  * ```
38
40
  */
39
41
  dashboardApp?: string;
42
+ /**
43
+ * Specifies specific parameters used by some dashboard URL formatters.
44
+ * This is used by the GKE formatter which requires the project, region and cluster name.
45
+ */
46
+ dashboardParameters?: JsonObject;
40
47
  }
41
48
  interface ClusterObjects {
42
49
  cluster: ClusterAttributes;
43
50
  resources: FetchResponse[];
51
+ podMetrics: ClientPodStatus[];
44
52
  errors: KubernetesFetchError[];
45
53
  }
46
54
  interface ObjectsByEntityResponse {
47
55
  items: ClusterObjects[];
48
56
  }
49
57
  declare type AuthProviderType = 'google' | 'serviceAccount' | 'aws';
50
- declare type FetchResponse = PodFetchResponse | ServiceFetchResponse | ConfigMapFetchResponse | DeploymentFetchResponse | ReplicaSetsFetchResponse | HorizontalPodAutoscalersFetchResponse | IngressesFetchResponse | CustomResourceFetchResponse;
58
+ declare type FetchResponse = PodFetchResponse | ServiceFetchResponse | ConfigMapFetchResponse | DeploymentFetchResponse | ReplicaSetsFetchResponse | HorizontalPodAutoscalersFetchResponse | JobsFetchResponse | CronJobsFetchResponse | IngressesFetchResponse | CustomResourceFetchResponse;
51
59
  interface PodFetchResponse {
52
60
  type: 'pods';
53
61
  resources: Array<V1Pod>;
@@ -72,9 +80,17 @@ interface HorizontalPodAutoscalersFetchResponse {
72
80
  type: 'horizontalpodautoscalers';
73
81
  resources: Array<V1HorizontalPodAutoscaler>;
74
82
  }
83
+ interface JobsFetchResponse {
84
+ type: 'jobs';
85
+ resources: Array<V1Job>;
86
+ }
87
+ interface CronJobsFetchResponse {
88
+ type: 'cronjobs';
89
+ resources: Array<V1CronJob>;
90
+ }
75
91
  interface IngressesFetchResponse {
76
92
  type: 'ingresses';
77
- resources: Array<ExtensionsV1beta1Ingress>;
93
+ resources: Array<V1Ingress>;
78
94
  }
79
95
  interface CustomResourceFetchResponse {
80
96
  type: 'customresources';
@@ -86,5 +102,21 @@ interface KubernetesFetchError {
86
102
  resourcePath?: string;
87
103
  }
88
104
  declare type KubernetesErrorTypes = 'BAD_REQUEST' | 'UNAUTHORIZED_ERROR' | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR';
105
+ interface ClientCurrentResourceUsage {
106
+ currentUsage: number | string;
107
+ requestTotal: number | string;
108
+ limitTotal: number | string;
109
+ }
110
+ interface ClientContainerStatus {
111
+ container: string;
112
+ cpuUsage: ClientCurrentResourceUsage;
113
+ memoryUsage: ClientCurrentResourceUsage;
114
+ }
115
+ interface ClientPodStatus {
116
+ pod: V1Pod;
117
+ cpu: ClientCurrentResourceUsage;
118
+ memory: ClientCurrentResourceUsage;
119
+ containers: ClientContainerStatus[];
120
+ }
89
121
 
90
- export { AuthProviderType, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CustomResourceFetchResponse, DeploymentFetchResponse, FetchResponse, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestBody, ObjectsByEntityResponse, PodFetchResponse, ReplicaSetsFetchResponse, ServiceFetchResponse };
122
+ export { AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomResourceFetchResponse, DeploymentFetchResponse, FetchResponse, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestBody, ObjectsByEntityResponse, PodFetchResponse, ReplicaSetsFetchResponse, ServiceFetchResponse };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-common",
3
3
  "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin",
4
- "version": "0.1.5",
4
+ "version": "0.2.1",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -35,17 +35,17 @@
35
35
  "url": "https://github.com/backstage/backstage/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@backstage/catalog-model": "^0.9.4",
39
- "@kubernetes/client-node": "^0.15.0"
38
+ "@backstage/catalog-model": "^0.9.7",
39
+ "@kubernetes/client-node": "^0.16.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@backstage/cli": "^0.7.15"
42
+ "@backstage/cli": "^0.10.5"
43
43
  },
44
44
  "jest": {
45
45
  "roots": [
46
46
  ".."
47
47
  ]
48
48
  },
49
- "gitHead": "16279cb3284369941e2eaf8b8968da207232cd6d",
49
+ "gitHead": "ffdb98aa2973366d48ff1774a7f892bc0c926e7e",
50
50
  "module": "dist/index.esm.js"
51
51
  }