-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
instance types filters for vng (#531)
[src] add instance types filters in vng level [jira] CON-22542 --------- Co-authored-by: Moshe Dahan <75436598+dahanmoshe1991@users.noreply.github.com>
- Loading branch information
1 parent
ce8ca09
commit 3a16638
Showing
10 changed files
with
236 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
api/services/ocean/aws/paths/allowedInstanceTypesByFilters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
get: | ||
summary: "Allowed Instance Types By Filters For Virtual Node Group" | ||
description: > | ||
Returns the Virtual Node Group's instance types when instance types filters is set. | ||
operationId: "oceanAwsGetAllowedInstanceTypesByFilters" | ||
tags: | ||
- "Ocean AWS" | ||
parameters: | ||
- $ref: "../../commons/parameters/oceanLaunchSpecId.yaml" | ||
- $ref: "../../../../commons/parameters/accountId.yaml" | ||
responses: | ||
200: | ||
$ref: "../responses/oceanAllowedInstanceTypesByFilters.yaml" | ||
400: | ||
description: "Bad Request" |
23 changes: 23 additions & 0 deletions
23
api/services/ocean/aws/paths/instanceTypeFiltersSimulationForVng.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
post: | ||
summary: "Instance Types Filters Simulation For Virtual Node Group" | ||
description: > | ||
Returns all instance types that match the given filters. | ||
These instance types will be used if the Virtual Node Group is configured with these filters. | ||
operationId: "oceanAwsInstanceTypeFiltersSimulationForVng" | ||
tags: | ||
- "Ocean AWS" | ||
parameters: | ||
- $ref: "../../commons/parameters/oceanLaunchSpecId.yaml" | ||
- $ref: "../../../../commons/parameters/accountId.yaml" | ||
requestBody: | ||
required: false | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../schemas/oceanInstanceTypesFiltersForVngWrapper.yaml" | ||
responses: | ||
200: | ||
$ref: "../responses/filteredInstanceTypesForVng.yaml" | ||
400: | ||
description: "Bad Request" |
24 changes: 24 additions & 0 deletions
24
api/services/ocean/aws/responses/filteredInstanceTypesForVng.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
description: Instance Types Filters Simulation For Virtual Node Group Response | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml" | ||
- type: object | ||
properties: | ||
request: | ||
type: object | ||
properties: | ||
url: | ||
example: "/ocean/aws/k8s/launchspec/o-abcd1234/instanceTypeFiltersSimulation" | ||
method: | ||
example: "POST" | ||
response: | ||
type: object | ||
properties: | ||
items: | ||
type: array | ||
items: | ||
$ref: "../schemas/filteredInstanceTypes.yaml" | ||
kind: | ||
example: "spotinst:ocean:aws:k8s:launchSpec:instanceTypesFilters:simulation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
api/services/ocean/aws/responses/oceanAllowedInstanceTypesByFilters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
description: Virtual Node Group Allowed Instance Types By Filters | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml" | ||
- type: object | ||
properties: | ||
request: | ||
type: object | ||
properties: | ||
url: | ||
example: "/ocean/aws/k8s/launchSpec/ols-12345abc/allowedInstanceTypesByFilters" | ||
method: | ||
example: "GET" | ||
response: | ||
type: object | ||
properties: | ||
items: | ||
type: array | ||
items: | ||
$ref: "../schemas/allowedInstanceTypesByFilters.yaml" | ||
kind: | ||
example: "spotinst:ocean:aws:k8s:launchSpec:allowedInstanceTypesByFilters" |
9 changes: 9 additions & 0 deletions
9
api/services/ocean/aws/schemas/allowedInstanceTypesByFilters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
type: object | ||
properties: | ||
instanceTypes: | ||
type: array | ||
description: > | ||
The allowed Virtual Node Group's instance types when instance types filters is set. | ||
items: | ||
type: string | ||
example: [ "c3.large", "c5.large" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
api/services/ocean/aws/schemas/oceanInstanceTypesFiltersForVng.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
type: object | ||
description: | | ||
List of instance types filters. The instance types that match with all filters compose the Virtual Node Group's instanceTypes parameter.\ | ||
The architectures that come from the Virtual Node Group's images will be taken into account when using this parameter.\ | ||
Cannot be configured together with Virtual Node Group's instanceTypes and with the Cluster's whitelist/blacklist/filters. | ||
title: InstanceTypesFilters | ||
properties: | ||
minVcpu: | ||
type: integer | ||
description: | | ||
Minimum number of vcpus available. | ||
minimum: 0 | ||
example: 2 | ||
maxVcpu: | ||
type: integer | ||
description: | | ||
Maximum number of vcpus available. | ||
minimum: 1 | ||
example: 16 | ||
minMemoryGiB: | ||
type: number | ||
description: | | ||
Minimum amount of Memory (GiB). | ||
minimum: 0 | ||
example: 8 | ||
maxMemoryGiB: | ||
type: number | ||
description: | | ||
Maximum amount of Memory (GiB). | ||
minimum: 0 | ||
example: 16 | ||
minGpu: | ||
type: integer | ||
description: | | ||
Minimum total number of GPUs. | ||
minimum: 0 | ||
example: 0 | ||
maxGpu: | ||
type: integer | ||
description: | | ||
Maximum total number of GPUs. | ||
minimum: 1 | ||
example: 4 | ||
includeFamilies: | ||
type: array | ||
description: > | ||
Types belonging to a family from the IncludeFamilies will be available for scaling (asterisk wildcard is also supported). | ||
For example, C* will include instance types from these families: c5, c4, c4a, etc. | ||
items: | ||
type: string | ||
example: [ "c5*", "g5"] | ||
excludeFamilies: | ||
type: array | ||
description: > | ||
Types belonging to a family from the ExcludeFamilies will not be available for scaling (asterisk wildcard is also supported). | ||
For example, C* will exclude instance types from these families: c5, c4, c4a, etc. | ||
items: | ||
type: string | ||
example: [ "t2", "R4*"] | ||
excludeMetal: | ||
type: boolean | ||
default: false | ||
description: | | ||
In case excludeMetal is set to true, metal types will not be available for scaling. | ||
example: true | ||
isEnaSupported: | ||
type: boolean | ||
description: | | ||
Ena is supported or not. | ||
example: true | ||
virtualizationTypes: | ||
type: array | ||
description: | | ||
The filtered instance types will support at least one of the virtualization types from this list. | ||
items: | ||
type: string | ||
enum: [ hvm, paravirtual ] | ||
example: [ "hvm" ] | ||
categories: | ||
type: array | ||
description: | | ||
The filtered instance types will belong to one of the categories types from this list. | ||
items: | ||
type: string | ||
enum: [ Accelerated_computing, Compute_optimized, General_purpose, Memory_optimized, Storage_optimized] | ||
example: [ "Accelerated_computing", "Compute_optimized"] | ||
minEnis: | ||
type: integer | ||
description: | | ||
Minimum number of network interfaces (ENIs). | ||
minimum: 0 | ||
example: 2 | ||
diskTypes: | ||
type: array | ||
description: | | ||
The filtered instance types will have one of the disk type from this list. | ||
items: | ||
type: string | ||
enum: [ NVMe, EBS, SSD, HDD ] | ||
example: [ "NVMe", "EBS"] | ||
hypervisor: | ||
type: array | ||
description: | | ||
The filtered instance types will have a hypervisor type from this list. | ||
items: | ||
type: string | ||
enum: [ nitro, xen ] | ||
example: [ "nitro"] | ||
rootDeviceTypes: | ||
type: array | ||
description: | | ||
The filtered instance types will have a root device types from this list. | ||
items: | ||
type: string | ||
enum: [ ebs, instance-store ] | ||
example: [ "ebs" ] | ||
minNetworkPerformance: | ||
type: integer | ||
description: | | ||
Minimum Bandwidth in Gib/s of network performance. | ||
minimum: 0 | ||
example: 2 | ||
maxNetworkPerformance: | ||
type: integer | ||
description: | | ||
Maximum Bandwidth in Gib/s of network performance. | ||
minimum: 1 | ||
example: 20 |
6 changes: 6 additions & 0 deletions
6
api/services/ocean/aws/schemas/oceanInstanceTypesFiltersForVngWrapper.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: object | ||
required: | ||
- instanceTypesFilters | ||
properties: | ||
instanceTypesFilters: | ||
$ref: "./oceanInstanceTypesFiltersForVng.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters