Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
in: query
name: "karpenterNodePool"
example: MyKarpenterNodePool
description: |
Node pool name to import.
schema:
type: string
required: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
summary: Ocean for EKS
post:
summary: "Import Karpenter NodePool To Ocean Virtual Node Group"
description: >
<ul>
<li> 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.</li>
<li> Notes: <ul>
<li> Make sure to have the necessary permissions in your Spot policy: <b>eks:ListNodegroups, eks:DescribeNodegroup</b>.
<a href="https://docs.spot.io/administration/api/spot-policy-in-aws?id=spot-policy-in-aws">Click here for the full Spot policy.</a></li>
<li> <b>Exactly one of region or oceanId must be supplied</b> as query parameters.</li>
<ul>
</li>
<ul>
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"
15 changes: 15 additions & 0 deletions api/services/ocean/aws/paths/karpenterNodePoolNames.yaml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
24 changes: 24 additions & 0 deletions api/services/ocean/aws/responses/karpenterNodePoolNames.yaml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 9 additions & 0 deletions api/services/ocean/aws/schemas/karpenterNodePoolNames.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
properties:
instanceTypes:
type: array
description: >
The Karpenter node pool names.
items:
type: string
example: [ "default", "nodePool-1" ]
79 changes: 78 additions & 1 deletion api/services/ocean/aws/schemas/oceanInstanceTypesFilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -168,4 +212,37 @@ properties:
type: boolean
description: |
encryptionInTransitSupported is supported or not.
example: true
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 ]
Loading