Skip to content

Commit

Permalink
[src] Add AKS V2 roll
Browse files Browse the repository at this point in the history
  • Loading branch information
avitalwerz authored Dec 7, 2023
1 parent e2c8d3f commit de09acf
Show file tree
Hide file tree
Showing 18 changed files with 440 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/services/ocean/aksV2/paths/roll-get.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
summary: Ocean for AKS
get:
summary: "Get Roll"
description: >
Get status for a roll of an Ocean cluster.
operationId: "oceanAksGetSingleRoll"
tags:
- "Ocean AKS"
parameters:
- $ref: "../../../../commons/parameters/accountId.yaml"
- $ref: "../../commons/parameters/oceanId.yaml"
- $ref: "../../commons/parameters/azureRollId.yaml"
responses:
200:
$ref: "../responses/rollGetResponse.yaml"
400:
description: "Bad Request"
20 changes: 20 additions & 0 deletions api/services/ocean/aksV2/paths/roll-stop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
summary: Ocean for AKS
put:
summary: "Stop Roll"
description: |
Stop a roll of an Ocean cluster.
*Performing the request will stop the next batch in a roll.*
operationId: "oceanAksRollStop"
tags:
- "Ocean AKS"
parameters:
- $ref: "../../../../commons/parameters/accountId.yaml"
- $ref: "../../commons/parameters/oceanId.yaml"
- $ref: "../../commons/parameters/azureRollId.yaml"

responses:
200:
$ref: "../responses/rollStopResponse.yaml"
400:
description: "Bad Request"
78 changes: 78 additions & 0 deletions api/services/ocean/aksV2/paths/roll.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
summary: Ocean for AKS
post:
summary: "Initiate Roll"
description: >
Roll an entire Ocean cluster or roll subsets of the cluster by specifying vngIds, nodePoolNames or nodeNames.
Performing this request will start the roll immediately and run it in defined batches.
Note that the first response for a successful request will indicate the start of a roll. In order to check the status of a roll, you can use the GET Roll API.
operationId: "oceanAksRollInit"
tags:
- "Ocean AKS"
parameters:
- $ref: "../../../../commons/parameters/accountId.yaml"
- $ref: "../../commons/parameters/oceanId.yaml"
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- type: object
title: 'Roll'
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- type: object
title: 'Roll with node names'
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- $ref: "../schemas/roll/roll-nodeNames.yaml"
- type: object
title: 'Roll with node pool names'
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- $ref: "../schemas/roll/roll-nodePoolNames.yaml"
- type: object
title: 'Roll with virtual node group ids'
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- $ref: "../schemas/roll/roll-vngIds.yaml"
responses:
200:
$ref: "../responses/rollCreateResponse.yaml"
400:
description: "Bad Request"

get:
summary: "List Rolls"
description: >
Get status for all rolls of an Ocean cluster.
operationId: "oceanAksRollList"
tags:
- "Ocean AKS"
parameters:
- $ref: "../../../../commons/parameters/accountId.yaml"
- $ref: "../../commons/parameters/oceanId.yaml"
responses:
200:
$ref: "../responses/rollListResponse.yaml"
400:
description: "Bad Request"



47 changes: 47 additions & 0 deletions api/services/ocean/aksV2/responses/rollCreateResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
description: Ocean AKS Create Cluster Roll Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/azure/np/cluster/o-12345abc/roll"
method:
example: "POST"
response:
type: object
properties:
items:
type: array
items:
allOf:
- $ref: "../schemas/roll/roll-status.yaml"
- type: object
properties:
status:
example: IN_PROGRESS
- type: object
properties:
progress:
example:
detailedStatus:
rollNodes:
- nodeName: aks-omnpbc2ebdb1-15563275-vmss00000q
status: IN_PROGRESS
- nodeName: aks-omnpbc2ebdb1-15563275-vmss000008
status: TO_BE_REPLACED
- nodeName: aks-omnpbc2ebdb1-15563275-vmss00000r
status: TO_BE_REPLACED
- nodeName: aks-omnpe9429a2f-26725402-vmss00000z
status: IN_PROGRESS
- nodeName: aks-omnp0c85c2c2-26833420-vmss000001
status: IN_PROGRESS
- nodeName: aks-omnp0c85c2c2-26833420-vmss000003
status: TO_BE_REPLACED
kind:
example: "spotinst:ocean:azure:np:roll"
24 changes: 24 additions & 0 deletions api/services/ocean/aksV2/responses/rollGetResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
description: Ocean AKS Get Roll Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/azure/np/cluster/o-12345abc/roll/scr-12345abc"
method:
example: "GET"
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/roll/roll-status.yaml"
kind:
example: "spotinst:ocean:azure:np:roll"
24 changes: 24 additions & 0 deletions api/services/ocean/aksV2/responses/rollListResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
description: Ocean AKS Get Cluster Roll Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/azure/np/cluster/o-12345abc/roll"
method:
example: "GET"
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/roll/roll-status.yaml"
kind:
example: "spotinst:ocean:azure:np:roll"
46 changes: 46 additions & 0 deletions api/services/ocean/aksV2/responses/rollStopResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
description: Ocean AKS STOP Cluster Roll Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/azure/np/cluster/o-12345abc/roll/scr-12345abc/stop"
method:
example: "PUT"
response:
type: object
properties:
items:
type: array
items:
allOf:
- $ref: "../schemas/roll/roll-status.yaml"
- type: object
properties:
status:
example: STOPPED
progress:
example:
detailedStatus:
progressPercentage: 50
rollNodes:
- nodeName: aks-omnpbc2ebdb1-15563275-vmss00000q
status: REPLACED
- nodeName: aks-omnpbc2ebdb1-15563275-vmss000008
status: DID_NOT_REPLACE
- nodeName: aks-omnpbc2ebdb1-15563275-vmss00000r
status: DID_NOT_REPLACE
- nodeName: aks-omnpe9429a2f-26725402-vmss00000z
status: REPLACED
- nodeName: aks-omnp0c85c2c2-26833420-vmss000001
status: REPLACED
- nodeName: aks-omnp0c85c2c2-26833420-vmss000003
status: DID_NOT_REPLACE
kind:
example: "spotinst:ocean:azure:np:roll"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: object
properties:
batchMinHealthyPercentage:
type: integer
description: >
Indicates the threshold of minimum healthy nodes in single batch.
If the amount of healthy nodes in single batch is under the threshold, the roll will fail.
If exists, the parameter value will be in range of 1-100.
In case of null as value, the default value in the backend will be 50%.
Value of param should represent the number in percentage (%) of the batch.
example: 100
default: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
properties:
batchSizePercentage:
type: integer
description: >
Value as a percent to set the size of a batch in a roll. Valid values are 0-100.
In case of null as value, the default value in the backend will be 20%.
example: 25
7 changes: 7 additions & 0 deletions api/services/ocean/aksV2/schemas/roll/roll-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
properties:
comment:
type: string
description: >
Add a comment description for the roll. The comment is limited to 256 chars and optional.
example: "This is why I deployed my cluster."
11 changes: 11 additions & 0 deletions api/services/ocean/aksV2/schemas/roll/roll-nodeNames.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
properties:
nodeNames:
type: array
description: >
List of node names to be rolled. Each identifier is a string. nodeNames can be null, and cannot be used together with nodePoolNames and vngIds.
items:
type: string
example:
- aks-omnpbc2ebdb1-15563275-vmss00000g
- aks-omnpe9429a2f-26725402-vmss000015
12 changes: 12 additions & 0 deletions api/services/ocean/aksV2/schemas/roll/roll-nodePoolNames.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: object
properties:
nodePoolNames:
type: array
description: >
List of node pools to be rolled.
Each node pool name is a string. nodePoolNames can be null, and cannot be used together with nodeNames and vngIds.
items:
type: string
example:
- omnp35f6cccb
- omnp55bd559b
8 changes: 8 additions & 0 deletions api/services/ocean/aksV2/schemas/roll/roll-respectPdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
properties:
respectPdb:
type: boolean
description: >
During the roll, if the parameter is set to true we honor PDB during the nodes replacement.
example: false
default: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
properties:
respectRestrictScaleDown:
type: boolean
description: >
During the roll, if the parameter is set to true we honor Restrict Scale Down label during the nodes replacement.
example: true
default: false
Loading

0 comments on commit de09acf

Please sign in to comment.