Kind: SGInstanceProfile
listKind: SGInstanceProfileList
plural: sginstanceprofiles
singular: sginstanceprofile
shortNames sginp
The SGInstanceProfile
custom resource represents the CPU and memory resources assigned to each pod of the Postgres cluster.
Example:
apiVersion: stackgres.io/v1
kind: SGInstanceProfile
metadata:
name: size-l
spec:
cpu: "4"
memory: 8Gi
See also Instance Configuration section.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
apiVersion | ✓ | string | stackgres.io/v1 | ||
kind | ✓ | string | SGInstanceProfile | ||
metadata | ✓ | ✓ | object | Refer to the Kubernetes API documentation for the fields of the metadata field. |
|
spec | ✓ | ✓ | object |
|
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
containers | ✓ | map[string]object |
The CPU(s) (cores) and RAM limits assigned to containers other than patroni container.
|
||
cpu | ✓ | string |
CPU(s) (cores) limits for every resource’s Pod that reference this SGInstanceProfile. The suffix m
specifies millicpus (where 1000m is equals to 1).
The number of cpu limits is assigned to the patroni container (that runs both Patroni and PostgreSQL). A minimum of 2 cpu is recommended.
|
||
hugePages | ✓ | object |
RAM limits allocated for huge pages of the patroni container (that runs both Patroni and PostgreSQL).
|
||
initContainers | ✓ | map[string]object |
The CPU(s) (cores) and RAM limits assigned to the init containers. |
||
memory | ✓ | string |
RAM limits for every resource’s Pod that reference this SGInstanceProfile. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
The amount of RAM limits is assigned to the patroni container (that runs both Patroni and PostgreSQL). A minimum of 2Gi is recommended.
|
||
requests | ✓ | object |
This section allow to configure the resources requests for each container and, if not specified, it is filled with some defaults based on the fields .spec.cpu and .spec.memory will be set.
On containerized environments, when running production workloads, enforcing container’s resources requirements requests to be equals to the limits in order to achieve the highest level of performance. Doing so, reduces the chances of leaving the workload with less resources than it requires. It also allow to set static CPU management policy that allows to guarantee a pod the usage exclusive CPUs on the node. There are cases where you may need to set cpu requests to the same value as cpu limits in order to achieve static CPU management policy. By default the resources requests values in fields
|
SGInstanceProfile.spec.containers[key] ↩ Parent
The CPU(s) (cores) and RAM limits assigned to a container.
This section, if left empty, will be filled automatically by the operator with some defaults that can be proportional to the resources limits assigned to patroni container (except for the huge pages that are always left untouched).
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
cpu | ✓ | string |
CPU(s) (cores) limits for the specified container. The suffix m
specifies millicpus (where 1000m is equals to 1).
|
||
hugePages | ✓ | object |
RAM limits for huge pages for the specified container.
|
||
memory | ✓ | string |
RAM limits for the specified container. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
|
RAM limits for huge pages for the specified container.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
hugepages-1Gi | ✓ | string |
RAM limits for huge pages of the specified container with a size of 1Gi. The suffix Mi
or Gi specifies Mebibytes or Gibibytes, respectively.
|
||
hugepages-2Mi | ✓ | string |
RAM limits for huge pages of the specified container with a size of 2Mi. The suffix Mi
or Gi specifies Mebibytes or Gibibytes, respectively.
|
RAM limits allocated for huge pages of the patroni container (that runs both Patroni and PostgreSQL).
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
hugepages-1Gi | ✓ | string |
RAM limits allocated for huge pages of the patroni container (that runs both Patroni and PostgreSQL) with a size of 1Gi. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
|
||
hugepages-2Mi | ✓ | string |
RAM limits allocated for huge pages of the patroni container (that runs both Patroni and PostgreSQL) with a size of 2Mi. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
|
SGInstanceProfile.spec.initContainers[key] ↩ Parent
The CPU(s) (cores) and RAM limits assigned to a init container.
This section will be filled automatically by the operator with the same values of the resources limits assigned to patroni container (except for the huge pages that are always left untouched).
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
cpu | ✓ | string |
CPU(s) (cores) limits for the specified init container. The suffix
m specifies millicpus (where 1000m is equals to 1).
|
||
hugePages | ✓ | object |
RAM limits for huge pages of the specified init container
|
||
memory | ✓ | string |
RAM limits for the specified init container. The suffix Mi
or Gi specifies Mebibytes or Gibibytes, respectively.
|
RAM limits for huge pages of the specified init container
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
hugepages-1Gi | ✓ | string |
RAM limits for huge pages of the specified init container with a size of 1Gi. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
|
||
hugepages-2Mi | ✓ | string |
RAM limits for huge pages of the specified init container with a size of 2Mi. The suffix Mi
or Gi specifies Mebibytes or Gibibytes, respectively.
|
This section allow to configure the resources requests for each container and, if not specified, it is filled with some defaults based on the fields .spec.cpu
and .spec.memory
will be set.
On containerized environments, when running production workloads, enforcing container’s resources requirements requests to be equals to the limits in order to achieve the highest level of performance. Doing so, reduces the chances of leaving the workload with less resources than it requires. It also allow to set static CPU management policy that allows to guarantee a pod the usage exclusive CPUs on the node. There are cases where you may need to set cpu requests to the same value as cpu limits in order to achieve static CPU management policy.
By default the resources requests values in fields .spec.requests.cpu
and .spec.requests.memory
represent the total resources requests assigned to each resource’s Pod that reference this SGInstanceProfile.
The resources requests of the patroni container (that runs both Patroni and PostgreSQL) is calculated by subtracting from the total resources requests the resources requests of other containers that are present in the Pod.
To change this behavior and having the resources requests values in fields .spec.requests.cpu
and .spec.requests.memory
to represent the resources requests of the patroni container and the total resources requests
calculated by adding the resources requests of all the containers (including the patroni container) you may set one or more of the following fields to true
(depending on the resource’s Pods you need this behaviour to be changed):
SGCluster.spec.pods.resources.disableResourcesRequestsSplitFromTotal
SGShardedCluster.spec.coordinator.pods.resources.disableResourcesRequestsSplitFromTotal
SGShardedCluster.spec.shards.pods.resources.disableResourcesRequestsSplitFromTotal
SGShardedCluster.spec.shards.ovewrites.pods.resources.disableResourcesRequestsSplitFromTotal
SGDistributedLogs.spec.resources.disableResourcesRequestsSplitFromTotal
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
containers | ✓ | map[string]object |
The CPU(s) (cores) and RAM requests assigned to containers other than patroni container.
|
||
cpu | ✓ | string |
CPU(s) (cores) requests for every resource’s Pod that reference this SGInstanceProfile. The suffix m
specifies millicpus (where 1000m is equals to 1).
By default the cpu requests values in field
|
||
initContainers | ✓ | map[string]object |
The CPU(s) (cores) and RAM requests assigned to init containers. |
||
memory | ✓ | string |
RAM requests for every resource’s Pod that reference this SGInstanceProfile. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
By default the memory requests values in field
|
SGInstanceProfile.spec.requests.containers[key] ↩ Parent
The CPU(s) (cores) and RAM requests assigned to a container.
This section, if left empty, will be filled automatically by the operator with some defaults that can be proportional to the resources assigned to patroni container (except for the huge pages that are always left untouched).
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
cpu | ✓ | string |
CPU(s) (cores) requests for the specified container. The suffix m
specifies millicpus (where 1000m is equals to 1).
|
||
memory | ✓ | string |
RAM requests for the specified container. The suffix Mi or Gi
specifies Mebibytes or Gibibytes, respectively.
|
SGInstanceProfile.spec.requests.initContainers[key] ↩ Parent
The CPU(s) (cores) and RAM requests assigned to a init container.
This section will be filled automatically by the operator with the same values of the resources requests assigned to patroni container (except for the huge pages that are always left untouched).
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
cpu | ✓ | string |
CPU(s) (cores) requests for the specified init container. The suffix
m specifies millicpus (where 1000m is equals to 1).
|
||
memory | ✓ | string |
RAM requests for the specified init container. The suffix Mi
or Gi specifies Mebibytes or Gibibytes, respectively.
|