diff --git a/api/services/ocean/aws/parameters/karpenterNodePool-query.yaml b/api/services/ocean/aws/parameters/karpenterNodePool-query.yaml
new file mode 100644
index 000000000..14e25c319
--- /dev/null
+++ b/api/services/ocean/aws/parameters/karpenterNodePool-query.yaml
@@ -0,0 +1,8 @@
+in: query
+name: "karpenterNodePool"
+example: MyKarpenterNodePool
+description: |
+ Node pool name to import.
+schema:
+ type: string
+required: true
\ No newline at end of file
diff --git a/api/services/ocean/aws/paths/importKarpenterNodePool-launchSpec.yaml b/api/services/ocean/aws/paths/importKarpenterNodePool-launchSpec.yaml
new file mode 100644
index 000000000..a92a4d08b
--- /dev/null
+++ b/api/services/ocean/aws/paths/importKarpenterNodePool-launchSpec.yaml
@@ -0,0 +1,32 @@
+summary: Ocean for EKS
+post:
+ summary: "Import Karpenter NodePool To Ocean Virtual Node Group"
+ description: >
+
+ - Returns an Ocean Virtual Node Group (VNG) configuration based on a given Karpenter nodePool.
+ The returned value ("Imported VNG") can then be used as input to the Create Virtual Node Group API in order to create an actual VNG in your Ocean cluster.
+ - Notes:
+ - Make sure to have the necessary permissions in your Spot policy: eks:ListNodegroups, eks:DescribeNodegroup.
+ Click here for the full Spot policy.
+ - Exactly one of region or oceanId must be supplied as query parameters.
+
+
+ operationId: "oceanEksImportKarpenterNodePoolToLaunchSpec"
+ tags:
+ - "Ocean AWS"
+ parameters:
+ - $ref: "../../../../commons/parameters/accountId.yaml"
+ - $ref: "../parameters/karpenterNodePool-query.yaml"
+ - $ref: "../parameters/oceanId-query-optional.yaml"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "../schemas/importKarpenterNodePool-launchSpecRequest.yaml"
+ responses:
+ 200:
+ $ref: "../responses/importEksNodeGroup-launchSpec.yaml"
+ 400:
+ description: "Bad Request"
diff --git a/api/services/ocean/aws/paths/karpenterNodePoolNames.yaml b/api/services/ocean/aws/paths/karpenterNodePoolNames.yaml
new file mode 100644
index 000000000..3ecb304c7
--- /dev/null
+++ b/api/services/ocean/aws/paths/karpenterNodePoolNames.yaml
@@ -0,0 +1,15 @@
+get:
+ summary: "Karpenter Node Pool Names"
+ description: >
+ Return the list of the allowed Ocean cluster instance types.
+ operationId: "oceanKarpenterNodePoolNames"
+ tags:
+ - "Ocean AWS"
+ parameters:
+ - $ref: "../../commons/parameters/oceanClusterId.yaml"
+ - $ref: "../../../../commons/parameters/accountId.yaml"
+ responses:
+ 200:
+ $ref: "../responses/karpenterNodePoolNames.yaml"
+ 400:
+ description: "Bad Request"
diff --git a/api/services/ocean/aws/responses/importKarpenterNodePool-launchSpec.yaml b/api/services/ocean/aws/responses/importKarpenterNodePool-launchSpec.yaml
new file mode 100644
index 000000000..2bbf63462
--- /dev/null
+++ b/api/services/ocean/aws/responses/importKarpenterNodePool-launchSpec.yaml
@@ -0,0 +1,24 @@
+description: Ocean Import Karpenter Node Pool to 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/karpenterNodePool/import"
+ method:
+ example: "POST"
+ response:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: "../schemas/importEksNodeGroup-launchSpecResponse.yaml"
+ kind:
+ example: "spotinst:ocean:aws:k8s:launchSpec"
\ No newline at end of file
diff --git a/api/services/ocean/aws/responses/karpenterNodePoolNames.yaml b/api/services/ocean/aws/responses/karpenterNodePoolNames.yaml
new file mode 100644
index 000000000..ec30d47a2
--- /dev/null
+++ b/api/services/ocean/aws/responses/karpenterNodePoolNames.yaml
@@ -0,0 +1,24 @@
+description: Ocean Allowed Instance Types Response
+content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
+ - type: object
+ properties:
+ request:
+ type: object
+ properties:
+ url:
+ example: "/ocean/aws/k8s/cluster/o-12345abc/nodePoolNames"
+ method:
+ example: "GET"
+ response:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: "../schemas/karpenterNodePoolNames.yaml"
+ kind:
+ example: "ocean:aws:k8s:nodePools:names"
\ No newline at end of file
diff --git a/api/services/ocean/aws/schemas/importKarpenterNodePool-launchSpecRequest.yaml b/api/services/ocean/aws/schemas/importKarpenterNodePool-launchSpecRequest.yaml
new file mode 100644
index 000000000..2af2c3822
--- /dev/null
+++ b/api/services/ocean/aws/schemas/importKarpenterNodePool-launchSpecRequest.yaml
@@ -0,0 +1,44 @@
+type: object
+properties:
+ launchSpec:
+ type: object
+ description: |
+ The object specifying the configuration of the VNG.
+ properties:
+ name:
+ type: string
+ description: |
+ Set Virtual Node Group name.
+ example: "specialty.nodes.spotk8s.com"
+ labels:
+ type: array
+ description: |
+ An array of labels to add to the VNG nodes. Only custom user labels are allowed,
+ and not Kubernetes built-in labels or Spot internal labels.
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: |
+ Set label key. \
+ The following are not allowed:
+ * "kubernetes.io/hostname"
+ * "failure-domain.beta.kubernetes.io/zone"
+ * "topology.kubernetes.io/zone"
+ * "failure-domain.beta.kubernetes.io/region"
+ * "topology.kubernetes.io/region"
+ * "beta.kubernetes.io/instance-type"
+ * "node.kubernetes.io/instance-type"
+ * "beta.kubernetes.io/os"
+ * "kubernetes.io/os"
+ * "beta.kubernetes.io/arch"
+ * "kubernetes.io/arch"
+ * "spotinst.io/node-lifecycle"
+ value:
+ type: string
+ description: |
+ Set label value.
+ example:
+ - key: "env"
+ value: "test"
\ No newline at end of file
diff --git a/api/services/ocean/aws/schemas/importKarpenterNodePool-launchSpecResponse.yaml b/api/services/ocean/aws/schemas/importKarpenterNodePool-launchSpecResponse.yaml
new file mode 100644
index 000000000..cdeb4ad95
--- /dev/null
+++ b/api/services/ocean/aws/schemas/importKarpenterNodePool-launchSpecResponse.yaml
@@ -0,0 +1,39 @@
+type: object
+description: |
+ Ocean Import Karpenter Node Pool to Virtual Node Group Response.
+properties:
+ oceanId:
+ type: string
+ example: o-500a5d5a
+ name:
+ type: string
+ example: TestTeam1
+ imageId:
+ type: string
+ example: ami-0ce21b51cb55a48b8
+ securityGroupIds:
+ type: array
+ items:
+ type: string
+ example: sg-03ccf232a2bf0f4ea
+ tags:
+ type: array
+ description: |
+ A maximum of 10 unique key-value pairs for VM tags in the virtual node group.
+ items:
+ type: object
+ required:
+ - tagKey
+ properties:
+ tagKey:
+ type: string
+ description: |
+ Tag key for VMs in the cluster.
+ example: env
+ tagValue:
+ type: string
+ description: |
+ Tag value for VMs in the cluster.
+ example: staging
+ instanceMetadataOptions:
+ $ref: "./launchSpecInstanceMetadataOptions.yaml"
\ No newline at end of file
diff --git a/api/services/ocean/aws/schemas/karpenterNodePoolNames.yaml b/api/services/ocean/aws/schemas/karpenterNodePoolNames.yaml
new file mode 100644
index 000000000..de369de86
--- /dev/null
+++ b/api/services/ocean/aws/schemas/karpenterNodePoolNames.yaml
@@ -0,0 +1,9 @@
+type: object
+properties:
+ instanceTypes:
+ type: array
+ description: >
+ The Karpenter node pool names.
+ items:
+ type: string
+ example: [ "default", "nodePool-1" ]
\ No newline at end of file
diff --git a/api/services/ocean/aws/schemas/oceanInstanceTypesFilters.yaml b/api/services/ocean/aws/schemas/oceanInstanceTypesFilters.yaml
index 94ac19817..cde60ed41 100644
--- a/api/services/ocean/aws/schemas/oceanInstanceTypesFilters.yaml
+++ b/api/services/ocean/aws/schemas/oceanInstanceTypesFilters.yaml
@@ -16,6 +16,20 @@ properties:
Maximum number of vcpus available.
minimum: 1
example: 16
+ includeVcpu:
+ type: array
+ description: >
+ Vcpus from this list will be the only available for scaling.
+ items:
+ type: integer
+ example: [ 1, 2, 4 ]
+ excludeVcpu:
+ type: array
+ description: >
+ Vcpus from this list will not be available for scaling.
+ items:
+ type: integer
+ example: [ 1, 2, 4 ]
minMemoryGiB:
type: number
format: double
@@ -30,6 +44,20 @@ properties:
Maximum amount of Memory (GiB).
minimum: 0
example: 16
+ includeMemoryGiB:
+ type: array
+ description: >
+ Memory (GiB) from this list will be the only available for scaling.
+ items:
+ type: number
+ example: [ 8, 16, 32 ]
+ excludeMemoryGiB:
+ type: array
+ description: >
+ Memory (GiB) from this list will not be available for scaling.
+ items:
+ type: number
+ example: [ 8, 16, 32 ]
minGpu:
type: integer
description: |
@@ -77,6 +105,14 @@ properties:
type: string
enum: [ i386, x86_64, arm64 ]
example: [ "i386", "x86_64"]
+ excludeArchitectures:
+ type: array
+ description: |
+ The filtered instance types will not support any of the architectures from this list.
+ items:
+ type: string
+ enum: [ i386, x86_64, arm64 ]
+ example: [ "i386", "x86_64"]
virtualizationTypes:
type: array
description: |
@@ -115,6 +151,14 @@ properties:
type: string
enum: [ nitro, xen ]
example: [ "nitro"]
+ excludeHypervisor:
+ type: array
+ description: |
+ The filtered instance types will not have a hypervisor type from this list.
+ items:
+ type: string
+ enum: [ nitro, xen ]
+ example: [ "xen" ]
rootDeviceTypes:
type: array
description: |
@@ -168,4 +212,37 @@ properties:
type: boolean
description: |
encryptionInTransitSupported is supported or not.
- example: true
\ No newline at end of file
+ example: true
+ includeSize:
+ type: array
+ description: >
+ Size from the IncludeSize will be available for scaling.
+ items:
+ type: string
+ example: [ "medium", "8xlarge" ]
+ excludeSize:
+ type: array
+ description: >
+ Size from the ExcludeSize will not be available for scaling.
+ items:
+ type: string
+ example: [ "medium", "8xlarge" ]
+ capabilityFlex:
+ type: boolean
+ description: |
+ If true, the filtered instance types will have the capability of flexible resource management (Flex).
+ example: true
+ includeNetworkPerformance:
+ type: array
+ description: >
+ Network performance from this list will be the only available for scaling.
+ items:
+ type: integer
+ example: [ 10, 20 ]
+ excludeNetworkPerformance:
+ type: array
+ description: >
+ Network performance from this list will not be available for scaling.
+ items:
+ type: integer
+ example: [ 10, 20 ]
\ No newline at end of file
diff --git a/api/services/ocean/aws/schemas/oceanInstanceTypesFiltersForVng.yaml b/api/services/ocean/aws/schemas/oceanInstanceTypesFiltersForVng.yaml
index 188dc3a0c..07be2eaa4 100644
--- a/api/services/ocean/aws/schemas/oceanInstanceTypesFiltersForVng.yaml
+++ b/api/services/ocean/aws/schemas/oceanInstanceTypesFiltersForVng.yaml
@@ -17,6 +17,20 @@ properties:
Maximum number of vcpus available.
minimum: 1
example: 16
+ includeVcpu:
+ type: array
+ description: >
+ Vcpus from this list will be the only available for scaling.
+ items:
+ type: integer
+ example: [ 1, 2, 4 ]
+ excludeVcpu:
+ type: array
+ description: >
+ Vcpus from this list will not be available for scaling.
+ items:
+ type: integer
+ example: [ 1, 2, 4 ]
minMemoryGiB:
type: number
description: |
@@ -29,6 +43,20 @@ properties:
Maximum amount of Memory (GiB).
minimum: 0
example: 16
+ includeMemoryGiB:
+ type: array
+ description: >
+ Memory (GiB) from this list will be the only available for scaling.
+ items:
+ type: number
+ example: [ 8, 16, 32 ]
+ excludeMemoryGiB:
+ type: array
+ description: >
+ Memory (GiB) from this list will not be available for scaling.
+ items:
+ type: number
+ example: [ 8, 16, 32 ]
minGpu:
type: integer
description: |
@@ -68,6 +96,22 @@ properties:
description: |
Ena is supported or not.
example: true
+ architectures:
+ type: array
+ description: |
+ The filtered instance types will support at least one of the architectures from this list.
+ items:
+ type: string
+ enum: [ i386, x86_64, arm64 ]
+ example: [ "i386", "x86_64" ]
+ excludeArchitectures:
+ type: array
+ description: |
+ The filtered instance types will not support any of the architectures from this list.
+ items:
+ type: string
+ enum: [ i386, x86_64, arm64 ]
+ example: [ "i386", "x86_64" ]
virtualizationTypes:
type: array
description: |
@@ -106,6 +150,14 @@ properties:
type: string
enum: [ nitro, xen ]
example: [ "nitro"]
+ excludeHypervisor:
+ type: array
+ description: |
+ The filtered instance types will not have a hypervisor type from this list.
+ items:
+ type: string
+ enum: [ nitro, xen ]
+ example: [ "xen"]
rootDeviceTypes:
type: array
description: |
@@ -159,4 +211,37 @@ properties:
type: boolean
description: |
encryptionInTransitSupported is supported or not.
- example: true
\ No newline at end of file
+ example: true
+ includeSize:
+ type: array
+ description: >
+ Size from the IncludeSize will be available for scaling.
+ items:
+ type: string
+ example: [ "medium", "8xlarge"]
+ excludeSize:
+ type: array
+ description: >
+ Size from the ExcludeSize will not be available for scaling.
+ items:
+ type: string
+ example: [ "medium", "8xlarge"]
+ capabilityFlex:
+ type: boolean
+ description: |
+ If true, the filtered instance types will have the capability of flexible resource management (Flex).
+ example: true
+ includeNetworkPerformance:
+ type: array
+ description: >
+ Network performance from this list will be the only available for scaling.
+ items:
+ type: integer
+ example: [ 10, 20 ]
+ excludeNetworkPerformance:
+ type: array
+ description: >
+ Network performance from this list will not be available for scaling.
+ items:
+ type: integer
+ example: [ 10, 20 ]
diff --git a/api/services/ocean/ecs/schemas/oceanInstanceTypesFilters.yaml b/api/services/ocean/ecs/schemas/oceanInstanceTypesFilters.yaml
index 28bac386a..54289fe29 100644
--- a/api/services/ocean/ecs/schemas/oceanInstanceTypesFilters.yaml
+++ b/api/services/ocean/ecs/schemas/oceanInstanceTypesFilters.yaml
@@ -16,6 +16,20 @@ properties:
Maximum number of vCPUs available.
minimum: 1
example: 16
+ includeVcpu:
+ type: array
+ description: >
+ Vcpus from this list will be the only available for scaling.
+ items:
+ type: integer
+ example: [ 1, 2, 4 ]
+ excludeVcpu:
+ type: array
+ description: >
+ Vcpus from this list will not be available for scaling.
+ items:
+ type: integer
+ example: [ 1, 2, 4 ]
minMemoryGiB:
type: number
format: double
@@ -30,6 +44,20 @@ properties:
Maximum amount of Memory (GiB).
minimum: 0
example: 16
+ includeMemoryGiB:
+ type: array
+ description: >
+ Memory (GiB) from this list will be the only available for scaling.
+ items:
+ type: number
+ example: [ 8, 16, 32 ]
+ excludeMemoryGiB:
+ type: array
+ description: >
+ Memory (GiB) from this list will not be available for scaling.
+ items:
+ type: number
+ example: [ 8, 16, 32 ]
minGpu:
type: integer
description: |
@@ -77,6 +105,14 @@ properties:
type: string
enum: [ i386, x86_64, arm64 ]
example: [ "i386", "x86_64"]
+ excludeArchitectures:
+ type: array
+ description: |
+ The filtered instance types will not support any of the architectures from this list.
+ items:
+ type: string
+ enum: [ i386, x86_64, arm64 ]
+ example: [ "i386", "x86_64" ]
virtualizationTypes:
type: array
description: |
@@ -115,6 +151,14 @@ properties:
type: string
enum: [ nitro, xen ]
example: [ "nitro"]
+ excludeHypervisor:
+ type: array
+ description: |
+ The filtered instance types will not have a hypervisor type from this list.
+ items:
+ type: string
+ enum: [ nitro, xen ]
+ example: [ "xen" ]
rootDeviceTypes:
type: array
description: |
@@ -168,4 +212,37 @@ properties:
type: boolean
description: |
encryptionInTransitSupported is supported or not.
- example: true
\ No newline at end of file
+ example: true
+ includeSize:
+ type: array
+ description: >
+ Size from the IncludeSize will be available for scaling.
+ items:
+ type: string
+ example: [ "medium", "8xlarge" ]
+ excludeSize:
+ type: array
+ description: >
+ Size from the ExcludeSize will not be available for scaling.
+ items:
+ type: string
+ example: [ "medium", "8xlarge" ]
+ capabilityFlex:
+ type: boolean
+ description: |
+ If true, the filtered instance types will have the capability of flexible resource management (Flex).
+ example: true
+ includeNetworkPerformance:
+ type: array
+ description: >
+ Network performance from this list will be the only available for scaling.
+ items:
+ type: integer
+ example: [ 10, 20 ]
+ excludeNetworkPerformance:
+ type: array
+ description: >
+ Network performance from this list will not be available for scaling.
+ items:
+ type: integer
+ example: [ 10, 20 ]
\ No newline at end of file
diff --git a/api/spot.yaml b/api/spot.yaml
index b95d89e2c..a19ed0d87 100644
--- a/api/spot.yaml
+++ b/api/spot.yaml
@@ -560,6 +560,10 @@ paths:
$ref: services/ocean/aws/paths/importASG-launchSpec.yaml
/ocean/aws/k8s/launchSpec/eksNodeGroup/import:
$ref: services/ocean/aws/paths/importEksNodeGroup-launchSpec.yaml
+ /ocean/aws/k8s/launchSpec/nodePool/import:
+ $ref: services/ocean/aws/paths/importKarpenterNodePool-launchSpec.yaml
+ /ocean/aws/k8s/cluster/{oceanClusterId}/nodePoolNames:
+ $ref: services/ocean/aws/paths/karpenterNodePoolNames.yaml
# /ocean/onPrem/k8s/cluster:
# $ref: services/ocean/onpremise/paths/clusters.yaml
# /ocean/onPrem/k8s/cluster/{oceanClusterId}: