diff --git a/api/v1/postgres_types.go b/api/v1/postgres_types.go index eea7d98e..40963248 100644 --- a/api/v1/postgres_types.go +++ b/api/v1/postgres_types.go @@ -102,6 +102,8 @@ type Backup struct { type Size struct { // CPU is in the format as pod.spec.resource.request.cpu CPU string `json:"cpu,omitempty"` + // Memory is in the format as pod.spec.resource.request.memory + Memory string `json:"memory,omitempty"` // SharedBuffer of the database SharedBuffer string `json:"sharedBuffer,omitempty"` diff --git a/config/crd/bases/database.fits.cloud_postgres.yaml b/config/crd/bases/database.fits.cloud_postgres.yaml index e16bb69d..e998b223 100644 --- a/config/crd/bases/database.fits.cloud_postgres.yaml +++ b/config/crd/bases/database.fits.cloud_postgres.yaml @@ -123,6 +123,9 @@ spec: cpu: description: CPU is in the format as pod.spec.resource.request.cpu type: string + memory: + description: Memory is in the format as pod.spec.resource.request.memory + type: string sharedBuffer: description: SharedBuffer of the database type: string diff --git a/controllers/postgres_controller.go b/controllers/postgres_controller.go index 2b1ae4bb..7156ab9f 100644 --- a/controllers/postgres_controller.go +++ b/controllers/postgres_controller.go @@ -265,6 +265,7 @@ func patchRawZ(out *zalando.Postgresql, in *pg.Postgres) { out.Spec.PostgresqlParam.PgVersion = in.Spec.Version out.Spec.ResourceRequests.CPU = in.Spec.Size.CPU + out.Spec.ResourceRequests.Memory = in.Spec.Size.Memory // todo: Check if the validation should be performed here. out.Spec.Volume.Size = in.Spec.Size.StorageSize