|
|
@@ -8,6 +8,7 @@ import Container from "components/porter/Container";
|
|
|
import Expandable from "components/porter/Expandable";
|
|
|
import Image from "components/porter/Image";
|
|
|
import Input from "components/porter/Input";
|
|
|
+import PorterOperatorComponent from "components/porter/PorterOperatorComponent";
|
|
|
import Select from "components/porter/Select";
|
|
|
import Spacer from "components/porter/Spacer";
|
|
|
import Text from "components/porter/Text";
|
|
|
@@ -130,6 +131,160 @@ const NodeGroups: React.FC<Props> = ({
|
|
|
</Expandable>
|
|
|
);
|
|
|
})}
|
|
|
+ <PorterOperatorComponent>
|
|
|
+ <>
|
|
|
+ {displayableNodeGroups.MONITORING?.map((ng) => {
|
|
|
+ return (
|
|
|
+ <Expandable
|
|
|
+ preExpanded={isDefaultExpanded}
|
|
|
+ key={ng.nodeGroup.id}
|
|
|
+ header={
|
|
|
+ <Container row>
|
|
|
+ <Image src={world} />
|
|
|
+ <Spacer inline x={1} />
|
|
|
+ Monitoring node group
|
|
|
+ </Container>
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <Controller
|
|
|
+ name={`cluster.config.nodeGroups.${ng.idx}`}
|
|
|
+ control={control}
|
|
|
+ render={({ field: { value, onChange } }) => (
|
|
|
+ <>
|
|
|
+ <Select
|
|
|
+ width="300px"
|
|
|
+ options={availableMachineTypes
|
|
|
+ .filter((t) => !t.isGPU)
|
|
|
+ .map((t) => ({
|
|
|
+ value: t.name,
|
|
|
+ label: t.displayName,
|
|
|
+ }))}
|
|
|
+ value={value.instanceType}
|
|
|
+ setValue={(newInstanceType: string) => {
|
|
|
+ onChange({
|
|
|
+ ...value,
|
|
|
+ instanceType: newInstanceType,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ label="Machine type"
|
|
|
+ />
|
|
|
+ <Spacer y={1} />
|
|
|
+ <Text color="helper">
|
|
|
+ Minimum number of monitoring nodes
|
|
|
+ </Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Input
|
|
|
+ width="75px"
|
|
|
+ type="number"
|
|
|
+ disabled={false}
|
|
|
+ value={value.minInstances.toString()}
|
|
|
+ setValue={(newMinInstances: string) => {
|
|
|
+ onChange({
|
|
|
+ ...value,
|
|
|
+ minInstances: parseInt(newMinInstances),
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ placeholder="ex: 1"
|
|
|
+ />
|
|
|
+ <Spacer y={1} />
|
|
|
+ <Text color="helper">
|
|
|
+ Maximum number of monitoring nodes
|
|
|
+ </Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Input
|
|
|
+ width="75px"
|
|
|
+ type="number"
|
|
|
+ disabled={false}
|
|
|
+ value={value.maxInstances.toString()}
|
|
|
+ setValue={(newMaxInstances: string) => {
|
|
|
+ onChange({
|
|
|
+ ...value,
|
|
|
+ maxInstances: parseInt(newMaxInstances),
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ placeholder="ex: 10"
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ />
|
|
|
+ </Expandable>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ {displayableNodeGroups.SYSTEM?.map((ng) => {
|
|
|
+ return (
|
|
|
+ <Expandable
|
|
|
+ preExpanded={isDefaultExpanded}
|
|
|
+ key={ng.nodeGroup.id}
|
|
|
+ header={
|
|
|
+ <Container row>
|
|
|
+ <Image src={world} />
|
|
|
+ <Spacer inline x={1} />
|
|
|
+ System node group
|
|
|
+ </Container>
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <Controller
|
|
|
+ name={`cluster.config.nodeGroups.${ng.idx}`}
|
|
|
+ control={control}
|
|
|
+ render={({ field: { value, onChange } }) => (
|
|
|
+ <>
|
|
|
+ <Select
|
|
|
+ width="300px"
|
|
|
+ options={availableMachineTypes
|
|
|
+ .filter((t) => !t.isGPU)
|
|
|
+ .map((t) => ({
|
|
|
+ value: t.name,
|
|
|
+ label: t.displayName,
|
|
|
+ }))}
|
|
|
+ value={value.instanceType}
|
|
|
+ setValue={(newInstanceType: string) => {
|
|
|
+ onChange({
|
|
|
+ ...value,
|
|
|
+ instanceType: newInstanceType,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ label="Machine type"
|
|
|
+ />
|
|
|
+ <Spacer y={1} />
|
|
|
+ <Text color="helper">Minimum number of system nodes</Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Input
|
|
|
+ width="75px"
|
|
|
+ type="number"
|
|
|
+ disabled={false}
|
|
|
+ value={value.minInstances.toString()}
|
|
|
+ setValue={(newMinInstances: string) => {
|
|
|
+ onChange({
|
|
|
+ ...value,
|
|
|
+ minInstances: parseInt(newMinInstances),
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ placeholder="ex: 1"
|
|
|
+ />
|
|
|
+ <Spacer y={1} />
|
|
|
+ <Text color="helper">Maximum number of system nodes</Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Input
|
|
|
+ width="75px"
|
|
|
+ type="number"
|
|
|
+ disabled={false}
|
|
|
+ value={value.maxInstances.toString()}
|
|
|
+ setValue={(newMaxInstances: string) => {
|
|
|
+ onChange({
|
|
|
+ ...value,
|
|
|
+ maxInstances: parseInt(newMaxInstances),
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ placeholder="ex: 10"
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ />
|
|
|
+ </Expandable>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </>
|
|
|
+ </PorterOperatorComponent>
|
|
|
{displayableNodeGroups.CUSTOM?.map((ng) => {
|
|
|
return (
|
|
|
<Expandable
|