@rulebricks/cli 2.1.7 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +51 -16
  2. package/cluster-setup/aws/README.md +96 -47
  3. package/cluster-setup/aws/check-aws-access.sh +216 -52
  4. package/cluster-setup/aws/parameters.json +13 -0
  5. package/cluster-setup/aws/rulebricks-cluster.cfn.yaml +355 -0
  6. package/cluster-setup/azure/README.md +103 -55
  7. package/cluster-setup/azure/check-aks-prereqs.sh +236 -56
  8. package/cluster-setup/azure/parameters.json +30 -0
  9. package/cluster-setup/azure/rulebricks-cluster.bicep +546 -0
  10. package/cluster-setup/gcp/README.md +51 -34
  11. package/cluster-setup/gcp/check-gke-prereqs.sh +222 -60
  12. package/dist/commands/backup.d.ts +5 -0
  13. package/dist/commands/backup.js +104 -0
  14. package/dist/commands/deploy.d.ts +3 -1
  15. package/dist/commands/deploy.js +226 -326
  16. package/dist/commands/destroy.d.ts +1 -1
  17. package/dist/commands/destroy.js +73 -123
  18. package/dist/commands/init.d.ts +5 -1
  19. package/dist/commands/init.js +78 -54
  20. package/dist/commands/list.d.ts +1 -0
  21. package/dist/commands/list.js +74 -0
  22. package/dist/commands/open.d.ts +1 -1
  23. package/dist/commands/open.js +4 -12
  24. package/dist/commands/redeploy.d.ts +6 -0
  25. package/dist/commands/redeploy.js +310 -0
  26. package/dist/commands/restore.d.ts +5 -0
  27. package/dist/commands/restore.js +338 -0
  28. package/dist/commands/status.js +62 -49
  29. package/dist/commands/upgrade.js +74 -51
  30. package/dist/components/DNSWaitScreen.d.ts +5 -1
  31. package/dist/components/DNSWaitScreen.js +47 -41
  32. package/dist/components/Wizard/WizardContext.d.ts +157 -36
  33. package/dist/components/Wizard/WizardContext.js +872 -160
  34. package/dist/components/Wizard/steps/CloudProviderStep.js +192 -107
  35. package/dist/components/Wizard/steps/DomainStep.js +5 -24
  36. package/dist/components/Wizard/steps/ExternalServicesStep.d.ts +6 -0
  37. package/dist/components/Wizard/steps/ExternalServicesStep.js +645 -0
  38. package/dist/components/Wizard/steps/FeatureConfigStep.d.ts +2 -1
  39. package/dist/components/Wizard/steps/FeatureConfigStep.js +739 -425
  40. package/dist/components/Wizard/steps/FeaturesStep.js +31 -35
  41. package/dist/components/Wizard/steps/ObservabilityStep.d.ts +6 -0
  42. package/dist/components/Wizard/steps/ObservabilityStep.js +137 -0
  43. package/dist/components/Wizard/steps/ReviewStep.d.ts +2 -1
  44. package/dist/components/Wizard/steps/ReviewStep.js +56 -12
  45. package/dist/components/Wizard/steps/StorageStep.d.ts +9 -0
  46. package/dist/components/Wizard/steps/StorageStep.js +592 -0
  47. package/dist/components/Wizard/steps/SupabaseCredentialsStep.js +20 -21
  48. package/dist/components/Wizard/steps/VersionStep.js +45 -23
  49. package/dist/components/Wizard/steps/index.d.ts +3 -3
  50. package/dist/components/Wizard/steps/index.js +3 -3
  51. package/dist/components/common/CommandApproval.d.ts +12 -0
  52. package/dist/components/common/CommandApproval.js +91 -0
  53. package/dist/components/common/DeploymentPicker.d.ts +14 -0
  54. package/dist/components/common/DeploymentPicker.js +16 -0
  55. package/dist/components/common/index.d.ts +2 -0
  56. package/dist/components/common/index.js +2 -0
  57. package/dist/index.js +94 -62
  58. package/dist/lib/cloudCli.d.ts +134 -63
  59. package/dist/lib/cloudCli.js +512 -220
  60. package/dist/lib/clusterSetupDefaults.d.ts +30 -0
  61. package/dist/lib/clusterSetupDefaults.js +64 -0
  62. package/dist/lib/commandApproval.d.ts +26 -0
  63. package/dist/lib/commandApproval.js +114 -0
  64. package/dist/lib/config.d.ts +12 -10
  65. package/dist/lib/config.js +91 -33
  66. package/dist/lib/configFixtures.d.ts +5 -0
  67. package/dist/lib/configFixtures.js +513 -0
  68. package/dist/lib/deploymentHealth.d.ts +32 -0
  69. package/dist/lib/deploymentHealth.js +157 -0
  70. package/dist/lib/dns.d.ts +1 -1
  71. package/dist/lib/dns.js +19 -1
  72. package/dist/lib/dns.test.d.ts +1 -0
  73. package/dist/lib/dns.test.js +27 -0
  74. package/dist/lib/dockerHub.d.ts +12 -1
  75. package/dist/lib/dockerHub.js +18 -8
  76. package/dist/lib/helm.d.ts +4 -0
  77. package/dist/lib/helm.js +16 -0
  78. package/dist/lib/helmValues.d.ts +25 -0
  79. package/dist/lib/helmValues.js +1762 -289
  80. package/dist/lib/helmValues.test.d.ts +1 -0
  81. package/dist/lib/helmValues.test.js +966 -0
  82. package/dist/lib/htpasswd.d.ts +1 -0
  83. package/dist/lib/htpasswd.js +15 -0
  84. package/dist/lib/kubernetes.d.ts +124 -17
  85. package/dist/lib/kubernetes.js +576 -145
  86. package/dist/lib/secrets.d.ts +23 -0
  87. package/dist/lib/secrets.js +158 -0
  88. package/dist/lib/validateValues.d.ts +31 -0
  89. package/dist/lib/validateValues.js +253 -0
  90. package/dist/lib/versions.d.ts +82 -11
  91. package/dist/lib/versions.js +131 -31
  92. package/dist/lib/versions.test.d.ts +1 -0
  93. package/dist/lib/versions.test.js +81 -0
  94. package/dist/lib/wizardSteps.d.ts +14 -0
  95. package/dist/lib/wizardSteps.js +23 -0
  96. package/dist/lib/workloadIdentity.d.ts +26 -0
  97. package/dist/lib/workloadIdentity.js +323 -0
  98. package/dist/lib/workloadIdentity.test.d.ts +1 -0
  99. package/dist/lib/workloadIdentity.test.js +57 -0
  100. package/dist/types/index.d.ts +1860 -164
  101. package/dist/types/index.js +518 -295
  102. package/package.json +9 -4
  103. package/schema/values.schema.json +1934 -0
  104. package/cluster-setup/aws/cluster.yaml +0 -33
  105. package/cluster-setup/azure/main.bicep +0 -282
  106. package/cluster-setup/azure/main.parameters.json +0 -21
  107. package/dist/components/Wizard/steps/CredentialsStep.d.ts +0 -6
  108. package/dist/components/Wizard/steps/CredentialsStep.js +0 -22
  109. package/dist/components/Wizard/steps/DeploymentModeStep.d.ts +0 -5
  110. package/dist/components/Wizard/steps/DeploymentModeStep.js +0 -26
  111. package/dist/components/Wizard/steps/TierStep.d.ts +0 -6
  112. package/dist/components/Wizard/steps/TierStep.js +0 -29
  113. package/dist/lib/terraform.d.ts +0 -66
  114. package/dist/lib/terraform.js +0 -754
  115. package/terraform/aws/main.tf +0 -355
  116. package/terraform/azure/main.tf +0 -371
  117. package/terraform/gcp/main.tf +0 -407
@@ -1,9 +1,8 @@
1
1
  import React, { ReactNode } from "react";
2
- import { DeploymentConfig, CloudProvider, DatabaseType, PerformanceTier, SSOProvider, DnsProvider, LoggingSink, CloudLoggingAuthMode, MonitoringDestination, RemoteWriteAuthType, RemoteWriteDestination, EmailSubjects, EmailTemplates, ProfileConfig } from "../../types/index.js";
2
+ import { DeploymentConfig, CloudProvider, DatabaseType, NodeArchitecture, SSOProvider, DnsProvider, KafkaPreset, KafkaSaslMechanism, LoggingSink, CloudLoggingAuthMode, ObjectStorageProvider, MonitoringDestination, RemoteWriteAuthType, RemoteWriteDestination, EmailSubjects, EmailTemplates, ProfileConfig, TracingDestination } from "../../types/index.js";
3
3
  export interface WizardState {
4
4
  step: number;
5
5
  name: string;
6
- infrastructureMode: "existing" | "provision" | null;
7
6
  provider: CloudProvider | null;
8
7
  region: string;
9
8
  clusterName: string;
@@ -14,7 +13,6 @@ export interface WizardState {
14
13
  tlsEmail: string;
15
14
  dnsProvider: DnsProvider;
16
15
  dnsAutoManage: boolean;
17
- existingExternalDns: boolean;
18
16
  smtpHost: string;
19
17
  smtpPort: number;
20
18
  smtpUser: string;
@@ -31,7 +29,26 @@ export interface WizardState {
31
29
  supabaseDbPassword: string;
32
30
  supabaseDashboardUser: string;
33
31
  supabaseDashboardPass: string;
34
- tier: PerformanceTier | null;
32
+ nodeArchitecture: NodeArchitecture | null;
33
+ arm64TolerationRequired: boolean;
34
+ storageClass: string;
35
+ storageProvisioner: string;
36
+ schedulableNodeCount: number;
37
+ totalCpuCores: number;
38
+ totalMemoryGi: number;
39
+ eligibleCpuCores: number;
40
+ eligibleMemoryGi: number;
41
+ totalPersistentStorageGi: number;
42
+ storageProvider: ObjectStorageProvider | null;
43
+ storageBucket: string;
44
+ storageRegion: string;
45
+ storageCloudAuthMode: CloudLoggingAuthMode;
46
+ storageAwsIamRoleArn: string;
47
+ storageAzureBlobContainer: string;
48
+ storageAzureBlobClientId: string;
49
+ storageAzureBlobTenantId: string;
50
+ storageAzureBlobConnectionStringSecretRef: string;
51
+ storageGcpServiceAccountEmail: string;
35
52
  aiEnabled: boolean;
36
53
  openaiApiKey: string;
37
54
  ssoEnabled: boolean;
@@ -39,7 +56,10 @@ export interface WizardState {
39
56
  ssoUrl: string;
40
57
  ssoClientId: string;
41
58
  ssoClientSecret: string;
42
- monitoringEnabled: boolean;
59
+ clickStackEnabled: boolean;
60
+ clickStackTelemetryRetentionDays: number;
61
+ clickHouseStorageSize: string;
62
+ metricsExportEnabled: boolean;
43
63
  prometheusMonitoringDestination: MonitoringDestination | null;
44
64
  prometheusRemoteWriteUrl: string;
45
65
  prometheusRemoteWriteDestination: RemoteWriteDestination | null;
@@ -54,21 +74,72 @@ export interface WizardState {
54
74
  prometheusRemoteWritePasswordSecretRef: string;
55
75
  prometheusRemoteWriteBearerTokenSecretRef: string;
56
76
  loggingSink: LoggingSink;
57
- loggingBucket: string;
58
- loggingRegion: string;
59
- loggingCloudAuthMode: CloudLoggingAuthMode;
60
- loggingAwsIamRoleArn: string;
61
- loggingAzureBlobContainer: string;
62
- loggingAzureBlobClientId: string;
63
- loggingAzureBlobTenantId: string;
64
- loggingAzureBlobConnectionStringSecretRef: string;
65
- loggingGcpServiceAccountEmail: string;
77
+ loggingPlatformCredential: string;
78
+ loggingPlatformDetail: string;
79
+ tracingEnabled: boolean;
80
+ tracingDestination: TracingDestination;
81
+ tracingElasticEndpoint: string;
82
+ tracingElasticAuthMode: "secret-token" | "api-key";
83
+ tracingElasticSecretToken: string;
84
+ tracingElasticApiKey: string;
85
+ tracingOtlpEndpoint: string;
86
+ tracingOtlpAuthMode: "none" | "bearer" | "api-key" | "header";
87
+ tracingOtlpHeaderName: string;
88
+ tracingOtlpToken: string;
89
+ tracingAzureConnectionString: string;
90
+ appLogsEnabled: boolean;
91
+ appLogsElasticEndpoint: string;
92
+ appLogsElasticIndex: string;
93
+ appLogsElasticAuthMode: "basic" | "api-key";
94
+ appLogsElasticUsername: string;
95
+ appLogsElasticPassword: string;
96
+ appLogsElasticApiKey: string;
66
97
  customEmailsEnabled: boolean;
67
98
  emailSubjects: EmailSubjects;
68
99
  emailTemplates: EmailTemplates;
100
+ backupEnabled: boolean;
101
+ backupSchedule: string;
102
+ backupRetentionDays: number;
103
+ redisMode: "embedded" | "external";
104
+ redisHost: string;
105
+ redisPort: number;
106
+ redisPassword: string;
107
+ redisExistingSecret: string;
108
+ redisExistingSecretKey: string;
109
+ redisTls: boolean;
110
+ redisHttpApiEnabled: boolean;
111
+ redisHttpApiUrl: string;
112
+ redisHttpApiToken: string;
113
+ valkeyAdminEnabled: boolean;
114
+ valkeyAdminExposure: "internal" | "ingress";
115
+ valkeyAdminHostname: string;
116
+ valkeyAdminBasicAuthUsers: string[];
117
+ valkeyAdminAllowedIPs: string[];
118
+ redisExporterEnabled: boolean;
119
+ kafkaExporterEnabled: boolean;
120
+ kafkaMode: "embedded" | "external";
121
+ kafkaPreset: KafkaPreset | null;
122
+ kafkaBrokers: string;
123
+ kafkaTopic: string;
124
+ kafkaTopicPrefix: string;
125
+ kafkaProvisionTopics: boolean;
126
+ kafkaSsl: boolean;
127
+ kafkaSaslMechanism: KafkaSaslMechanism;
128
+ kafkaSaslRegion: string;
129
+ kafkaSaslUsername: string;
130
+ kafkaSaslPassword: string;
131
+ kafkaSaslExistingSecret: string;
132
+ kafkaIdentityAwsRoleArn: string;
133
+ kafkaIdentityGcpServiceAccountEmail: string;
134
+ kafkaIdentityAzureClientId: string;
135
+ postgresMode: "embedded" | "external";
136
+ postgresHost: string;
137
+ postgresPort: number;
138
+ postgresDatabase: string;
139
+ postgresMasterUsername: string;
140
+ postgresMasterPassword: string;
69
141
  licenseKey: string;
70
- appVersion: string;
71
- hpsVersion: string;
142
+ version: string;
72
143
  chartVersion: string;
73
144
  }
74
145
  type WizardAction = {
@@ -77,9 +148,6 @@ type WizardAction = {
77
148
  } | {
78
149
  type: "SET_NAME";
79
150
  name: string;
80
- } | {
81
- type: "SET_INFRA_MODE";
82
- mode: "existing" | "provision";
83
151
  } | {
84
152
  type: "SET_PROVIDER";
85
153
  provider: CloudProvider;
@@ -101,18 +169,12 @@ type WizardAction = {
101
169
  } | {
102
170
  type: "SET_ADMIN_EMAIL";
103
171
  email: string;
104
- } | {
105
- type: "SET_TLS_EMAIL";
106
- email: string;
107
172
  } | {
108
173
  type: "SET_DNS_PROVIDER";
109
174
  provider: DnsProvider;
110
175
  } | {
111
176
  type: "SET_DNS_AUTO_MANAGE";
112
177
  autoManage: boolean;
113
- } | {
114
- type: "SET_EXISTING_EXTERNAL_DNS";
115
- exists: boolean;
116
178
  } | {
117
179
  type: "SET_SMTP";
118
180
  config: Partial<Pick<WizardState, "smtpHost" | "smtpPort" | "smtpUser" | "smtpPass" | "smtpFrom" | "smtpFromName">>;
@@ -126,8 +188,17 @@ type WizardAction = {
126
188
  type: "SET_SUPABASE_SELF_HOSTED";
127
189
  config: Partial<Pick<WizardState, "supabaseJwtSecret" | "supabaseDbPassword" | "supabaseDashboardUser" | "supabaseDashboardPass">>;
128
190
  } | {
129
- type: "SET_TIER";
130
- tier: PerformanceTier;
191
+ type: "SET_CLUSTER_CAPABILITIES";
192
+ nodeArchitecture: NodeArchitecture;
193
+ arm64TolerationRequired: boolean;
194
+ storageClass?: string;
195
+ storageProvisioner?: string;
196
+ schedulableNodeCount?: number;
197
+ totalCpuCores?: number;
198
+ totalMemoryGi?: number;
199
+ eligibleCpuCores?: number;
200
+ eligibleMemoryGi?: number;
201
+ totalPersistentStorageGi?: number;
131
202
  } | {
132
203
  type: "SET_AI_ENABLED";
133
204
  enabled: boolean;
@@ -141,7 +212,13 @@ type WizardAction = {
141
212
  type: "SET_SSO_CONFIG";
142
213
  config: Partial<Pick<WizardState, "ssoProvider" | "ssoUrl" | "ssoClientId" | "ssoClientSecret">>;
143
214
  } | {
144
- type: "SET_MONITORING";
215
+ type: "SET_CLICKSTACK_ENABLED";
216
+ enabled: boolean;
217
+ } | {
218
+ type: "SET_CLICKSTACK_CONFIG";
219
+ config: Partial<Pick<WizardState, "clickStackTelemetryRetentionDays" | "clickHouseStorageSize">>;
220
+ } | {
221
+ type: "SET_METRICS_EXPORT";
145
222
  enabled: boolean;
146
223
  } | {
147
224
  type: "SET_PROMETHEUS_REMOTE_WRITE";
@@ -152,9 +229,36 @@ type WizardAction = {
152
229
  } | {
153
230
  type: "SET_LOGGING_SINK";
154
231
  sink: LoggingSink;
232
+ } | {
233
+ type: "SET_STORAGE_CONFIG";
234
+ config: Partial<Pick<WizardState, "storageProvider" | "storageBucket" | "storageRegion" | "storageCloudAuthMode" | "storageAwsIamRoleArn" | "storageAzureBlobContainer" | "storageAzureBlobClientId" | "storageAzureBlobTenantId" | "storageAzureBlobConnectionStringSecretRef" | "storageGcpServiceAccountEmail">>;
155
235
  } | {
156
236
  type: "SET_LOGGING_CONFIG";
157
- config: Partial<Pick<WizardState, "loggingBucket" | "loggingRegion" | "loggingCloudAuthMode" | "loggingAwsIamRoleArn" | "loggingAzureBlobContainer" | "loggingAzureBlobClientId" | "loggingAzureBlobTenantId" | "loggingAzureBlobConnectionStringSecretRef" | "loggingGcpServiceAccountEmail">>;
237
+ config: Partial<Pick<WizardState, "loggingPlatformCredential" | "loggingPlatformDetail">>;
238
+ } | {
239
+ type: "SET_TRACING_ENABLED";
240
+ enabled: boolean;
241
+ } | {
242
+ type: "SET_TRACING_CONFIG";
243
+ config: Partial<Pick<WizardState, "tracingDestination" | "tracingElasticEndpoint" | "tracingElasticAuthMode" | "tracingElasticSecretToken" | "tracingElasticApiKey" | "tracingOtlpEndpoint" | "tracingOtlpAuthMode" | "tracingOtlpHeaderName" | "tracingOtlpToken" | "tracingAzureConnectionString">>;
244
+ } | {
245
+ type: "SET_APP_LOGS_ENABLED";
246
+ enabled: boolean;
247
+ } | {
248
+ type: "SET_APP_LOGS_CONFIG";
249
+ config: Partial<Pick<WizardState, "appLogsElasticEndpoint" | "appLogsElasticIndex" | "appLogsElasticAuthMode" | "appLogsElasticUsername" | "appLogsElasticPassword" | "appLogsElasticApiKey">>;
250
+ } | {
251
+ type: "SET_BACKUP_ENABLED";
252
+ enabled: boolean;
253
+ } | {
254
+ type: "SET_BACKUP_SCHEDULE";
255
+ schedule: string;
256
+ } | {
257
+ type: "SET_BACKUP_RETENTION_DAYS";
258
+ retentionDays: number;
259
+ } | {
260
+ type: "SET_EXTERNAL_SERVICES";
261
+ config: Partial<Pick<WizardState, "redisMode" | "redisHost" | "redisPort" | "redisPassword" | "redisExistingSecret" | "redisExistingSecretKey" | "redisTls" | "redisHttpApiEnabled" | "redisHttpApiUrl" | "redisHttpApiToken" | "valkeyAdminEnabled" | "valkeyAdminExposure" | "valkeyAdminHostname" | "valkeyAdminBasicAuthUsers" | "valkeyAdminAllowedIPs" | "redisExporterEnabled" | "kafkaExporterEnabled" | "kafkaMode" | "kafkaPreset" | "kafkaBrokers" | "kafkaTopic" | "kafkaTopicPrefix" | "kafkaProvisionTopics" | "kafkaSsl" | "kafkaSaslMechanism" | "kafkaSaslRegion" | "kafkaSaslUsername" | "kafkaSaslPassword" | "kafkaSaslExistingSecret" | "kafkaIdentityAwsRoleArn" | "kafkaIdentityGcpServiceAccountEmail" | "kafkaIdentityAzureClientId" | "postgresMode" | "postgresHost" | "postgresPort" | "postgresDatabase" | "postgresMasterUsername" | "postgresMasterPassword">>;
158
262
  } | {
159
263
  type: "SET_CUSTOM_EMAILS_ENABLED";
160
264
  enabled: boolean;
@@ -168,9 +272,8 @@ type WizardAction = {
168
272
  type: "SET_LICENSE_KEY";
169
273
  key: string;
170
274
  } | {
171
- type: "SET_APP_VERSION";
172
- appVersion: string;
173
- hpsVersion: string;
275
+ type: "SET_VERSION";
276
+ version: string;
174
277
  } | {
175
278
  type: "SET_CHART_VERSION";
176
279
  version: string;
@@ -179,22 +282,40 @@ type WizardAction = {
179
282
  } | {
180
283
  type: "PREV_STEP";
181
284
  };
285
+ /**
286
+ * Returns a list of human-readable reasons the wizard state can't be saved as a
287
+ * valid DeploymentConfig. Empty array means it's good to save. Shared by toConfig
288
+ * (which returns null when non-empty) and the review screen (which shows them),
289
+ * so users get a specific reason instead of a generic "invalid configuration".
290
+ */
291
+ export declare function collectConfigIssues(state: WizardState): string[];
292
+ export declare function configToWizardState(config: DeploymentConfig, profile?: ProfileConfig | null): WizardState;
182
293
  interface WizardContextValue {
183
294
  state: WizardState;
184
295
  dispatch: React.Dispatch<WizardAction>;
185
296
  toConfig: (options?: {
186
- tier?: PerformanceTier;
297
+ nodeArchitecture?: NodeArchitecture;
298
+ arm64TolerationRequired?: boolean;
299
+ storageClass?: string;
300
+ storageProvisioner?: string;
301
+ schedulableNodeCount?: number;
302
+ totalCpuCores?: number;
303
+ totalMemoryGi?: number;
304
+ eligibleCpuCores?: number;
305
+ eligibleMemoryGi?: number;
306
+ totalPersistentStorageGi?: number;
187
307
  }) => DeploymentConfig | null;
308
+ /** Human-readable reasons the current state can't be saved (empty = valid). */
309
+ configIssues: () => string[];
188
310
  skipToStep: (stepId: string) => void;
189
311
  profile: ProfileConfig | null;
190
- /** Suggests a domain based on the profile's domain suffix and deployment name */
191
- suggestDomain: (name: string) => string;
192
312
  }
193
313
  interface WizardProviderProps {
194
314
  children: ReactNode;
195
315
  initialName?: string;
316
+ initialState?: WizardState;
196
317
  profile?: ProfileConfig | null;
197
318
  }
198
- export declare function WizardProvider({ children, initialName, profile, }: WizardProviderProps): import("react/jsx-runtime").JSX.Element;
319
+ export declare function WizardProvider({ children, initialName, initialState, profile, }: WizardProviderProps): import("react/jsx-runtime").JSX.Element;
199
320
  export declare function useWizard(): WizardContextValue;
200
321
  export {};