Skip to content

Commit

Permalink
Add Capacity fields for Capacity Recommender
Browse files Browse the repository at this point in the history
  • Loading branch information
radu-catalina committed Mar 22, 2023
1 parent 3030abb commit 0a677d3
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 250 deletions.
10 changes: 10 additions & 0 deletions config/crd/bases/registry.ethos.adobe.com_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ spec:
items:
type: string
type: array
capacity:
description: Capacity information updated by the Capacity Recommender
properties:
clusterCapacity:
type: integer
clusterProvisioning:
type: integer
lastUpdated:
type: string
type: object
cloudProviderRegion:
description: The cloud provider standard region
type: string
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/registry/v1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ type ClusterSpec struct {

// Cluster tags that were applied
Tags map[string]string `json:"tags,omitempty"`

// Capacity information updated by the Capacity Recommender
Capacity Capacity `json:"capacity,omitempty"`
}

// Offering the cluster is meant for
Expand Down Expand Up @@ -246,6 +249,13 @@ type K8sInfraRelease struct {
Release string `json:"release"`
}

// Capacity information updated by the Capacity Recommender
type Capacity struct {
LastUpdated string `json:"lastUpdated"`
ClusterCapacity int `json:"clusterCapacity"`
ClusterProvisioning int `json:"clusterProvisioning"`
}

// ClusterStatus defines the observed state of Cluster
type ClusterStatus struct {
// Send/Receive Errors
Expand Down
160 changes: 66 additions & 94 deletions pkg/apiserver/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github.com_adobe_cluster-registry_pkg_apiserver_web_handler_v1.clusterList"
"$ref": "#/definitions/v1.clusterList"
}
},
"500": {
Expand Down Expand Up @@ -186,7 +186,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/pkg_apiserver_web_handler_v2.clusterList"
"$ref": "#/definitions/v2.clusterList"
}
},
"500": {
Expand Down Expand Up @@ -259,98 +259,6 @@ const docTemplate = `{
}
}
},
"github.com_adobe_cluster-registry_pkg_apiserver_web_handler_v1.clusterList": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.ClusterSpec"
}
},
"itemsCount": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"more": {
"type": "boolean"
},
"offset": {
"type": "integer"
}
}
},
"github.com_adobe_cluster-registry_pkg_apiserver_web_handler_v2.clusterList": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.ClusterSpec"
}
},
"itemsCount": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"more": {
"type": "boolean"
},
"offset": {
"type": "integer"
}
}
},
"pkg_apiserver_web_handler_v1.clusterList": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.ClusterSpec"
}
},
"itemsCount": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"more": {
"type": "boolean"
},
"offset": {
"type": "integer"
}
}
},
"pkg_apiserver_web_handler_v2.clusterList": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.ClusterSpec"
}
},
"itemsCount": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"more": {
"type": "boolean"
},
"offset": {
"type": "integer"
}
}
},
"v1.APIServer": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -387,6 +295,20 @@ const docTemplate = `{
}
}
},
"v1.Capacity": {
"type": "object",
"properties": {
"clusterCapacity": {
"type": "integer"
},
"clusterProvisioning": {
"type": "integer"
},
"lastUpdated": {
"type": "string"
}
}
},
"v1.ClusterSpec": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -416,6 +338,10 @@ const docTemplate = `{
"type": "string"
}
},
"capacity": {
"description": "Capacity information updated by the Capacity Recommender",
"$ref": "#/definitions/v1.Capacity"
},
"cloudProviderRegion": {
"description": "The cloud provider standard region\n+kubebuilder:validation:Required",
"type": "string"
Expand Down Expand Up @@ -665,6 +591,52 @@ const docTemplate = `{
"type": "string"
}
}
},
"v1.clusterList": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.ClusterSpec"
}
},
"itemsCount": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"more": {
"type": "boolean"
},
"offset": {
"type": "integer"
}
}
},
"v2.clusterList": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.ClusterSpec"
}
},
"itemsCount": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"more": {
"type": "boolean"
},
"offset": {
"type": "integer"
}
}
}
},
"securityDefinitions": {
Expand Down
Loading

0 comments on commit 0a677d3

Please sign in to comment.