Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Capacity fields for Capacity Forecaster #49

Merged
merged 1 commit into from
Mar 23, 2023
Merged
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
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 cluster information
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 cluster information
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 cluster information",
"$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