Analysis: Kubernetes Container Recommendations
Analysis: Kubernetes Container Recommendations
#340570
Description
To return a collection of all the Kubernetes containers included in the optimization analysis, see Analysis: Kubernetes Container Systems. The set of analyzed containers may be more than the set of container recommendations due to the possibility of no recommendations for some analyzed containers.
Resource
/analysis/containers/kubernetes/<analysisId>/results
Supported Operations
Table: Kubernetes Container Recommendations Supported Operations
HTTP Method |
Input |
Output |
Description |
Path Parameter: Query String Parameter Options: Accept:
|
Collection of (JSON):
|
Returns a collection of recommendations for a Kubernetes container analysis. Specify application/json in the request header for returned recommendations in JSON format. Note: The returned recommendations can be in either JSON or Terraform-map format. |
|
Path Parameter: Query String Parameter Options: Accept:
|
Collection of (Terraform-map):
|
Returns a collection of recommendations for a Kubernetes container analysis. Specify application/terraform-map in the request header for Terraform-map output. Note: The returned recommendations can be in either JSON or Terraform-map format. Example: Returning Kubernetes Container Recommendations in Terraform-map Form |
Table: Kubernetes Container Recommendations Path Parameters
Parameter Name |
Type |
Description |
string |
The unique referenced ID of the Kubernetes analysis. |
Table: Kubernetes Container Recommendations Query String Parameters
Parameter Name |
Type |
Description |
string |
You can use element filters to return a targeted subset of the recommendations. See the "F" (filter) designation in the Response schema table for a list of elements that support filtering. Refer to Filters for a complete description of this common operation feature. Usage example: ../results?recommendationType=Resize |
|
string |
Allows you to indicate which workload type data collection detail to return for the system. See dataQuality for the returned details. Specify a quoted list of workload type names for which data to be returned, separated by commas. Usage example: ../results?dataQuality="CPU Utilization (CINT2006 Rate),Memory Utilization in Percent" Note: A "400-Bad Request" error message is returned if a non-supported workload type is specified. |
Table: Kubernetes Container Recommendations Response Schema
Element |
Type |
Filter/Sort |
Description |
string |
F |
The container name. |
|
string |
F |
The container's cluster name. |
|
string |
|
The Densify internal reference used to ensure that containers are uniquely identified across multiple clusters, even if they potentially have the same namespace, pod and/or container names. |
|
percentage |
|
The predicted uptime (%) for the container is based on the percentage of hours that CPU utilization data is present in the historical interval specified in the policy settings. |
|
string |
F |
The display name is a combination of the pod and container name. |
|
Unix time |
|
The latest date and time that the following set of recommendations were provided by Densify(Unix Epoch time, in milliseconds): Note: If any recommendation value was updated, then Densify would considered that as a new set of recommendations and the recommLastSeen value would not be updated. |
|
string |
F |
The pod or service name for the container. |
|
|
|
The following system data collection details are returned:
The following container workload collection details, for the last 30 days, are returned:
Note: If no workload data is collected for the container in the last 30 days, then the workloadDataLast30 element block is not returned. Note: The values in auditInfo are updated once a day (after the data collection and RDB populate processes are complete). |
|
float |
|
The recommended CPU limit for the container after Densify optimization analysis. |
|
int |
|
The number of copies running in the Controller. This value comes form the container data collection. If size of the Controller is not found, then this value is set to 1. |
|
integer |
|
The number of times Densify recommended the same values for the following elements: This is the count of Densify analysis processes which produced the same recommendation values from recommFirstSeen to recommLastSeen. This value is updated when the RDB populate task (i.e. the reporting database update process) is executed. Note: In typical production environments, where the RDB populate task is scheduled to run once daily post data collection and analysis, the recommSeenCount value will reflect exactly the number of times the same recommendations were provided after data collection and analysis. If your environment executes the RDB populate task more than once daily, the recommSeenCount value will be inflated beyond the actual number of times the analysis produced the same recommendations. Contact [email protected] if you have concerns about the recommSeenCount value. |
|
float |
|
The current memory limit configured for the container. |
|
float |
|
The recommended memory limit for the container after Densify optimization analysis. |
|
string |
F |
The recommended action for this container:
Containers with insufficient information for analysis do not have recommendations and are returned with limited elements. See Example: Returning Kubernetes Containers with No Recommendations. |
|
float |
|
The recommended CPU request for the container after Densify optimization analysis. |
|
Unix time |
|
The first date and time that the following set of recommendations were provided by Densify (Unix Epoch time, in milliseconds): Note: If any recommendation value (above) is different than the previous set of recommFirstSeen recommendation values, then Densify would considered that as a new set of recommendations and the recommFirstSeen value would be updated. |
|
string |
|
The type of controller (i.e. "ReplicatSet", "ReplicationController", "DaemonSet", "StatefulSet", "Deployment", "Job", etc.). |
|
float |
|
The current memory request configured for the container. |
|
string |
|
The Densify assigned entity ID of the container system. |
|
float |
|
The current CPU limit configured for the container. |
|
array of:
|
|
The dataQuality array provides workload type data collection details for the system:
Note: The dataQuality array is only returned when the dataQuality query string is specified in the request. In addition, if you specify a workload type in the request, for which system workload data does not exist in Densify, then no data is returned. Note: The values in the dataQuality array are updated after data collection and subsequent updates to the reporting tables (i.e. RDB Populate process) are completed. |
|
float |
|
The recommended memory request for the container after Densify optimization analysis. |
|
float |
|
The current CPU request configured for the container. |
|
string |
F |
The container's namespace. |
Examples
Example: Returning Kubernetes Container Recommendations
The following example shows you how to return a collection of Kubernetes Container recommendations in JSON format.

Request:
Headers:
Accept: application/json
Authorization: Bearer <apiToken>
Response:
[
{
"container": "kube-apiserver",
"cluster": "kube-ctrl",
"hostName": "e89c16ee-1f7c-3e40-bdfa-75f33de36405",
"predictedUptime": 0.08,
"displayName": "kube-apiserver-kube-ctrl.in.densify.com__kube-apiserver",
"recommLastSeen": 1597104000000,
"podService": "kube-apiserver-kube-ctrl.in.densify.com",
"auditInfo": {
"workloadDataLast30": {
"totalDays": 29,
"seenDays": 29,
"firstDate": 1594612800000,
"lastDate": 1597104000000
},
"dataCollection": {
"auditCount": 40,
"dateFirstAudited": 1593648000000,
"dateLastAudited": 1597104000000
}
},
"recommendedCpuLimit": 80,
"currentCount": 4,
"recommSeenCount": 6,
"currentMemLimit": 630,
"recommendedMemLimit": 630,
"recommendationType": "Just Right",
"recommendedCpuRequest": 80,
"recommFirstSeen": 1593648000000,
"controllerType": "ReplicationController",
"currentMemRequest": 628,
"entityId": "06df1b52-a4ac-4328-94c5-67bfa0ea95b4",
"currentCpuLimit": 80,
"recommendedMemRequest": 628,
"currentCpuRequest": 80,
"namespace": "kube-system"
},
{
"container": "kube-scheduler",
"cluster": "kube-ctrl",
"hostName": "56d85c60-94f2-388f-9e2b-74c5afa75beb",
"predictedUptime": 0.08,
"displayName": "kube-scheduler-kube-ctrl.in.densify.com__kube-scheduler",
"recommLastSeen": 1597104000000,
"podService": "kube-scheduler-kube-ctrl.in.densify.com",
...
},
...
]
Example: Returning Kubernetes Container Recommendations in Terraform-map Form
The following example shows you how to return a collection of recommendations in terraform-map format.

Request:
GET /analysis/containers/kubernetes/e7298ac3-a143-41ed-b7d7-62f659f2a4c6/results
Headers:
Accept: application/terraform-map
Authorization: Bearer <apiToken>
Response:
densify_recommendations = {
"kube-controller-manager-kube-ctrl.in.densify.com__kube-controller-manager" = {
container = "kube-controller-manager"
cluster = "kube-ctrl"
hostName = "3e021430-5b65-307c-b049-3c0edca9be43"
predictedUptime = "0.08"
controllerType = "ReplicationController"
displayName = "kube-controller-manager-kube-ctrl.int.densify.com__kube-controller-manager"
currentMemRequest = "152.0"
currentCpuLimit = "30.0"
podService = "kube-controller-manager-kube-ctrl.in.densify.com"
recommendedCpuLimit = "30.0"
recommendedMemRequest = "152.0"
currentCpuRequest = "30.0"
currentCount = "2"
currentMemLimit = "152.0"
namespace = "kube-system"
recommendedMemLimit = "152.0"
recommendationType = "Just Right"
recommendedCpuRequest = "30.0"
}
"kubernetes-dashboard-845747bdd4__kubernetes-dashboard" = {
container = "kubernetes-dashboard"
cluster = "kube-ctrl"
hostName = "93d0c4a7-a915-3cc8-80cf-19729e8b091c"
predictedUptime = "0.08"
controllerType = "ReplicaSet"
displayName = "kubernetes-dashboard-845747bdd4__kubernetes-dashboard"
currentMemRequest = "68.0"
currentCpuLimit = "10.0"
podService = "kubernetes-dashboard-845747bdd4"
recommendedCpuLimit = "10.0"
recommendedMemRequest = "68.0"
currentCpuRequest = "10.0"
currentCount = "1"
currentMemLimit = "68.0"
namespace = "kube-system"
recommendedMemLimit = "68.0"
recommendationType = "Just Right"
recommendedCpuRequest = "10.0"
}
...
}
Example: Returning Kubernetes Containers with No Recommendations
The following example shows you how to return a collection of Kubernetes containers without recommendations. These containers typically do not have adequate data for optimization analysis and have the "Not Analyzed" designation in the recommendationType element.

Request:
GET /analysis/containers/kubernetes/8334887b-59ca-42a4-a241-f970d7c306f1/results?recommendationType=Not Analyzed
Headers:
Accept: application/json
Authorization: Bearer <apiToken>
Response:
[
{
"container": "data-forwarder",
"recommFirstSeen": 1594080000000,
"cluster": "kube-ctrl",
"controllerType": "ReplicaSet",
"displayName": "densify1__data-forwarder",
"recommLastSeen": 1597104000000,
"currentMemRequest": 2048,
"entityId": "b1253c3b-16fe-47b5-b4db-6a72f541ab7e",
"podService": "densify1",
"currentCpuRequest": 520,
"currentCount": 1,
"recommSeenCount": 4,
"currentMemLimit": 3584,
"namespace": "default",
"recommendationType": "Not Analyzed"
}
]

Request:
GET /analysis/containers/kubernetes/8334887b-59ca-42a4-a241-f970d7c306f1/results?recommendationType=Not Analyzed
Headers:
Accept: application/terraform-map
Authorization: Bearer <apiToken>
Response:
densify_recommendations = {
"densify1__data-forwarder" = {
container = "data-forwarder"
cluster = "kube-master"
controllerType = "ReplicaSet"
currentCpuRequest = "520.0"
displayName = "densify1__data-forwarder"
currentCount = "1"
currentMemLimit = "3584.0"
namespace = "default"
currentMemRequest = "2048.0"
recommendationType = "Not Analyzed"
podService = "densify1"
}
}