Fix PostgreSQL resource requests

This commit is contained in:
Thom Wijtenburg
2021-04-20 11:14:48 +02:00
parent 51b2a211cb
commit 378a33aaee
8 changed files with 90 additions and 38 deletions

View File

@@ -236,10 +236,15 @@ spec:
... ...
tower_postgres_resource_requirements: tower_postgres_resource_requirements:
requests: requests:
cpu: 500m
memory: 2Gi memory: 2Gi
limits:
cpu: 1
memory: 4Gi
tower_postgres_storage_requirements:
requests:
storage: 8Gi storage: 8Gi
limits: limits:
memory: 4Gi
storage: 50Gi storage: 50Gi
tower_postgres_storage_class: fast-ssd tower_postgres_storage_class: fast-ssd
``` ```

View File

@@ -235,6 +235,20 @@ spec:
tower_postgres_tolerations: tower_postgres_tolerations:
description: node tolerations for the Postgres pods description: node tolerations for the Postgres pods
type: string type: string
tower_postgres_storage_requirements:
description: Storage requirements for the PostgreSQL container
properties:
requests:
properties:
storage:
type: string
type: object
limits:
properties:
storage:
type: string
type: object
type: object
tower_postgres_resource_requirements: tower_postgres_resource_requirements:
description: Resource requirements for the PostgreSQL container description: Resource requirements for the PostgreSQL container
properties: properties:
@@ -244,8 +258,6 @@ spec:
type: string type: string
memory: memory:
type: string type: string
storage:
type: string
type: object type: object
limits: limits:
properties: properties:
@@ -253,8 +265,6 @@ spec:
type: string type: string
memory: memory:
type: string type: string
storage:
type: string
type: object type: object
type: object type: object
tower_postgres_storage_class: tower_postgres_storage_class:

View File

@@ -232,6 +232,20 @@ spec:
tower_postgres_tolerations: tower_postgres_tolerations:
description: node tolerations for the Postgres pods description: node tolerations for the Postgres pods
type: string type: string
tower_postgres_storage_requirements:
description: Storage requirements for the PostgreSQL container
properties:
requests:
properties:
storage:
type: string
type: object
limits:
properties:
storage:
type: string
type: object
type: object
tower_postgres_resource_requirements: tower_postgres_resource_requirements:
description: Resource requirements for the PostgreSQL container description: Resource requirements for the PostgreSQL container
properties: properties:
@@ -241,8 +255,6 @@ spec:
type: string type: string
memory: memory:
type: string type: string
storage:
type: string
type: object type: object
limits: limits:
properties: properties:
@@ -250,8 +262,6 @@ spec:
type: string type: string
memory: memory:
type: string type: string
storage:
type: string
type: object type: object
type: object type: object
tower_postgres_storage_class: tower_postgres_storage_class:

View File

@@ -230,6 +230,20 @@ spec:
tower_postgres_tolerations: tower_postgres_tolerations:
description: node tolerations for the Postgres pods description: node tolerations for the Postgres pods
type: string type: string
tower_postgres_storage_requirements:
description: Storage requirements for the PostgreSQL container
properties:
requests:
properties:
storage:
type: string
type: object
limits:
properties:
storage:
type: string
type: object
type: object
tower_postgres_resource_requirements: tower_postgres_resource_requirements:
description: Resource requirements for the PostgreSQL container description: Resource requirements for the PostgreSQL container
properties: properties:
@@ -239,8 +253,6 @@ spec:
type: string type: string
memory: memory:
type: string type: string
storage:
type: string
type: object type: object
limits: limits:
properties: properties:
@@ -248,8 +260,6 @@ spec:
type: string type: string
memory: memory:
type: string type: string
storage:
type: string
type: object type: object
type: object type: object
tower_postgres_storage_class: tower_postgres_storage_class:

View File

@@ -167,6 +167,12 @@ spec:
x-descriptors: x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:resourceRequirements - urn:alm:descriptor:com.tectonic.ui:resourceRequirements
- displayName: PostgreSQL container storage requirements (when using a managed
instance)
path: tower_postgres_storage_requirements
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:resourceRequirements
- displayName: Replicas - displayName: Replicas
path: tower_replicas path: tower_replicas
x-descriptors: x-descriptors:

View File

@@ -140,28 +140,38 @@ spec:
tower_postgres_tolerations: tower_postgres_tolerations:
description: node tolerations for the Postgres pods description: node tolerations for the Postgres pods
type: string type: string
tower_postgres_resource_requirements: tower_postgres_storage_requirements:
description: Resource requirements for the PostgreSQL container description: Storage requirements for the PostgreSQL container
properties: properties:
limits: requests:
properties: properties:
cpu: storage:
type: string type: string
memory: type: object
type: string limits:
storage: properties:
type: string storage:
type: object type: string
requests: type: object
properties: type: object
cpu: tower_postgres_resource_requirements:
type: string description: Resource requirements for the PostgreSQL container
memory: properties:
type: string requests:
storage: properties:
type: string cpu:
type: object type: string
type: object memory:
type: string
type: object
limits:
properties:
cpu:
type: string
memory:
type: string
type: object
type: object
tower_postgres_storage_class: tower_postgres_storage_class:
description: Storage class to use for the PostgreSQL PVC description: Storage class to use for the PostgreSQL PVC
type: string type: string

View File

@@ -148,10 +148,10 @@ tower_postgres_selector: ''
# value: "AWX" # value: "AWX"
# effect: "NoSchedule" # effect: "NoSchedule"
tower_postgres_tolerations: '' tower_postgres_tolerations: ''
tower_postgres_storage_requirements:
tower_postgres_resource_requirements:
requests: requests:
storage: 8Gi storage: 8Gi
tower_postgres_resource_requirements: []
tower_postgres_storage_class: '' tower_postgres_storage_class: ''
tower_postgres_data_path: '/var/lib/postgresql/data/pgdata' tower_postgres_data_path: '/var/lib/postgresql/data/pgdata'

View File

@@ -60,6 +60,7 @@ spec:
- name: postgres - name: postgres
mountPath: '{{ tower_postgres_data_path | dirname }}' mountPath: '{{ tower_postgres_data_path | dirname }}'
subPath: '{{ tower_postgres_data_path | dirname | basename }}' subPath: '{{ tower_postgres_data_path | dirname | basename }}'
resources: {{ tower_postgres_resource_requirements }}
{% if tower_postgres_selector %} {% if tower_postgres_selector %}
nodeSelector: nodeSelector:
{{ tower_postgres_selector | indent(width=8) }} {{ tower_postgres_selector | indent(width=8) }}
@@ -77,7 +78,7 @@ spec:
{% if tower_postgres_storage_class != '' %} {% if tower_postgres_storage_class != '' %}
storageClassName: '{{ tower_postgres_storage_class }}' storageClassName: '{{ tower_postgres_storage_class }}'
{% endif %} {% endif %}
resources: {{ tower_postgres_resource_requirements }} resources: {{ tower_postgres_storage_requirements }}
# Postgres Service. # Postgres Service.
--- ---