@spinnaker/kubernetes 2025.1.4 → 2025.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/dist/index.js +37010 -4266
- package/dist/index.js.map +1 -1
- package/dist/interfaces/infrastructure.types.d.ts +4 -0
- package/dist/loadBalancer/details/KubernetesLoadBalancerActions.d.ts +7 -0
- package/dist/loadBalancer/details/sections/IKubernetesLoadBalancerDetailsSectionProps.d.ts +5 -0
- package/dist/loadBalancer/details/sections/LoadBalancerAnnotationCustomSection.d.ts +3 -0
- package/dist/loadBalancer/details/sections/LoadBalancerEventsSection.d.ts +3 -0
- package/dist/loadBalancer/details/sections/LoadBalancerInformationSection.d.ts +3 -0
- package/dist/loadBalancer/details/sections/LoadBalancerLabelsSection.d.ts +3 -0
- package/dist/loadBalancer/details/sections/LoadBalancerStatusSection.d.ts +3 -0
- package/dist/loadBalancer/details/sections/index.d.ts +6 -0
- package/dist/loadBalancer/details/useKubernetesLoadBalancerDetails.d.ts +3 -0
- package/dist/loadBalancer/index.d.ts +4 -1
- package/dist/loadBalancer/transformer.d.ts +5 -1
- package/dist/manifest/delete/Delete.d.ts +10 -0
- package/dist/manifest/delete/DeleteModal.d.ts +13 -0
- package/dist/manifest/rollout/PauseRollout.d.ts +9 -0
- package/dist/manifest/rollout/ResumeRollout.d.ts +9 -0
- package/dist/manifest/rollout/RollingRestart.d.ts +1 -0
- package/dist/manifest/rollout/UndoRollout.d.ts +9 -0
- package/dist/manifest/rollout/UndoRolloutModal.d.ts +12 -0
- package/dist/manifest/rollout/undo.controller.d.ts +4 -0
- package/dist/manifest/scale/Scale.d.ts +10 -0
- package/dist/manifest/scale/ScaleModal.d.ts +13 -0
- package/package.json +2 -2
- package/src/interfaces/infrastructure.types.ts +11 -0
- package/src/kubernetes.module.ts +30 -7
- package/src/loadBalancer/details/KubernetesLoadBalancerActions.tsx +68 -0
- package/src/loadBalancer/details/sections/IKubernetesLoadBalancerDetailsSectionProps.ts +6 -0
- package/src/loadBalancer/details/sections/LoadBalancerAnnotationCustomSection.tsx +9 -0
- package/src/loadBalancer/details/sections/LoadBalancerEventsSection.tsx +15 -0
- package/src/loadBalancer/details/sections/LoadBalancerInformationSection.tsx +28 -0
- package/src/loadBalancer/details/sections/LoadBalancerLabelsSection.tsx +15 -0
- package/src/loadBalancer/details/sections/LoadBalancerStatusSection.tsx +138 -0
- package/src/loadBalancer/details/sections/index.ts +6 -0
- package/src/loadBalancer/details/useKubernetesLoadBalancerDetails.ts +52 -0
- package/src/loadBalancer/index.ts +4 -1
- package/src/loadBalancer/transformer.ts +2 -13
- package/src/manifest/delete/Delete.tsx +34 -0
- package/src/manifest/delete/DeleteModal.tsx +152 -0
- package/src/manifest/editor/json/JsonEditor.tsx +3 -4
- package/src/manifest/rollout/PauseRollout.tsx +46 -0
- package/src/manifest/rollout/ResumeRollout.tsx +46 -0
- package/src/manifest/rollout/RollingRestart.tsx +21 -13
- package/src/manifest/rollout/UndoRollout.tsx +33 -0
- package/src/manifest/rollout/UndoRolloutModal.tsx +123 -0
- package/src/manifest/rollout/undo.controller.ts +1 -1
- package/src/manifest/scale/Scale.tsx +34 -0
- package/src/manifest/scale/ScaleModal.tsx +115 -0
- package/src/manifest/selector/ManifestSelector.spec.tsx +2 -3
- package/src/manifest/selector/ManifestSelector.tsx +1 -2
- package/src/rawResource/rawResource.dataSource.ts +20 -24
- package/src/securityGroup/transformer.ts +1 -5
- package/dist/loadBalancer/details/details.controller.d.ts +0 -1
- package/src/loadBalancer/details/details.controller.ts +0 -101
- package/src/loadBalancer/details/details.html +0 -187
|
@@ -13,6 +13,9 @@ export interface IKubernetesInstance extends IInstance, IKubernetesResource {
|
|
|
13
13
|
}
|
|
14
14
|
export interface IKubernetesLoadBalancer extends ILoadBalancer, IKubernetesResource {
|
|
15
15
|
}
|
|
16
|
+
export interface IKubernetesLoadBalancerView extends IKubernetesLoadBalancer {
|
|
17
|
+
manifest: IManifest;
|
|
18
|
+
}
|
|
16
19
|
export interface IKubernetesSecurityGroup extends ISecurityGroupDetail, IKubernetesResource {
|
|
17
20
|
account: string;
|
|
18
21
|
moniker: IMoniker;
|
|
@@ -25,3 +28,4 @@ export interface IKubernetesServerGroupView extends IKubernetesServerGroup {
|
|
|
25
28
|
}
|
|
26
29
|
export interface IKubernetesServerGroupManager extends IServerGroupManager, IKubernetesResource {
|
|
27
30
|
}
|
|
31
|
+
export type IAnyKubernetesResource = IKubernetesServerGroup | IKubernetesInstance | IKubernetesLoadBalancer | IKubernetesSecurityGroup | IKubernetesServerGroupManager;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ILoadBalancerActionsProps } from '@spinnaker/core';
|
|
3
|
+
import type { IKubernetesLoadBalancerView } from '../../interfaces';
|
|
4
|
+
export interface IKubernetesLoadBalancerActionsProps extends ILoadBalancerActionsProps {
|
|
5
|
+
loadBalancer: IKubernetesLoadBalancerView;
|
|
6
|
+
}
|
|
7
|
+
export declare function KubernetesLoadBalancerActions({ app, loadBalancer }: IKubernetesLoadBalancerActionsProps): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ILoadBalancerDetailsSectionProps } from '@spinnaker/core';
|
|
2
|
+
import type { IKubernetesLoadBalancerView } from '../../../interfaces';
|
|
3
|
+
export interface IKubernetesLoadBalancerDetailsSectionProps extends ILoadBalancerDetailsSectionProps {
|
|
4
|
+
loadBalancer: IKubernetesLoadBalancerView;
|
|
5
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
3
|
+
export declare function LoadBalancerAnnotationCustomSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps): JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
3
|
+
export declare function LoadBalancerInformationSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps): JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
2
|
+
export * from './LoadBalancerAnnotationCustomSection';
|
|
3
|
+
export * from './LoadBalancerEventsSection';
|
|
4
|
+
export * from './LoadBalancerInformationSection';
|
|
5
|
+
export * from './LoadBalancerLabelsSection';
|
|
6
|
+
export * from './LoadBalancerStatusSection';
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IKubernetesLoadBalancer } from '../interfaces';
|
|
2
|
+
export declare class KubernetesLoadBalancerTransformer {
|
|
3
|
+
normalizeLoadBalancer(loadBalancer: IKubernetesLoadBalancer): PromiseLike<IKubernetesLoadBalancer>;
|
|
4
|
+
private buildInstanceCounts;
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IDeleteProps {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
manifestController: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function Delete(props: IDeleteProps): JSX.Element;
|
|
10
|
+
export declare const KUBERNETES_DELETE = "spinnaker.kubernetes.delete";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application, IModalComponentProps, IModalProps } from '@spinnaker/core';
|
|
3
|
+
import type { IDeleteOptions } from './delete.controller';
|
|
4
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
5
|
+
export interface IKubernetesDeleteModalProps extends Pick<IModalProps, 'isOpen'>, Pick<IModalComponentProps, 'dismissModal'> {
|
|
6
|
+
application: Application;
|
|
7
|
+
resource: IAnyKubernetesResource;
|
|
8
|
+
manifestController: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface IKubernetesDeleteValues extends IDeleteOptions {
|
|
11
|
+
reason?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function DeleteModal({ application, resource, manifestController, isOpen, dismissModal, }: IKubernetesDeleteModalProps): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IPauseRolloutProps {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
}
|
|
8
|
+
export declare function PauseRollout({ application, resource }: IPauseRolloutProps): JSX.Element;
|
|
9
|
+
export declare const KUBERNETES_PAUSE_ROLLOUT = "spinnaker.kubernetes.pause.rollout";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IResumeRolloutProps {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
}
|
|
8
|
+
export declare function ResumeRollout({ application, resource }: IResumeRolloutProps): JSX.Element;
|
|
9
|
+
export declare const KUBERNETES_RESUME_ROLLOUT = "spinnaker.kubernetes.resume.rollout";
|
|
@@ -6,4 +6,5 @@ interface IRollingRestartProps {
|
|
|
6
6
|
serverGroupManager: IKubernetesServerGroupManager;
|
|
7
7
|
}
|
|
8
8
|
export declare function RollingRestart({ application, serverGroupManager }: IRollingRestartProps): JSX.Element;
|
|
9
|
+
export declare const KUBERNETES_ROLLING_RESTART = "spinnaker.kubernetes.v2.rolling.restart";
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IUndoRolloutProps {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
}
|
|
8
|
+
export declare function UndoRollout(props: IUndoRolloutProps): JSX.Element;
|
|
9
|
+
export declare const KUBERNETES_UNDO_ROLLOUT = "spinnaker.kubernetes.undo.rollout";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application, IModalComponentProps, IModalProps } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IKubernetesUndoRolloutModalProps extends Pick<IModalProps, 'isOpen'>, Pick<IModalComponentProps, 'dismissModal'> {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
}
|
|
8
|
+
export interface IKubernetesUndoRolloutValues {
|
|
9
|
+
revision?: number;
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function UndoRolloutModal({ application, resource, isOpen, dismissModal }: IKubernetesUndoRolloutModalProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IScaleProps {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
currentReplicas: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function Scale(props: IScaleProps): JSX.Element;
|
|
10
|
+
export declare const KUBERNETES_SCALE = "spinnaker.kubernetes.scale";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Application, IModalComponentProps, IModalProps } from '@spinnaker/core';
|
|
3
|
+
import type { IAnyKubernetesResource } from '../../interfaces';
|
|
4
|
+
export interface IKubernetesScaleModalProps extends Pick<IModalProps, 'isOpen'>, Pick<IModalComponentProps, 'dismissModal'> {
|
|
5
|
+
application: Application;
|
|
6
|
+
resource: IAnyKubernetesResource;
|
|
7
|
+
currentReplicas: number;
|
|
8
|
+
}
|
|
9
|
+
export interface IKubernetesScaleValues {
|
|
10
|
+
reason?: string;
|
|
11
|
+
replicas: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function ScaleModal({ application, resource, currentReplicas, isOpen, dismissModal, }: IKubernetesScaleModalProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinnaker/kubernetes",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2025.1
|
|
4
|
+
"version": "2025.2.1",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"publishConfig": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"shx": "0.3.3",
|
|
55
55
|
"typescript": "5.0.4"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "33bad18275d63c4000a8e757cc0b4816e2e7eed5"
|
|
58
58
|
}
|
|
@@ -24,6 +24,10 @@ export interface IKubernetesInstance extends IInstance, IKubernetesResource {
|
|
|
24
24
|
|
|
25
25
|
export interface IKubernetesLoadBalancer extends ILoadBalancer, IKubernetesResource {}
|
|
26
26
|
|
|
27
|
+
export interface IKubernetesLoadBalancerView extends IKubernetesLoadBalancer {
|
|
28
|
+
manifest: IManifest;
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
export interface IKubernetesSecurityGroup extends ISecurityGroupDetail, IKubernetesResource {
|
|
28
32
|
account: string;
|
|
29
33
|
moniker: IMoniker;
|
|
@@ -38,3 +42,10 @@ export interface IKubernetesServerGroupView extends IKubernetesServerGroup {
|
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
export interface IKubernetesServerGroupManager extends IServerGroupManager, IKubernetesResource {}
|
|
45
|
+
|
|
46
|
+
export type IAnyKubernetesResource =
|
|
47
|
+
| IKubernetesServerGroup
|
|
48
|
+
| IKubernetesInstance
|
|
49
|
+
| IKubernetesLoadBalancer
|
|
50
|
+
| IKubernetesSecurityGroup
|
|
51
|
+
| IKubernetesServerGroupManager;
|
package/src/kubernetes.module.ts
CHANGED
|
@@ -9,10 +9,19 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import './help/kubernetes.help';
|
|
11
11
|
import { KUBERNETES_INSTANCE_DETAILS_CTRL } from './instance/details/details.controller';
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import {
|
|
13
|
+
KubernetesLoadBalancerActions,
|
|
14
|
+
KubernetesLoadBalancerTransformer,
|
|
15
|
+
LoadBalancerAnnotationCustomSection,
|
|
16
|
+
LoadBalancerEventsSection,
|
|
17
|
+
LoadBalancerInformationSection,
|
|
18
|
+
LoadBalancerLabelsSection,
|
|
19
|
+
LoadBalancerStatusSection,
|
|
20
|
+
useKubernetesLoadBalancerDetails,
|
|
21
|
+
} from './loadBalancer';
|
|
14
22
|
import kubernetesLogo from './logo/kubernetes.logo.svg';
|
|
15
23
|
import { KUBERNETES_ANNOTATION_CUSTOM_SECTIONS } from './manifest/annotationCustomSections.component';
|
|
24
|
+
import { KUBERNETES_DELETE } from './manifest/delete/Delete';
|
|
16
25
|
import { KUBERNETES_MANIFEST_DELETE_CTRL } from './manifest/delete/delete.controller';
|
|
17
26
|
import { JSON_EDITOR_COMPONENT } from './manifest/editor/json/jsonEditor.component';
|
|
18
27
|
import { KUBERNETES_MANIFEST_EVENTS } from './manifest/manifestEvents.component';
|
|
@@ -20,9 +29,13 @@ import { KUBERNETES_MANIFEST_IMAGE_DETAILS } from './manifest/manifestImageDetai
|
|
|
20
29
|
import { KUBERNETES_MANIFEST_LABELS } from './manifest/manifestLabels.component';
|
|
21
30
|
import { KUBERNETES_MANIFEST_QOS } from './manifest/manifestQos.component';
|
|
22
31
|
import { KUBERNETES_MANIFEST_RESOURCES } from './manifest/manifestResources.component';
|
|
32
|
+
import { KUBERNETES_PAUSE_ROLLOUT } from './manifest/rollout/PauseRollout';
|
|
33
|
+
import { KUBERNETES_RESUME_ROLLOUT } from './manifest/rollout/ResumeRollout';
|
|
34
|
+
import { KUBERNETES_UNDO_ROLLOUT } from './manifest/rollout/UndoRollout';
|
|
23
35
|
import { KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL } from './manifest/rollout/pause.controller';
|
|
24
36
|
import { KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL } from './manifest/rollout/resume.controller';
|
|
25
37
|
import { KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL } from './manifest/rollout/undo.controller';
|
|
38
|
+
import { KUBERNETES_SCALE } from './manifest/scale/Scale';
|
|
26
39
|
import { KUBERNETES_MANIFEST_SCALE_CTRL } from './manifest/scale/scale.controller';
|
|
27
40
|
import { KUBERNETES_MANIFEST_SELECTOR } from './manifest/selector/selector.component';
|
|
28
41
|
import { KUBERNETES_MANIFEST_CONDITION } from './manifest/status/condition.component';
|
|
@@ -60,9 +73,13 @@ import './logo/kubernetes.logo.less';
|
|
|
60
73
|
export const KUBERNETES_MODULE = 'spinnaker.kubernetes';
|
|
61
74
|
|
|
62
75
|
const requires = [
|
|
76
|
+
KUBERNETES_DELETE,
|
|
77
|
+
KUBERNETES_PAUSE_ROLLOUT,
|
|
78
|
+
KUBERNETES_RESUME_ROLLOUT,
|
|
79
|
+
KUBERNETES_UNDO_ROLLOUT,
|
|
80
|
+
KUBERNETES_SCALE,
|
|
63
81
|
KUBERNETES_REACT_MODULE,
|
|
64
82
|
KUBERNETES_INSTANCE_DETAILS_CTRL,
|
|
65
|
-
KUBERNETES_LOAD_BALANCER_DETAILS_CTRL,
|
|
66
83
|
KUBERNETES_SECURITY_GROUP_DETAILS_CTRL,
|
|
67
84
|
KUBERNETES_MANIFEST_DELETE_CTRL,
|
|
68
85
|
KUBERNETES_MANIFEST_SCALE_CTRL,
|
|
@@ -71,7 +88,6 @@ const requires = [
|
|
|
71
88
|
KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL,
|
|
72
89
|
KUBERNETES_MANIFEST_STATUS,
|
|
73
90
|
KUBERNETES_MANIFEST_CONDITION,
|
|
74
|
-
KUBERNETES_LOAD_BALANCER_TRANSFORMER,
|
|
75
91
|
KUBERNETES_SECURITY_GROUP_TRANSFORMER,
|
|
76
92
|
KUBERNETES_MANIFEST_SELECTOR,
|
|
77
93
|
KUBERNETES_MANIFEST_LABELS,
|
|
@@ -121,9 +137,16 @@ module(KUBERNETES_MODULE, requires).config(() => {
|
|
|
121
137
|
},
|
|
122
138
|
loadBalancer: {
|
|
123
139
|
CreateLoadBalancerModal: ManifestWizard,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
140
|
+
useDetailsHook: useKubernetesLoadBalancerDetails,
|
|
141
|
+
detailsActions: KubernetesLoadBalancerActions,
|
|
142
|
+
detailsSections: [
|
|
143
|
+
LoadBalancerInformationSection,
|
|
144
|
+
LoadBalancerStatusSection,
|
|
145
|
+
LoadBalancerAnnotationCustomSection,
|
|
146
|
+
LoadBalancerEventsSection,
|
|
147
|
+
LoadBalancerLabelsSection,
|
|
148
|
+
],
|
|
149
|
+
transformer: KubernetesLoadBalancerTransformer,
|
|
127
150
|
},
|
|
128
151
|
securityGroup: {
|
|
129
152
|
reader: KubernetesSecurityGroupReader,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dropdown, MenuItem } from 'react-bootstrap';
|
|
3
|
+
|
|
4
|
+
import type { ILoadBalancerActionsProps } from '@spinnaker/core';
|
|
5
|
+
import { AddEntityTagLinks, ModalInjector, robotToHuman, SETTINGS } from '@spinnaker/core';
|
|
6
|
+
|
|
7
|
+
import type { IKubernetesLoadBalancerView } from '../../interfaces';
|
|
8
|
+
import { KubernetesManifestCommandBuilder } from '../../manifest';
|
|
9
|
+
import { ManifestWizard } from '../../manifest/wizard/ManifestWizard';
|
|
10
|
+
|
|
11
|
+
export interface IKubernetesLoadBalancerActionsProps extends ILoadBalancerActionsProps {
|
|
12
|
+
loadBalancer: IKubernetesLoadBalancerView;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function KubernetesLoadBalancerActions({ app, loadBalancer }: IKubernetesLoadBalancerActionsProps) {
|
|
16
|
+
const showEntityTags = SETTINGS.feature && SETTINGS.feature.entityTags;
|
|
17
|
+
const isEnabled = SETTINGS.kubernetesAdHocInfraWritesEnabled;
|
|
18
|
+
const { manifest } = loadBalancer;
|
|
19
|
+
|
|
20
|
+
const deleteLoadBalancer = (): void => {
|
|
21
|
+
ModalInjector.modalService.open({
|
|
22
|
+
templateUrl: require('../../manifest/delete/delete.html'),
|
|
23
|
+
controller: 'kubernetesV2ManifestDeleteCtrl as ctrl',
|
|
24
|
+
resolve: {
|
|
25
|
+
coordinates: {
|
|
26
|
+
name: loadBalancer.name,
|
|
27
|
+
namespace: loadBalancer.namespace,
|
|
28
|
+
account: loadBalancer.account,
|
|
29
|
+
},
|
|
30
|
+
application: app,
|
|
31
|
+
manifestController: (): string => null,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const editLoadBalancer = (): void => {
|
|
37
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(
|
|
38
|
+
app,
|
|
39
|
+
manifest.manifest,
|
|
40
|
+
loadBalancer.moniker,
|
|
41
|
+
loadBalancer.account,
|
|
42
|
+
).then((builtCommand) => {
|
|
43
|
+
ManifestWizard.show({ title: 'Edit Manifest', application: app, command: builtCommand });
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Dropdown className="dropdown" id="load-balancer-actions-dropdown">
|
|
49
|
+
{isEnabled && (
|
|
50
|
+
<Dropdown.Toggle className="btn btn-sm btn-primary dropdown-toggle">
|
|
51
|
+
{robotToHuman(loadBalancer.kind)} Actions
|
|
52
|
+
</Dropdown.Toggle>
|
|
53
|
+
)}
|
|
54
|
+
<Dropdown.Menu>
|
|
55
|
+
<MenuItem onClick={deleteLoadBalancer}>Delete</MenuItem>
|
|
56
|
+
<MenuItem onClick={editLoadBalancer}>Edit</MenuItem>
|
|
57
|
+
{showEntityTags && (
|
|
58
|
+
<AddEntityTagLinks
|
|
59
|
+
component={loadBalancer}
|
|
60
|
+
application={app}
|
|
61
|
+
entityType="loadBalancer"
|
|
62
|
+
onUpdate={() => app.loadBalancers.refresh()}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
</Dropdown.Menu>
|
|
66
|
+
</Dropdown>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ILoadBalancerDetailsSectionProps } from '@spinnaker/core';
|
|
2
|
+
import type { IKubernetesLoadBalancerView } from '../../../interfaces';
|
|
3
|
+
|
|
4
|
+
export interface IKubernetesLoadBalancerDetailsSectionProps extends ILoadBalancerDetailsSectionProps {
|
|
5
|
+
loadBalancer: IKubernetesLoadBalancerView;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
3
|
+
import { KubernetesReactInjector } from '../../../reactShims';
|
|
4
|
+
|
|
5
|
+
export function LoadBalancerAnnotationCustomSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps) {
|
|
6
|
+
const { manifest } = loadBalancer;
|
|
7
|
+
const { KubernetesAnnotationCustomSections } = KubernetesReactInjector;
|
|
8
|
+
return <KubernetesAnnotationCustomSections manifest={manifest.manifest} resource={loadBalancer} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { CollapsibleSection } from '@spinnaker/core';
|
|
4
|
+
|
|
5
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
6
|
+
import { ManifestEvents } from '../../../pipelines/stages/deployManifest/manifestStatus/ManifestEvents';
|
|
7
|
+
|
|
8
|
+
export function LoadBalancerEventsSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps) {
|
|
9
|
+
const { manifest } = loadBalancer;
|
|
10
|
+
return (
|
|
11
|
+
<CollapsibleSection heading="Events" defaultExpanded={true}>
|
|
12
|
+
<ManifestEvents manifest={manifest} />
|
|
13
|
+
</CollapsibleSection>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccountTag, CollapsibleSection, timestamp } from '@spinnaker/core';
|
|
3
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
4
|
+
|
|
5
|
+
export function LoadBalancerInformationSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps) {
|
|
6
|
+
const { manifest } = loadBalancer;
|
|
7
|
+
const spec = manifest?.manifest?.spec ?? {};
|
|
8
|
+
return (
|
|
9
|
+
<CollapsibleSection heading="Information" defaultExpanded={true}>
|
|
10
|
+
<dl className="dl-horizontal dl-narrow">
|
|
11
|
+
<dt>Created</dt>
|
|
12
|
+
<dd>{timestamp(loadBalancer.createdTime)}</dd>
|
|
13
|
+
<dt>Account</dt>
|
|
14
|
+
<dd>
|
|
15
|
+
<AccountTag account={loadBalancer.account} />
|
|
16
|
+
</dd>
|
|
17
|
+
<dt>Namespace</dt>
|
|
18
|
+
<dd>{loadBalancer.namespace}</dd>
|
|
19
|
+
<dt>Kind</dt>
|
|
20
|
+
<dd>{loadBalancer.kind}</dd>
|
|
21
|
+
<dt>Service Type</dt>
|
|
22
|
+
<dd>{spec.type || '-'}</dd>
|
|
23
|
+
<dt>Sess. Affinity</dt>
|
|
24
|
+
<dd>{spec.sessionAffinity || '-'}</dd>
|
|
25
|
+
</dl>
|
|
26
|
+
</CollapsibleSection>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { CollapsibleSection } from '@spinnaker/core';
|
|
4
|
+
|
|
5
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
6
|
+
import { ManifestLabels } from '../../../manifest/ManifestLabels';
|
|
7
|
+
|
|
8
|
+
export function LoadBalancerLabelsSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps) {
|
|
9
|
+
const { manifest } = loadBalancer;
|
|
10
|
+
return (
|
|
11
|
+
<CollapsibleSection heading="Labels" defaultExpanded={true}>
|
|
12
|
+
<ManifestLabels manifest={manifest.manifest} />
|
|
13
|
+
</CollapsibleSection>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { UISref } from '@uirouter/react';
|
|
2
|
+
import { isEmpty, orderBy } from 'lodash';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import type { IServerGroup } from '@spinnaker/core';
|
|
6
|
+
import { CollapsibleSection, CopyToClipboard, HealthCounts, robotToHuman } from '@spinnaker/core';
|
|
7
|
+
|
|
8
|
+
import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
9
|
+
|
|
10
|
+
export function LoadBalancerStatusSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps) {
|
|
11
|
+
const { manifest } = loadBalancer;
|
|
12
|
+
return (
|
|
13
|
+
<CollapsibleSection heading="Status" defaultExpanded={true}>
|
|
14
|
+
<dl className="dl-horizontal dl-narrow">
|
|
15
|
+
{isEmpty(loadBalancer.serverGroups) && (
|
|
16
|
+
<div>No workloads associated with this {robotToHuman(loadBalancer.kind)}.</div>
|
|
17
|
+
)}
|
|
18
|
+
{!isEmpty(loadBalancer.serverGroups) && (
|
|
19
|
+
<>
|
|
20
|
+
<dt>Workloads</dt>
|
|
21
|
+
<dd>
|
|
22
|
+
<ul>
|
|
23
|
+
{orderBy(loadBalancer.serverGroups, ['isDisabled', 'name'], ['asc', 'desc']).map(
|
|
24
|
+
(serverGroup: IServerGroup) => (
|
|
25
|
+
<li key={serverGroup.name}>
|
|
26
|
+
<UISref
|
|
27
|
+
to="^.serverGroup"
|
|
28
|
+
params={{
|
|
29
|
+
region: serverGroup.region,
|
|
30
|
+
accountId: serverGroup.account,
|
|
31
|
+
serverGroup: serverGroup.name,
|
|
32
|
+
provider: 'kubernetes',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<a>{robotToHuman(serverGroup.name)}</a>
|
|
36
|
+
</UISref>
|
|
37
|
+
</li>
|
|
38
|
+
),
|
|
39
|
+
)}
|
|
40
|
+
</ul>
|
|
41
|
+
</dd>
|
|
42
|
+
<div>
|
|
43
|
+
<dt>Pod status</dt>
|
|
44
|
+
<dd>
|
|
45
|
+
<HealthCounts className="pull-left" container={loadBalancer.instanceCounts} />
|
|
46
|
+
</dd>
|
|
47
|
+
</div>
|
|
48
|
+
</>
|
|
49
|
+
)}
|
|
50
|
+
{manifest.manifest.spec.clusterIP && (
|
|
51
|
+
<div>
|
|
52
|
+
<dt>Cluster IP</dt>
|
|
53
|
+
<dd>
|
|
54
|
+
<a target="_blank" href={`//${manifest.manifest.spec.clusterIP}`}>
|
|
55
|
+
{manifest.manifest.spec.clusterIP}
|
|
56
|
+
</a>
|
|
57
|
+
<CopyToClipboard
|
|
58
|
+
className="sp-margin-s-left copy-to-clipboard copy-to-clipboard-sm"
|
|
59
|
+
text={manifest.manifest.spec.clusterIP}
|
|
60
|
+
toolTip="Copy Cluster IP to clipboard"
|
|
61
|
+
/>
|
|
62
|
+
</dd>
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
{manifest.manifest.spec.loadBalancerIP && (
|
|
66
|
+
<div>
|
|
67
|
+
<dt>Load Balancer IP</dt>
|
|
68
|
+
<dd>
|
|
69
|
+
<a target="_blank" href={`//${manifest.manifest.spec.loadBalancerIP}`}>
|
|
70
|
+
{manifest.manifest.spec.loadBalancerIP}
|
|
71
|
+
</a>
|
|
72
|
+
<CopyToClipboard
|
|
73
|
+
className="sp-margin-s-left copy-to-clipboard copy-to-clipboard-sm"
|
|
74
|
+
text={manifest.manifest.spec.loadBalancerIP}
|
|
75
|
+
toolTip="Copy Load Balancer IP to clipboard"
|
|
76
|
+
/>
|
|
77
|
+
</dd>
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
{!isEmpty(manifest.manifest.spec.rules) && (
|
|
81
|
+
<div>
|
|
82
|
+
<dt>Host Rules</dt>
|
|
83
|
+
{manifest.manifest.spec.rules
|
|
84
|
+
.filter((ingressRule: { host: string }) => Boolean(ingressRule.host?.trim()))
|
|
85
|
+
.map((ingressRule: { host: string }) => (
|
|
86
|
+
<dd>
|
|
87
|
+
<a target="_blank" href={`//${ingressRule.host}`}>
|
|
88
|
+
{' '}
|
|
89
|
+
{ingressRule.host}{' '}
|
|
90
|
+
</a>
|
|
91
|
+
<CopyToClipboard
|
|
92
|
+
className="sp-margin-s-left copy-to-clipboard copy-to-clipboard-sm"
|
|
93
|
+
text={ingressRule.host}
|
|
94
|
+
toolTip="Copy ingress rule host to clipboard"
|
|
95
|
+
/>
|
|
96
|
+
</dd>
|
|
97
|
+
))}
|
|
98
|
+
</div>
|
|
99
|
+
)}
|
|
100
|
+
{!isEmpty(manifest.manifest.status.loadBalancer.ingress) && (
|
|
101
|
+
<div>
|
|
102
|
+
<dt>Ingress</dt>
|
|
103
|
+
{manifest.manifest.status.loadBalancer.ingress.map((ingress: { hostname: string; ip: string }) => (
|
|
104
|
+
<dd>
|
|
105
|
+
{ingress.hostname && (
|
|
106
|
+
<>
|
|
107
|
+
<a target="_blank" href={`//${ingress.hostname}`}>
|
|
108
|
+
{' '}
|
|
109
|
+
{ingress.hostname}{' '}
|
|
110
|
+
</a>
|
|
111
|
+
<CopyToClipboard
|
|
112
|
+
className="sp-margin-s-left copy-to-clipboard copy-to-clipboard-sm"
|
|
113
|
+
text={ingress.hostname}
|
|
114
|
+
toolTip="Copy Ingress hostname to clipboard"
|
|
115
|
+
/>
|
|
116
|
+
</>
|
|
117
|
+
)}
|
|
118
|
+
{ingress.ip && (
|
|
119
|
+
<>
|
|
120
|
+
<a target="_blank" href={`//${ingress.ip}`}>
|
|
121
|
+
{' '}
|
|
122
|
+
{ingress.ip}{' '}
|
|
123
|
+
</a>
|
|
124
|
+
<CopyToClipboard
|
|
125
|
+
className="sp-margin-s-left copy-to-clipboard copy-to-clipboard-sm"
|
|
126
|
+
text={ingress.ip}
|
|
127
|
+
toolTip="Copy Ingress IP to clipboard"
|
|
128
|
+
/>
|
|
129
|
+
</>
|
|
130
|
+
)}
|
|
131
|
+
</dd>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
134
|
+
)}
|
|
135
|
+
</dl>
|
|
136
|
+
</CollapsibleSection>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './IKubernetesLoadBalancerDetailsSectionProps';
|
|
2
|
+
export * from './LoadBalancerAnnotationCustomSection';
|
|
3
|
+
export * from './LoadBalancerEventsSection';
|
|
4
|
+
export * from './LoadBalancerInformationSection';
|
|
5
|
+
export * from './LoadBalancerLabelsSection';
|
|
6
|
+
export * from './LoadBalancerStatusSection';
|