import { get } from 'lodash'; import React from 'react'; import { HoverablePopover } from '@spinnaker/core'; import './manifestLabels.less'; // TODO(dpeach) https://github.com/spinnaker/spinnaker/issues/3239 export interface IManifestQosProps { manifest?: { status?: { qosClass?: string; }; }; } export class ManifestQos extends React.Component { private qosClass(): string { return get(this.props, ['manifest', 'status', 'qosClass'], 'Unknown'); } private qosStyle(): string { const qosClass = this.qosClass(); if (qosClass === 'Guaranteed') { return 'success'; } else if (qosClass === 'BestEffort') { return 'alert'; } else { return 'warn'; } } private description = () => { return (

There are three QOS (Quality of Service) classes:

Guaranteed: Pods are considered highest-priority, and will only be killed if they exceed their resource requests when other containers require their resources.

Burstable: Pods have some minimum guaranteed resources and can exceed them, but are more likely to be killed than Guaranteed pods.

BestEffort: These are the lowest-priority pods, and will be the first to be evicted when resources run out.

To understand how to set the QOS class of a pod, read{' '} the Kubernetes documentation .

); }; public render() { const style = `sp-badge ${this.qosStyle()}`; return (
{this.qosClass()}
); } }