mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Show all pod addresses (#2841)
Signed-off-by: vshakirova <vshakirova@mirantis.com>
This commit is contained in:
parent
fa4baf785d
commit
23dadaa1a1
@ -280,6 +280,9 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
}[];
|
}[];
|
||||||
hostIP: string;
|
hostIP: string;
|
||||||
podIP: string;
|
podIP: string;
|
||||||
|
podIPs?: {
|
||||||
|
ip: string
|
||||||
|
}[];
|
||||||
startTime: string;
|
startTime: string;
|
||||||
initContainerStatuses?: IPodContainerStatus[];
|
initContainerStatuses?: IPodContainerStatus[];
|
||||||
containerStatuses?: IPodContainerStatus[];
|
containerStatuses?: IPodContainerStatus[];
|
||||||
@ -490,6 +493,13 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
getSelectedNodeOs(): string | undefined {
|
getSelectedNodeOs(): string | undefined {
|
||||||
return this.spec.nodeSelector?.["kubernetes.io/os"] || this.spec.nodeSelector?.["beta.kubernetes.io/os"];
|
return this.spec.nodeSelector?.["kubernetes.io/os"] || this.spec.nodeSelector?.["beta.kubernetes.io/os"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIPs(): string[] {
|
||||||
|
if(!this.status.podIPs) return [];
|
||||||
|
const podIPs = this.status.podIPs;
|
||||||
|
|
||||||
|
return podIPs.map(value => value.ip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const podsApi = new PodsApi({
|
export const podsApi = new PodsApi({
|
||||||
|
|||||||
@ -50,12 +50,22 @@ export interface Service {
|
|||||||
spec: {
|
spec: {
|
||||||
type: string;
|
type: string;
|
||||||
clusterIP: string;
|
clusterIP: string;
|
||||||
|
clusterIPs?: string[];
|
||||||
externalTrafficPolicy?: string;
|
externalTrafficPolicy?: string;
|
||||||
|
externalName: string;
|
||||||
loadBalancerIP?: string;
|
loadBalancerIP?: string;
|
||||||
|
loadBalancerSourceRanges?: string[];
|
||||||
sessionAffinity: string;
|
sessionAffinity: string;
|
||||||
selector: { [key: string]: string };
|
selector: { [key: string]: string };
|
||||||
ports: ServicePort[];
|
ports: ServicePort[];
|
||||||
|
healthCheckNodePort?: number;
|
||||||
externalIPs?: string[]; // https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
|
externalIPs?: string[]; // https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
|
||||||
|
topologyKeys?: string[];
|
||||||
|
ipFamilies?: string[];
|
||||||
|
ipFamilyPolicy?: string;
|
||||||
|
allocateLoadBalancerNodePorts?: boolean;
|
||||||
|
loadBalancerClass?: string;
|
||||||
|
internalTrafficPolicy?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
status: {
|
status: {
|
||||||
@ -82,6 +92,10 @@ export class Service extends KubeObject {
|
|||||||
return this.spec.clusterIP;
|
return this.spec.clusterIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getClusterIps() {
|
||||||
|
return this.spec.clusterIPs || [];
|
||||||
|
}
|
||||||
|
|
||||||
getExternalIps() {
|
getExternalIps() {
|
||||||
const lb = this.getLoadBalancer();
|
const lb = this.getLoadBalancer();
|
||||||
|
|
||||||
@ -119,6 +133,14 @@ export class Service extends KubeObject {
|
|||||||
getStatus() {
|
getStatus() {
|
||||||
return this.isActive() ? "Active" : "Pending";
|
return this.isActive() ? "Active" : "Pending";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIpFamilies() {
|
||||||
|
return this.spec.ipFamilies || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
getIpFamilyPolicy() {
|
||||||
|
return this.spec.ipFamilyPolicy || "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const serviceApi = new KubeApi({
|
export const serviceApi = new KubeApi({
|
||||||
|
|||||||
@ -77,6 +77,22 @@ export class ServiceDetails extends React.Component<Props> {
|
|||||||
{spec.clusterIP}
|
{spec.clusterIP}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
|
||||||
|
<DrawerItem name="Cluster IPs" hidden={!service.getClusterIps().length} labelsOnly>
|
||||||
|
{
|
||||||
|
service.getClusterIps().map(label => (
|
||||||
|
<Badge key={label} label={label}/>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</DrawerItem>
|
||||||
|
|
||||||
|
<DrawerItem name="IP families" hidden={!service.getIpFamilies().length}>
|
||||||
|
{service.getIpFamilies().join(", ")}
|
||||||
|
</DrawerItem>
|
||||||
|
|
||||||
|
<DrawerItem name="IP family policy" hidden={!service.getIpFamilyPolicy()}>
|
||||||
|
{service.getIpFamilyPolicy()}
|
||||||
|
</DrawerItem>
|
||||||
|
|
||||||
{service.getExternalIps().length > 0 && (
|
{service.getExternalIps().length > 0 && (
|
||||||
<DrawerItem name="External IPs">
|
<DrawerItem name="External IPs">
|
||||||
{service.getExternalIps().map(ip => <div key={ip}>{ip}</div>)}
|
{service.getExternalIps().map(ip => <div key={ip}>{ip}</div>)}
|
||||||
|
|||||||
@ -90,6 +90,7 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
if (!pod) return null;
|
if (!pod) return null;
|
||||||
const { status, spec } = pod;
|
const { status, spec } = pod;
|
||||||
const { conditions, podIP } = status;
|
const { conditions, podIP } = status;
|
||||||
|
const podIPs = pod.getIPs();
|
||||||
const { nodeName } = spec;
|
const { nodeName } = spec;
|
||||||
const nodeSelector = pod.getNodeSelectors();
|
const nodeSelector = pod.getNodeSelectors();
|
||||||
const volumes = pod.getVolumes();
|
const volumes = pod.getVolumes();
|
||||||
@ -120,6 +121,13 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
<DrawerItem name="Pod IP">
|
<DrawerItem name="Pod IP">
|
||||||
{podIP}
|
{podIP}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
<DrawerItem name="Pod IPs" hidden={!podIPs.length} labelsOnly>
|
||||||
|
{
|
||||||
|
podIPs.map(label => (
|
||||||
|
<Badge key={label} label={label}/>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</DrawerItem>
|
||||||
<DrawerItem name="Priority Class">
|
<DrawerItem name="Priority Class">
|
||||||
{pod.getPriorityClassName()}
|
{pod.getPriorityClassName()}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user