diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index cbd528ea3..1e0d3bdf7 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -13,6 +13,7 @@ - [REST API] _Rolling Pool Update_ action available `pools//actions/rolling_update` - [Self Service] Ability to set a default value for the "Share VM" feature for Self Service users during creation/edition (PR [#6838](https://github.com/vatesfr/xen-orchestra/pull/6838)) - [Self service] Add default tags to all VMs that will be created by a Self Service (PRs [#6810](https://github.com/vatesfr/xen-orchestra/pull/6810), [#6812](https://github.com/vatesfr/xen-orchestra/pull/6812)) +- [Kubernetes] Add the possibility to choose the number of fault tolerance for the control planes (PR [#6809](https://github.com/vatesfr/xen-orchestra/pull/6809)) ### Bug fixes diff --git a/packages/xo-web/src/common/intl/locales/it.js b/packages/xo-web/src/common/intl/locales/it.js index ec87861ad..420bd3d45 100644 --- a/packages/xo-web/src/common/intl/locales/it.js +++ b/packages/xo-web/src/common/intl/locales/it.js @@ -683,6 +683,21 @@ export default { // Original text: 'High Availability' highAvailability: 'Alta disponibilità', + // Original text: 'Control plane fault tolerance' + recipeFaultTolerance: 'Tolleranza ai guasti del piano di controllo', + + // Original text: 'No fault tolerance (one control plane)' + recipeNoneFaultTolerance: 'No fault tolerance (one control plane)', + + // Original text: 'One fault tolerance (three control planes)' + recipeOneFaultTolerance: 'Una tolleranza ai guasti (tre piani di controllo)', + + // Original text: 'Two fault tolerances (five control planes)' + recipeTwoFaultTolerance: 'Due tolleranze di errore (cinque piani di controllo)', + + // Original text: 'Three fault tolerances (seven control planes)' + recipeThreeFaultTolerance: 'Tre tolleranze di errore (sette piani di controllo)', + // Original text: 'Shared {type}' srSharedType: 'Condiviso {type}', diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index ee71f1970..4c2ea817e 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -2436,7 +2436,11 @@ const messages = { recipeNumberOfNodesLabel: 'Number of worker nodes', recipeSshKeyLabel: 'SSH key', recipeStaticIpAddresses: 'Static IP addresses', - recipeHighAvailability: 'High Availability Cluster', + recipeFaultTolerance: 'Control plane fault tolerance', + recipeNoneFaultTolerance: 'No fault tolerance (one control plane)', + recipeOneFaultTolerance: 'One fault tolerance (three control planes)', + recipeTwoFaultTolerance: 'Two fault tolerances (five control planes)', + recipeThreeFaultTolerance: 'Three fault tolerances (seven control planes)', recipeHaControPlaneIpAddress: 'Control plane { i, number } node IP address/subnet mask', recipeVip: 'VIP address', recipeControlPlaneIpAddress: 'Control plane node IP address/subnet mask', diff --git a/packages/xo-web/src/xo-app/hub/recipes/recipe-form.js b/packages/xo-web/src/xo-app/hub/recipes/recipe-form.js index a08009e0e..4b3fdd1bb 100644 --- a/packages/xo-web/src/xo-app/hub/recipes/recipe-form.js +++ b/packages/xo-web/src/xo-app/hub/recipes/recipe-form.js @@ -8,6 +8,26 @@ import { injectIntl } from 'react-intl' import { injectState, provideState } from 'reaclette' import { isSrWritable } from 'xo' import { SelectPool, SelectNetwork, SelectSr } from 'select-objects' +import { Select } from 'form' + +const FAULT_TOLERANCE = [ + { + label: _('recipeNoneFaultTolerance'), + value: 0, + }, + { + label: _('recipeOneFaultTolerance'), + value: 1, + }, + { + label: _('recipeTwoFaultTolerance'), + value: 2, + }, + { + label: _('recipeThreeFaultTolerance'), + value: 3, + }, +] export default decorate([ injectIntl, @@ -42,6 +62,15 @@ export default decorate([ [name]: value, }) }, + onChangeFaultTolerance(__, faultTolerance) { + const { onChange, value } = this.props + onChange({ + ...value, + faultTolerance: faultTolerance.value, + // n * 2 + 1 is the formula to meet the quorum of RAFT consensus algorithm + controlPlanePoolSize: faultTolerance.value * 2 + 1, + }) + }, onChangeWorkerIp(__, ev) { const { name, value } = ev.target const { onChange, value: prevValue } = this.props @@ -149,17 +178,15 @@ export default decorate([ /> - + + - - )), - - - - , - ], - !value.highAvailability && [ - - - - , - ], + value.faultTolerance > 0 + ? [ + Array.from({ length: value.controlPlanePoolSize }).map((v, i) => ( + + + + + )), + + + + , + ] + : [ + + + + , + ],