@backstage/plugin-kubernetes-common 0.2.3 → 0.2.6

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,27 @@
1
1
  # @backstage/plugin-kubernetes-common
2
2
 
3
+ ## 0.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/catalog-model@0.12.0
9
+
10
+ ## 0.2.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @backstage/catalog-model@0.11.0
16
+
17
+ ## 0.2.4
18
+
19
+ ### Patch Changes
20
+
21
+ - Fix for the previous release with missing type declarations.
22
+ - Updated dependencies
23
+ - @backstage/catalog-model@0.10.1
24
+
3
25
  ## 0.2.3
4
26
 
5
27
  ### Patch Changes
@@ -0,0 +1,122 @@
1
+ import { JsonObject } from '@backstage/types';
2
+ import { V1Pod, V1Service, V1ConfigMap, V1Deployment, V1ReplicaSet, V1HorizontalPodAutoscaler, V1Job, V1CronJob, V1Ingress } from '@kubernetes/client-node';
3
+ import { Entity } from '@backstage/catalog-model';
4
+
5
+ interface KubernetesRequestBody {
6
+ auth?: {
7
+ google?: string;
8
+ };
9
+ entity: Entity;
10
+ }
11
+ interface ClusterAttributes {
12
+ /**
13
+ * Specifies the name of the Kubernetes cluster.
14
+ */
15
+ name: string;
16
+ /**
17
+ * Specifies the link to the Kubernetes dashboard managing this cluster.
18
+ * @remarks
19
+ * Note that you should specify the app used for the dashboard
20
+ * using the dashboardApp property, in order to properly format
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.
23
+ * @see dashboardApp
24
+ */
25
+ dashboardUrl?: string;
26
+ /**
27
+ * Specifies the app that provides the Kubernetes dashboard.
28
+ * This will be used for formatting links to kubernetes objects inside the dashboard.
29
+ * @remarks
30
+ * The supported dashboards are: standard, rancher, openshift, gke, aks, eks
31
+ * Note that it will default to the regular dashboard provided by the Kubernetes project (standard).
32
+ * Note that you can add your own formatter by registering it to the clusterLinksFormatters dictionary.
33
+ * @defaultValue standard
34
+ * @see dashboardUrl
35
+ * @example
36
+ * ```ts
37
+ * import { clusterLinksFormatters } from '@backstage/plugin-kubernetes';
38
+ * clusterLinksFormatters.myDashboard = (options) => ...;
39
+ * ```
40
+ */
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;
47
+ }
48
+ interface ClusterObjects {
49
+ cluster: ClusterAttributes;
50
+ resources: FetchResponse[];
51
+ podMetrics: ClientPodStatus[];
52
+ errors: KubernetesFetchError[];
53
+ }
54
+ interface ObjectsByEntityResponse {
55
+ items: ClusterObjects[];
56
+ }
57
+ declare type AuthProviderType = 'google' | 'serviceAccount' | 'aws';
58
+ declare type FetchResponse = PodFetchResponse | ServiceFetchResponse | ConfigMapFetchResponse | DeploymentFetchResponse | ReplicaSetsFetchResponse | HorizontalPodAutoscalersFetchResponse | JobsFetchResponse | CronJobsFetchResponse | IngressesFetchResponse | CustomResourceFetchResponse;
59
+ interface PodFetchResponse {
60
+ type: 'pods';
61
+ resources: Array<V1Pod>;
62
+ }
63
+ interface ServiceFetchResponse {
64
+ type: 'services';
65
+ resources: Array<V1Service>;
66
+ }
67
+ interface ConfigMapFetchResponse {
68
+ type: 'configmaps';
69
+ resources: Array<V1ConfigMap>;
70
+ }
71
+ interface DeploymentFetchResponse {
72
+ type: 'deployments';
73
+ resources: Array<V1Deployment>;
74
+ }
75
+ interface ReplicaSetsFetchResponse {
76
+ type: 'replicasets';
77
+ resources: Array<V1ReplicaSet>;
78
+ }
79
+ interface HorizontalPodAutoscalersFetchResponse {
80
+ type: 'horizontalpodautoscalers';
81
+ resources: Array<V1HorizontalPodAutoscaler>;
82
+ }
83
+ interface JobsFetchResponse {
84
+ type: 'jobs';
85
+ resources: Array<V1Job>;
86
+ }
87
+ interface CronJobsFetchResponse {
88
+ type: 'cronjobs';
89
+ resources: Array<V1CronJob>;
90
+ }
91
+ interface IngressesFetchResponse {
92
+ type: 'ingresses';
93
+ resources: Array<V1Ingress>;
94
+ }
95
+ interface CustomResourceFetchResponse {
96
+ type: 'customresources';
97
+ resources: Array<any>;
98
+ }
99
+ interface KubernetesFetchError {
100
+ errorType: KubernetesErrorTypes;
101
+ statusCode?: number;
102
+ resourcePath?: string;
103
+ }
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
+ }
121
+
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.2.3",
4
+ "version": "0.2.6",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -38,17 +38,17 @@
38
38
  "url": "https://github.com/backstage/backstage/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@backstage/catalog-model": "^0.10.0",
41
+ "@backstage/catalog-model": "^0.12.0",
42
42
  "@kubernetes/client-node": "^0.16.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@backstage/cli": "^0.14.0"
45
+ "@backstage/cli": "^0.15.0"
46
46
  },
47
47
  "jest": {
48
48
  "roots": [
49
49
  ".."
50
50
  ]
51
51
  },
52
- "gitHead": "4805c3d13ce9bfc369e53c271b1b95e722b3b4dc",
52
+ "gitHead": "04bb0dd824b78f6b57dac62c3015e681f094045c",
53
53
  "module": "dist/index.esm.js"
54
54
  }