1 | |
2 | |
3 | * Edit a cluster |
4 | * |
5 | */ |
6 | export async function main(auth: RT.Qovery, organizationId: string, clusterId: string, body: Body) { |
7 | const url = new URL(`https://api.qovery.com/organization/${organizationId}/cluster/${clusterId}`) |
8 |
|
9 | const response = await fetch(url, { |
10 | method: 'PUT', |
11 | headers: { |
12 | 'Content-Type': 'application/json', |
13 | Authorization: 'Token ' + auth.apiKey |
14 | }, |
15 | body: JSON.stringify(body) |
16 | }) |
17 | if (!response.ok) { |
18 | const text = await response.text() |
19 | throw new Error(`${response.status} ${text}`) |
20 | } |
21 | return await response.json() |
22 | } |
23 |
|
24 | |
25 | |
26 | * This file was automatically generated by json-schema-to-typescript. |
27 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
28 | * and run json-schema-to-typescript to regenerate this file. |
29 | */ |
30 |
|
31 | export type CpuArchitectureEnum = 'AMD64' | 'ARM64' |
32 | export type KarpenterNodePoolRequirementKey = |
33 | | 'InstanceFamily' |
34 | | 'InstanceSize' |
35 | | 'Arch' |
36 | | 'SkuFamily' |
37 | | 'SkuVersion' |
38 | export type KarpenterNodePoolRequirementOperator = 'In' |
39 | export type KarpenterNodePoolRequirementKey1 = |
40 | | 'InstanceFamily' |
41 | | 'InstanceSize' |
42 | | 'Arch' |
43 | | 'SkuFamily' |
44 | | 'SkuVersion' |
45 | export type KarpenterNodePoolRequirementOperator1 = 'In' |
46 |
|
47 | export interface Body { |
48 | |
49 | * name is case-insensitive |
50 | */ |
51 | name: string |
52 | description?: string |
53 | region: string |
54 | cloud_provider: |
55 | | 'AWS' |
56 | | 'SCW' |
57 | | 'GCP' |
58 | | 'DO' |
59 | | 'AZURE' |
60 | | 'OVH' |
61 | | 'CIVO' |
62 | | 'HETZNER' |
63 | | 'ORACLE' |
64 | | 'IBM' |
65 | | 'ON_PREMISE' |
66 | cloud_provider_credentials?: { |
67 | cloud_provider?: 'AWS' | 'SCW' | 'GCP' | 'ON_PREMISE' | 'AZURE' |
68 | credentials?: { |
69 | id?: string |
70 | name?: string |
71 | [k: string]: unknown |
72 | } |
73 | region?: string |
74 | [k: string]: unknown |
75 | } |
76 | min_running_nodes?: number |
77 | max_running_nodes?: number |
78 | |
79 | * Unit is in GB. The disk size to be used for the node configuration |
80 | */ |
81 | disk_size?: number |
82 | |
83 | * the instance type to be used for this cluster. The list of values can be retrieved via the endpoint /{CloudProvider}/instanceType |
84 | */ |
85 | instance_type?: string |
86 | kubernetes?: 'MANAGED' | 'SELF_MANAGED' | 'PARTIALLY_MANAGED' |
87 | |
88 | * specific flag to indicate that this cluster is a production one |
89 | */ |
90 | production?: boolean |
91 | |
92 | * Indicate your public ssh_key to remotely connect to your EC2 instance. |
93 | */ |
94 | ssh_keys?: string[] |
95 | features?: { |
96 | id?: string |
97 | value?: |
98 | | string |
99 | | boolean |
100 | | { |
101 | aws_vpc_eks_id: string |
102 | eks_subnets_zone_a_ids: string[] |
103 | eks_subnets_zone_b_ids: string[] |
104 | eks_subnets_zone_c_ids: string[] |
105 | documentdb_subnets_zone_a_ids?: string[] |
106 | documentdb_subnets_zone_b_ids?: string[] |
107 | documentdb_subnets_zone_c_ids?: string[] |
108 | elasticache_subnets_zone_a_ids?: string[] |
109 | elasticache_subnets_zone_b_ids?: string[] |
110 | elasticache_subnets_zone_c_ids?: string[] |
111 | rds_subnets_zone_a_ids?: string[] |
112 | rds_subnets_zone_b_ids?: string[] |
113 | rds_subnets_zone_c_ids?: string[] |
114 | eks_karpenter_fargate_subnets_zone_a_ids?: string[] |
115 | eks_karpenter_fargate_subnets_zone_b_ids?: string[] |
116 | eks_karpenter_fargate_subnets_zone_c_ids?: string[] |
117 | [k: string]: unknown |
118 | } |
119 | | { |
120 | vpc_name: string |
121 | vpc_project_id?: string |
122 | subnetwork_name?: string |
123 | ip_range_services_name?: string |
124 | ip_range_pods_name?: string |
125 | additional_ip_range_pods_names?: string[] |
126 | [k: string]: unknown |
127 | } |
128 | | ClusterFeatureKarpenterParameters |
129 | [k: string]: unknown |
130 | }[] |
131 | metrics_parameters?: MetricsParameters |
132 | infrastructure_charts_parameters?: { |
133 | nginx_parameters?: ClusterInfrastructureNginxChartParameters |
134 | cert_manager_parameters?: InfrastructureCertManagerChartParameters |
135 | metal_lb_parameters?: InfrastructureMetalLbChartParameters |
136 | [k: string]: unknown |
137 | } |
138 | [k: string]: unknown |
139 | } |
140 | export interface ClusterFeatureKarpenterParameters { |
141 | spot_enabled: boolean |
142 | disk_size_in_gib: number |
143 | default_service_architecture: CpuArchitectureEnum |
144 | qovery_node_pools: KarpenterNodePool |
145 | [k: string]: unknown |
146 | } |
147 | export interface KarpenterNodePool { |
148 | requirements: KarpenterNodePoolRequirement[] |
149 | stable_override?: KarpenterStableNodePoolOverride |
150 | default_override?: KarpenterDefaultNodePoolOverride |
151 | gpu_override?: KarpenterGpuNodePoolOverride |
152 | [k: string]: unknown |
153 | } |
154 | export interface KarpenterNodePoolRequirement { |
155 | key: KarpenterNodePoolRequirementKey |
156 | operator: KarpenterNodePoolRequirementOperator |
157 | values: string[] |
158 | [k: string]: unknown |
159 | } |
160 | export interface KarpenterStableNodePoolOverride { |
161 | consolidation?: KarpenterNodePoolConsolidation |
162 | limits?: KarpenterNodePoolLimits |
163 | [k: string]: unknown |
164 | } |
165 | export interface KarpenterNodePoolConsolidation { |
166 | enabled: boolean |
167 | days: ('MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY')[] |
168 | |
169 | * The start date of the consolidation. |
170 | * The format should follow ISO-8601 convention: "PThh:mm" |
171 | * |
172 | */ |
173 | start_time: string |
174 | |
175 | * The duration during the consolidation will be active. |
176 | * The format should follow ISO-8601 convention: "PThhHmmM" |
177 | * |
178 | */ |
179 | duration: string |
180 | [k: string]: unknown |
181 | } |
182 | export interface KarpenterNodePoolLimits { |
183 | enabled: boolean |
184 | |
185 | * CPU limit that will be applied for the node pool (in vCPU unit: 1 vCPU = 1000 millicores) |
186 | */ |
187 | max_cpu_in_vcpu: number |
188 | |
189 | * Memory limit that will be applied for the node pool (in Gibibytes unit: 1Gi = 1024 mebibytes) |
190 | */ |
191 | max_memory_in_gibibytes: number |
192 | |
193 | * GPU limit that will be applied for the node pool |
194 | */ |
195 | max_gpu: number |
196 | [k: string]: unknown |
197 | } |
198 | export interface KarpenterDefaultNodePoolOverride { |
199 | limits?: KarpenterNodePoolLimits1 |
200 | [k: string]: unknown |
201 | } |
202 | export interface KarpenterNodePoolLimits1 { |
203 | enabled: boolean |
204 | |
205 | * CPU limit that will be applied for the node pool (in vCPU unit: 1 vCPU = 1000 millicores) |
206 | */ |
207 | max_cpu_in_vcpu: number |
208 | |
209 | * Memory limit that will be applied for the node pool (in Gibibytes unit: 1Gi = 1024 mebibytes) |
210 | */ |
211 | max_memory_in_gibibytes: number |
212 | |
213 | * GPU limit that will be applied for the node pool |
214 | */ |
215 | max_gpu: number |
216 | [k: string]: unknown |
217 | } |
218 | export interface KarpenterGpuNodePoolOverride { |
219 | consolidation?: KarpenterNodePoolConsolidation1 |
220 | limits?: KarpenterNodePoolLimits2 |
221 | requirements?: KarpenterNodePoolRequirement1[] |
222 | disk_size_in_gib?: number |
223 | [k: string]: unknown |
224 | } |
225 | export interface KarpenterNodePoolConsolidation1 { |
226 | enabled: boolean |
227 | days: ('MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY')[] |
228 | |
229 | * The start date of the consolidation. |
230 | * The format should follow ISO-8601 convention: "PThh:mm" |
231 | * |
232 | */ |
233 | start_time: string |
234 | |
235 | * The duration during the consolidation will be active. |
236 | * The format should follow ISO-8601 convention: "PThhHmmM" |
237 | * |
238 | */ |
239 | duration: string |
240 | [k: string]: unknown |
241 | } |
242 | export interface KarpenterNodePoolLimits2 { |
243 | enabled: boolean |
244 | |
245 | * CPU limit that will be applied for the node pool (in vCPU unit: 1 vCPU = 1000 millicores) |
246 | */ |
247 | max_cpu_in_vcpu: number |
248 | |
249 | * Memory limit that will be applied for the node pool (in Gibibytes unit: 1Gi = 1024 mebibytes) |
250 | */ |
251 | max_memory_in_gibibytes: number |
252 | |
253 | * GPU limit that will be applied for the node pool |
254 | */ |
255 | max_gpu: number |
256 | [k: string]: unknown |
257 | } |
258 | export interface KarpenterNodePoolRequirement1 { |
259 | key: KarpenterNodePoolRequirementKey1 |
260 | operator: KarpenterNodePoolRequirementOperator1 |
261 | values: string[] |
262 | [k: string]: unknown |
263 | } |
264 | export interface MetricsParameters { |
265 | enabled?: boolean |
266 | configuration?: MetricsConfigurationManagedByQovery |
267 | [k: string]: unknown |
268 | } |
269 | export interface MetricsConfigurationManagedByQovery { |
270 | kind?: 'MANAGED_BY_QOVERY' |
271 | [k: string]: unknown |
272 | } |
273 | export interface ClusterInfrastructureNginxChartParameters { |
274 | replica_count?: number |
275 | default_ssl_certificate?: string |
276 | publish_status_address?: string |
277 | annotation_metal_lb_load_balancer_ips?: string |
278 | annotation_external_dns_kubernetes_target?: string |
279 | [k: string]: unknown |
280 | } |
281 | export interface InfrastructureCertManagerChartParameters { |
282 | kubernetes_namespace?: string |
283 | [k: string]: unknown |
284 | } |
285 | export interface InfrastructureMetalLbChartParameters { |
286 | ip_address_pools?: string[] |
287 | [k: string]: unknown |
288 | } |
289 |
|