Skip to content

Commit

Permalink
cluster status check while creating project
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtcoder36 committed Mar 1, 2024
1 parent 77219d9 commit 82200de
Show file tree
Hide file tree
Showing 9 changed files with 3,435 additions and 744 deletions.
4 changes: 3 additions & 1 deletion web/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ tasks:
URL_SUFFIX="-vision"
;;
"nxtcoder17")
URL_SUFFIX="-mohit"
URL_SUFFIX="-mohit"
;;
"piyush")
URL_SUFFIX="-piyush"
;;
Expand Down
4 changes: 0 additions & 4 deletions web/gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ query consoleGetCluster($name: String!) {
aws {
k3sMasters {
iamInstanceProfileRole
imageId
imageSSHUsername
instanceType
nodes
nvidiaGpuEnabled
Expand Down Expand Up @@ -590,8 +588,6 @@ query consoleGetNodePool($clusterName: String!, $poolName: String!) {
nodes
}
iamInstanceProfileRole
imageId
imageSSHUsername
nvidiaGpuEnabled
poolType
rootVolumeSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
parseUpdateOrCreatedBy,
parseUpdateOrCreatedOn,
} from '~/console/server/r-utils/common';
import { memo, useState } from 'react';
import { useState } from 'react';
import Popup from '~/components/molecule/popup';
import { HighlightJsLogs } from 'react-highlightjs-logs';
import { yamlDump } from '~/console/components/diff-viewer';
Expand All @@ -32,13 +32,13 @@ import AnimateHide from '~/components/atoms/animate-hide';
import { ISetState } from '~/console/page-components/app-states';
import { Button } from '~/components/atoms/button';
import { dayjs } from '~/components/molecule/dayjs';
import LogComp from '~/root/lib/client/components/logger';
import HandleNodePool from './handle-nodepool';
import {
findNodePlanWithCategory,
findNodePlanWithSpec,
} from './nodepool-utils';
import { IAccountContext } from '../../../_layout';
import LogComp from '~/root/lib/client/components/logger';

const RESOURCE_NAME = 'nodepool';
type BaseType = ExtractNodeType<INodepools>;
Expand Down Expand Up @@ -186,7 +186,6 @@ const ListDetail = (
</div>
);
case 'azure':
case 'do':
case 'gcp':
default:
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const getProvider = (item: ExtractNodeType<IClusters>) => {
<span>({item.spec.aws?.region})</span>
</div>
);
case 'do':
case 'gcp':
case 'azure':
return (
Expand Down
16 changes: 7 additions & 9 deletions web/src/apps/console/server/gql/queries/cluster-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const clusterQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateClusterMutation) =>
data.infra_createCluster,
vars(_: ConsoleCreateClusterMutationVariables) { },
vars(_: ConsoleCreateClusterMutationVariables) {},
}
),
deleteCluster: executor(
Expand All @@ -44,7 +44,7 @@ export const clusterQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleDeleteClusterMutation) =>
data.infra_deleteCluster,
vars(_: ConsoleDeleteClusterMutationVariables) { },
vars(_: ConsoleDeleteClusterMutationVariables) {},
}
),
clustersCount: executor(
Expand All @@ -57,7 +57,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleClustersCountQuery) => data.infra_listClusters,
vars(_: ConsoleClustersCountQueryVariables) { },
vars(_: ConsoleClustersCountQueryVariables) {},
}
),

Expand Down Expand Up @@ -171,7 +171,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleListClustersQuery) => data.infra_listClusters,
vars(_: ConsoleListClustersQueryVariables) { },
vars(_: ConsoleListClustersQueryVariables) {},
}
),
getCluster: executor(
Expand Down Expand Up @@ -212,8 +212,6 @@ export const clusterQueries = (executor: IExecutor) => ({
aws {
k3sMasters {
iamInstanceProfileRole
imageId
imageSSHUsername
instanceType
nodes
nvidiaGpuEnabled
Expand Down Expand Up @@ -283,7 +281,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleGetClusterQuery) => data.infra_getCluster,
vars(_: ConsoleGetClusterQueryVariables) { },
vars(_: ConsoleGetClusterQueryVariables) {},
}
),
getKubeConfig: executor(
Expand All @@ -299,7 +297,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleGetKubeConfigQuery) => data.infra_getCluster,
vars(_: ConsoleGetClusterQueryVariables) { },
vars(_: ConsoleGetClusterQueryVariables) {},
}
),
updateCluster: executor(
Expand All @@ -313,7 +311,7 @@ export const clusterQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleUpdateClusterMutation) =>
data.infra_updateCluster,
vars(_: ConsoleUpdateClusterMutationVariables) { },
vars(_: ConsoleUpdateClusterMutationVariables) {},
}
),
});
2 changes: 0 additions & 2 deletions web/src/apps/console/server/gql/queries/nodepool-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ export const nodepoolQueries = (executor: IExecutor) => ({
nodes
}
iamInstanceProfileRole
imageId
imageSSHUsername
nvidiaGpuEnabled
poolType
rootVolumeSize
Expand Down
2 changes: 0 additions & 2 deletions web/src/apps/console/server/r-utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const parseFromAnn = (resource: parseFromAnnResource, key: string) =>

export const validateClusterCloudProvider = (v: string): CloudProvider => {
switch (v as CloudProvider) {
case 'do':
case 'aws':
case 'azure':
case 'gcp':
Expand All @@ -128,7 +127,6 @@ export const validateClusterCloudProvider = (v: string): CloudProvider => {

export const validateCloudProvider = (v: string): CloudProvider => {
switch (v as CloudProvider) {
case 'do':
case 'aws':
case 'azure':
case 'gcp':
Expand Down
34 changes: 18 additions & 16 deletions web/src/generated/gql/sdl.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ type Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig
nodePools: Map
region: String!
spotNodePools: Map
vpc: Github__com___kloudlite___operator___apis___clusters___v1__AwsVPCParams
}

input Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn {
Expand All @@ -833,8 +834,6 @@ input Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfi

type Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig {
iamInstanceProfileRole: String
imageId: String!
imageSSHUsername: String!
instanceType: String!
nodes: Map
nvidiaGpuEnabled: Boolean!
Expand All @@ -851,13 +850,13 @@ type Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfi
availabilityZone: String!
ec2Pool: Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig
iamInstanceProfileRole: String
imageId: String!
imageSSHUsername: String!
nvidiaGpuEnabled: Boolean!
poolType: Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType!
rootVolumeSize: Int!
rootVolumeType: String!
spotPool: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig
vpcId: String!
vpcSubnetId: String!
}

input Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn {
Expand Down Expand Up @@ -904,6 +903,16 @@ input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConf
nodes: Map
}

type Github__com___kloudlite___operator___apis___clusters___v1__AwsSubnetWithID {
availabilityZone: String!
id: String!
}

type Github__com___kloudlite___operator___apis___clusters___v1__AwsVPCParams {
id: String!
publicSubnets: [Github__com___kloudlite___operator___apis___clusters___v1__AwsSubnetWithID!]!
}

type Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys {
keyAccessKey: String!
keyAWSAccountId: String!
Expand All @@ -916,6 +925,8 @@ type Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCre
type Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput {
jobName: String!
jobNamespace: String!
keyAWSVPCId: String
keyAWSVPCPublicSubnets: String
keyK3sAgentJoinToken: String!
keyK3sServerJoinToken: String!
keyKubeconfig: String!
Expand Down Expand Up @@ -954,26 +965,16 @@ input Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn {
credentialsRef: Github__com___kloudlite___operator___apis___common____types__SecretRefIn!
}

type Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode {
cloudProviderAccessKey: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef!
cloudProviderSecretKey: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef!
jobName: String
jobNamespace: String
stateS3BucketFilePath: String!
stateS3BucketName: String!
stateS3BucketRegion: String!
}

type Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps {
availabilityZone: String!
kloudliteRelease: String!
lastRecreatedAt: Date
role: String!
}

type Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec {
aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig
cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider!
iac: Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode!
maxCount: Int!
minCount: Int!
nodeLabels: Map
Expand Down Expand Up @@ -1008,7 +1009,7 @@ input Github__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn {
enum Github__com___kloudlite___operator___apis___common____types__CloudProvider {
aws
azure
do
digitalocean
gcp
}

Expand Down Expand Up @@ -1247,6 +1248,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec {
postUninstall: String
preInstall: String
preUninstall: String
releaseName: String
values: Map!
}

Expand Down
Loading

0 comments on commit 82200de

Please sign in to comment.