# Kubernetes Container

This page describes the Optimization Pack for the Kubernetes Container component type.

## Metrics

### CPU

| Name                                  | Unit       | Description                                                                                |
| ------------------------------------- | ---------- | ------------------------------------------------------------------------------------------ |
| container\_cpu\_used                  | millicores | The CPUs used by the container                                                             |
| container\_cpu\_used\_max             | millicores | The maximum CPUs used by the container among all container replicas                        |
| container\_cpu\_util                  | percent    | The percentage of CPUs used with respect to the limit                                      |
| container\_cpu\_util\_max             | percent    | The maximum percentage of CPUs used with respect to the limit among all container replicas |
| container\_cpu\_throttle\_time        | percent    | The amount of time the CPU has been throttled                                              |
| container\_cpu\_throttled\_millicores | millicores | The CPUs throttling per container in millicores                                            |
| container\_cpu\_request               | millicores | The CPUs requested for the container                                                       |
| container\_cpu\_limit                 | millicores | The CPUs limit for the container                                                           |

### Memory

| Name                             | Unit    | Description                                                                                  |
| -------------------------------- | ------- | -------------------------------------------------------------------------------------------- |
| container\_memory\_used          | bytes   | The total amount of memory used by the container                                             |
| container\_memory\_used\_max     | bytes   | The maximum memory used by the container among all container replicas                        |
| container\_memory\_util          | percent | The percentage of memory used with respect to the limit                                      |
| container\_memory\_util\_max     | percent | The maximum percentage of memory used with respect to the limit among all container replicas |
| container\_memory\_working\_set  | bytes   | The working set usage in bytes                                                               |
| container\_memory\_resident\_set | bytes   | The resident set usage in bytes                                                              |
| container\_memory\_cache         | bytes   | The memory cache usage in bytes                                                              |
| container\_memory\_request       | bytes   | The memory requested for the container                                                       |
| container\_memory\_limit         | bytes   | The memory limit for the container                                                           |

## Parameters

| Parameter       | Type    | Unit       | Default                                   | Domain                             | Restart | Description                                                           |
| --------------- | ------- | ---------- | ----------------------------------------- | ---------------------------------- | ------- | --------------------------------------------------------------------- |
| cpu\_request    | integer | millicores | You should select your own default value. | You should select your own domain. | yes     | Amount of CPU resources requests in CPU units (milllicores)           |
| cpu\_limit      | integer | millicores | You should select your own default value. | You should select your own domain. | yes     | Limits on the amount of CPU resources usage in CPU units (millicores) |
| memory\_request | integer | megabytes  | You should select your own default value. | You should select your own domain. | yes     | Amount of memory resources requests in megabytes                      |
| memory\_limit   | integer | megabytes  | You should select your own default value. | You should select your own domain. | yes     | Limits on the amount of memory resources usage in megabytes           |

## Constraints

The following tables show a list of constraints that may be required in the definition of the study, depending on the tuned parameters:

| Formula                                                          | Notes |
| ---------------------------------------------------------------- | ----- |
| component\_name.cpu\_request <= component\_name.cpu\_limit       |       |
| component\_name.memory\_request <= component\_name.memory\_limit |       |
