Skip to content

Commit

Permalink
Add support for infrastructure availability policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyselov committed Mar 1, 2024
1 parent 3c90502 commit 726f934
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions libs/locales/lib/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@
"ai:Information & Troubleshooting": "Information & Troubleshooting",
"ai:Information and warnings": "Information and warnings",
"ai:Infrastructure": "Infrastructure",
"ai:Infrastructure availability policy": "Infrastructure availability policy",
"ai:Infrastructure env": "Infrastructure env",
"ai:Infrastructure environment details": "Infrastructure environment details",
"ai:Infrastructure environments are used by clusters. Create an infrastructure environment to add resources to your cluster.": "Infrastructure environments are used by clusters. Create an infrastructure environment to add resources to your cluster.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,39 @@ const HostsForm: React.FC<HostsFormProps> = ({
</FormGroup>
</GridItem>

<GridItem>
<FormGroup isInline label={<>{t('ai:Infrastructure availability policy')}</>} isRequired>
<RadioField
name={'infrastructureAvailabilityPolicy'}
label={
<>
{t('ai:Highly available')}{' '}
<PopoverIcon
bodyContent={t(
'ai:Highly available means components should be resilient to problems across fault boundaries as defined by the component to which the policy is attached. This usually means running critical workloads with 3 replicas and with little or no toleration of disruption of the component.',
)}
/>
</>
}
value={'HighlyAvailable'}
/>
<RadioField
name={'infrastructureAvailabilityPolicy'}
label={
<>
{t('ai:Single replica')}{' '}
<PopoverIcon
bodyContent={t(
'ai:Single replica means components are not expected to be resilient to problems across most fault boundaries associated with high availability. This usually means running critical workloads with just 1 replica and with toleration of full disruption of the component.',
)}
/>
</>
}
value={'SingleReplica'}
/>
</FormGroup>
</GridItem>

<GridItem>
<SelectField
label={t('ai:Namespace')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const HostsStep: React.FC<HostsStepProps> = ({
initReleaseImage,
nodePools,
controllerAvailabilityPolicy,
infrastructureAvailabilityPolicy,
}) => {
const { t } = useTranslation();
const availableAgents = getAgentsForSelection(agents);
Expand All @@ -80,6 +81,7 @@ const HostsStep: React.FC<HostsStepProps> = ({
<Formik<HostsFormValues>
initialValues={{
controllerAvailabilityPolicy: controllerAvailabilityPolicy || 'HighlyAvailable',
infrastructureAvailabilityPolicy: infrastructureAvailabilityPolicy || 'HighlyAvailable',
agentNamespace: initInfraEnv || infraEnvsWithAgents[0]?.metadata?.namespace || '',
nodePools: initNodePools || [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type NodePoolFormValue = {

export type HostsFormValues = {
controllerAvailabilityPolicy: string;
infrastructureAvailabilityPolicy: string;
agentNamespace: string;
nodePools: NodePoolFormValue[];
};
Expand All @@ -29,4 +30,5 @@ export type HostsStepProps = {
initNodePools?: NodePoolFormValue[];
nodePools: NodePoolK8sResource[];
controllerAvailabilityPolicy: string;
infrastructureAvailabilityPolicy: string;
};

0 comments on commit 726f934

Please sign in to comment.