Skip to content

Commit

Permalink
Add missing values for services
Browse files Browse the repository at this point in the history
  • Loading branch information
ricoberger committed May 30, 2020
1 parent 1884b9b commit a33a9e5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IonChip, IonGrid, IonLabel, IonRow } from '@ionic/react';
import { V1Service, V1ServicePort } from '@kubernetes/client-node';
import { V1LoadBalancerIngress, V1Service, V1ServicePort } from '@kubernetes/client-node';
import React from 'react';
import { RouteComponentProps } from 'react-router';

Expand Down Expand Up @@ -55,6 +55,23 @@ const ServiceDetails: React.FunctionComponent<IServiceDetailsProps> = ({ item, t
})
}
/>
<Row
obj={item}
objKey="spec.loadBalancerSourceRanges"
title="Load Balancer Source Ranges"
value={(loadBalancerSourceRanges) =>
loadBalancerSourceRanges.map((loadBalancerSourceRange: string, index) => {
return (
<IonChip key={index} className="unset-chip-height">
<IonLabel>{loadBalancerSourceRange}</IonLabel>
</IonChip>
);
})
}
/>
<Row obj={item} objKey="spec.externalTrafficPolicy" title="External Traffic Policy" />
<Row obj={item} objKey="spec.healthCheckNodePort" title="Health Check Node Port" />
<Row obj={item} objKey="spec.publishNotReadyAddresses" title="Publish Not Ready Addresses" />
<Row obj={item} objKey="spec.sessionAffinity" title="Session Affinity" />
</Configuration>

Expand All @@ -75,6 +92,14 @@ const ServiceDetails: React.FunctionComponent<IServiceDetailsProps> = ({ item, t
}
defaultValue="None"
/>
<Row obj={item} objKey="spec.externalName" title="External Name" defaultValue="None" />
<Row obj={item} objKey="spec.loadBalancerIP" title="Load Balancer IP" />
<Row
obj={item}
objKey="status.loadBalancer.ingress"
title="Load Balancer"
value={(ingress: V1LoadBalancerIngress[]) => ingress.map((ing) => Object.values(ing).join(', '))}
/>
</Status>
</IonRow>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const ServiceItem: React.FunctionComponent<IServiceItemProps> = ({ item, section
Type: {item.spec && item.spec.type ? item.spec.type : '-'}
{item.spec && item.spec.clusterIP ? ` | Cluster IP: ${item.spec.clusterIP}` : ''}
{item.spec && item.spec.externalIPs ? ` | External IPs: ${item.spec.externalIPs.join(', ')}` : ''}
{item.spec && item.spec.externalName ? ` | External Name: ${item.spec.externalName}` : ''}
{item.spec && item.spec.loadBalancerIP ? ` | Load Balancer IP: ${item.spec.loadBalancerIP}` : ''}
{item.status && item.status.loadBalancer && item.status.loadBalancer.ingress
? ` | Load Balancer: ${item.status.loadBalancer.ingress.map((ing) => Object.values(ing).join(', '))}`
: ''}
{item.metadata && item.metadata.creationTimestamp
? ` | Age: ${timeDifference(
new Date().getTime(),
Expand Down

0 comments on commit a33a9e5

Please sign in to comment.