import { UISref } from '@uirouter/react'; import { isEmpty, orderBy } from 'lodash'; import React from 'react'; import type { IServerGroup } from '@spinnaker/core'; import { CollapsibleSection, CopyToClipboard, HealthCounts, robotToHuman } from '@spinnaker/core'; import type { IKubernetesLoadBalancerDetailsSectionProps } from './IKubernetesLoadBalancerDetailsSectionProps'; export function LoadBalancerStatusSection({ loadBalancer }: IKubernetesLoadBalancerDetailsSectionProps) { const { manifest } = loadBalancer; return (
{isEmpty(loadBalancer.serverGroups) && (
No workloads associated with this {robotToHuman(loadBalancer.kind)}.
)} {!isEmpty(loadBalancer.serverGroups) && ( <>
Workloads
Pod status
)} {manifest.manifest.spec.clusterIP && (
Cluster IP
{manifest.manifest.spec.clusterIP}
)} {manifest.manifest.spec.loadBalancerIP && (
Load Balancer IP
{manifest.manifest.spec.loadBalancerIP}
)} {!isEmpty(manifest.manifest.spec.rules) && (
Host Rules
{manifest.manifest.spec.rules .filter((ingressRule: { host: string }) => Boolean(ingressRule.host?.trim())) .map((ingressRule: { host: string }) => (
{' '} {ingressRule.host}{' '}
))}
)} {!isEmpty(manifest.manifest.status.loadBalancer.ingress) && (
Ingress
{manifest.manifest.status.loadBalancer.ingress.map((ingress: { hostname: string; ip: string }) => (
{ingress.hostname && ( <> {' '} {ingress.hostname}{' '} )} {ingress.ip && ( <> {' '} {ingress.ip}{' '} )}
))}
)}
); }