diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index c7c03b8c3..0a4a45977 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -564,7 +564,6 @@ query consoleGetNodePool($clusterName: String!, $poolName: String!) { } creationTime displayName - stateful kind lastUpdatedBy { userEmail @@ -614,6 +613,7 @@ query consoleGetNodePool($clusterName: String!, $poolName: String!) { cloudProvider maxCount minCount + nodeLabels } status { checks @@ -664,7 +664,6 @@ query consoleListNodePools($clusterName: String!, $search: SearchNodepool, $pagi } creationTime displayName - stateful lastUpdatedBy { userEmail userId @@ -707,6 +706,7 @@ query consoleListNodePools($clusterName: String!, $search: SearchNodepool, $pagi cloudProvider maxCount minCount + nodeLabels } status { checks diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/nodepools/handle-nodepool.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/nodepools/handle-nodepool.tsx index 72a75bedd..a9a18be6a 100644 --- a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/nodepools/handle-nodepool.tsx +++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/nodepools/handle-nodepool.tsx @@ -20,6 +20,7 @@ import { Switch } from '~/components/atoms/switch'; import { NameIdView } from '~/console/components/name-id-view'; import { findNodePlan, nodePlans, provisionTypes } from './nodepool-utils'; import { IClusterContext } from '../_layout'; +import {keyconstants} from "~/console/server/r-utils/key-constants"; type IDialog = IDialogBase>; @@ -53,7 +54,7 @@ const Root = (props: IDialog) => { taints: [], autoScale: props.data.spec.minCount !== props.data.spec.maxCount, isNameError: false, - stateful: props.data.stateful || false + stateful: props.data.spec.nodeLabels[keyconstants.nodepoolStateType] || false } : { nvidiaGpuEnabled: false, @@ -155,9 +156,11 @@ const Root = (props: IDialog) => { maxCount: Number.parseInt(val.maximum, 10), minCount: Number.parseInt(val.minimum, 10), cloudProvider: 'aws', + nodeLabels: { + [keyconstants.nodepoolStateType]: val.stateful ? "stateful" : "stateless" + }, ...getNodeConf(), }, - stateful: val.stateful || false }, }); if (e) { @@ -173,11 +176,14 @@ const Root = (props: IDialog) => { }, spec: { ...props.data.spec, + nodeLabels: { + ...(props.data.spec.nodeLabels || {}), + [keyconstants.nodepoolStateType]: val.stateful ? "stateful" : "stateless" + }, maxCount: Number.parseInt(val.maximum, 10), minCount: Number.parseInt(val.minimum, 10), ...getNodeConf(), }, - stateful: val.stateful || false }, }); if (e) { diff --git a/src/apps/console/server/gql/queries/nodepool-queries.ts b/src/apps/console/server/gql/queries/nodepool-queries.ts index dcf8d4818..85d1d7a3e 100644 --- a/src/apps/console/server/gql/queries/nodepool-queries.ts +++ b/src/apps/console/server/gql/queries/nodepool-queries.ts @@ -29,7 +29,6 @@ export const nodepoolQueries = (executor: IExecutor) => ({ } creationTime displayName - stateful kind lastUpdatedBy { userEmail @@ -79,6 +78,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({ cloudProvider maxCount minCount + nodeLabels } status { checks @@ -158,7 +158,6 @@ export const nodepoolQueries = (executor: IExecutor) => ({ } creationTime displayName - stateful lastUpdatedBy { userEmail userId @@ -201,6 +200,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({ cloudProvider maxCount minCount + nodeLabels } status { checks diff --git a/src/apps/console/server/r-utils/key-constants.js b/src/apps/console/server/r-utils/key-constants.js index 929280dd2..bbd7bb4b2 100644 --- a/src/apps/console/server/r-utils/key-constants.js +++ b/src/apps/console/server/r-utils/key-constants.js @@ -10,5 +10,7 @@ export const keyconstants = { nodeType: 'kloudlite.io/ui-node-type', repoName: 'kloudlite.io/ui-repoName', imageTag: 'kloudlite.io/ui-imageTag', - repoAccountName: 'kloudlite.io/ui-repoAccountName' + repoAccountName: 'kloudlite.io/ui-repoAccountName', + + nodepoolStateType: 'kloudlite.io/ui/pool.app-state-type' }; diff --git a/src/generated/gql/sdl.graphql b/src/generated/gql/sdl.graphql index 09fc85dd4..7d5c66ddc 100644 --- a/src/generated/gql/sdl.graphql +++ b/src/generated/gql/sdl.graphql @@ -3020,7 +3020,6 @@ type NodePool { metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec! - stateful: Boolean! status: Github__com___kloudlite___operator___pkg___operator__Status syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! @@ -3037,7 +3036,6 @@ input NodePoolIn { kind: String metadata: MetadataIn spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn! - stateful: Boolean! } type NodePoolPaginatedRecords { @@ -3477,7 +3475,6 @@ input SearchNamespaces { } input SearchNodepool { - isStateful: MatchFilterIn text: MatchFilterIn } diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts index a233bef13..d9b01d4f7 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -318,7 +318,6 @@ export type SearchNamespaces = { }; export type SearchNodepool = { - isStateful?: InputMaybe; text?: InputMaybe; }; @@ -962,7 +961,6 @@ export type NodePoolIn = { kind?: InputMaybe; metadata?: InputMaybe; spec: Github__Com___Kloudlite___Operator___Apis___Clusters___V1__NodePoolSpecIn; - stateful: Scalars['Boolean']['input']; }; export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__NodePoolSpecIn = @@ -2016,7 +2014,6 @@ export type ConsoleGetNodePoolQuery = { clusterName: string; creationTime: any; displayName: string; - stateful: boolean; kind?: string; markedForDeletion?: boolean; updateTime: any; @@ -2035,6 +2032,7 @@ export type ConsoleGetNodePoolQuery = { cloudProvider: Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider; maxCount: number; minCount: number; + nodeLabels?: any; aws?: { availabilityZone: string; iamInstanceProfileRole?: string; @@ -2104,7 +2102,6 @@ export type ConsoleListNodePoolsQuery = { clusterName: string; creationTime: any; displayName: string; - stateful: boolean; markedForDeletion?: boolean; recordVersion: number; updateTime: any; @@ -2115,6 +2112,7 @@ export type ConsoleListNodePoolsQuery = { cloudProvider: Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider; maxCount: number; minCount: number; + nodeLabels?: any; aws?: { availabilityZone: string; nvidiaGpuEnabled: boolean;