Skip to content

POC WIP Cloud native pg #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

POC WIP Cloud native pg #319

wants to merge 17 commits into from

Conversation

johnoloughlin
Copy link
Contributor

@johnoloughlin johnoloughlin commented May 14, 2025

testing if cloud native postgres would be a better solution than bitnami

Description

Please include a summary of the changes and the related issue. List any dependencies that are required for this change.

Fixes # (issue)

Any Newly Introduced Dependencies

Please describe any newly introduced 3rd party dependencies in this change. List their name, license information and how they are used in the project.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

  • I agree to use the APACHE-2.0 license for my code changes
  • I have not introduced any 3rd party dependency changes
  • I have performed a self-review of my code

Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
@johnoloughlin johnoloughlin changed the title Cloud native pg PCO WIP Cloud native pg May 14, 2025
@johnoloughlin johnoloughlin changed the title PCO WIP Cloud native pg POC WIP Cloud native pg May 14, 2025
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Signed-off-by: OLoughlin, John <john.oloughlin@intel.com>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file needs to be moved to a better DIR

Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check warning

Code scanning / Trivy

Can elevate its own privileges Medium

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV001
Severity: MEDIUM
Message: Container 'psql' of Job 'pg-restore-job' should set 'securityContext.allowPrivilegeEscalation' to false
Link: KSV001
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check notice

Code scanning / Trivy

Default capabilities: some containers do not drop all Low

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV003
Severity: LOW
Message: Container 'psql' of Job 'pg-restore-job' should add 'ALL' to 'securityContext.capabilities.drop'
Link: KSV003
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check notice

Code scanning / Trivy

Default capabilities: some containers do not drop any Low

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV004
Severity: LOW
Message: Container 'psql' of 'job' 'pg-restore-job' in 'orch-database' namespace should set securityContext.capabilities.drop
Link: KSV004
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check notice

Code scanning / Trivy

CPU not limited Low

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV011
Severity: LOW
Message: Container 'psql' of Job 'pg-restore-job' should set 'resources.limits.cpu'
Link: KSV011
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check warning

Code scanning / Trivy

Runs as root user Medium

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV012
Severity: MEDIUM
Message: Container 'psql' of Job 'pg-restore-job' should set 'securityContext.runAsNonRoot' to true
Link: KSV012
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check warning

Code scanning / Trivy

All container images must start with a GCR domain Medium

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV033
Severity: MEDIUM
Message: container psql of job pg-restore-job in orch-database namespace should restrict container image to your specific registry domain. See the full GCR list here: https://cloud.google.com/container-registry/docs/overview#registries
Link: KSV033
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check warning

Code scanning / Trivy

Container images from public registries used Medium

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV034
Severity: MEDIUM
Message: Container 'psql' of Job 'pg-restore-job' should restrict container image to use private registries
Link: KSV034
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check warning

Code scanning / Trivy

All container images must start with an ECR domain Medium

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV035
Severity: MEDIUM
Message: Container 'psql' of Job 'pg-restore-job' should restrict images to own ECR repository. See the full ECR list here: https://docs.aws.amazon.com/general/latest/gr/ecr.html
Link: KSV035
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check warning

Code scanning / Trivy

Seccomp policies disabled Medium

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV104
Severity: MEDIUM
Message: container "psql" of job "pg-restore-job" in "orch-database" namespace should specify a seccomp profile
Link: KSV104
Comment on lines +14 to +25
- name: psql
image: postgres:15
command: ["sh", "-c", "psql -h postgresql-cloudnative-cluster-rw -U postgres -f /sql/orch-database_postgresql-0_backup.sql"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-cloudnative-cluster-superuser
key: password
volumeMounts:
- name: sql-volume
mountPath: /sql

Check notice

Code scanning / Trivy

Container capabilities must only include NET_BIND_SERVICE Low

Artifact: restore_postgres_job.yaml
Type: kubernetes
Vulnerability KSV106
Severity: LOW
Message: container should drop all
Link: KSV106
@ajaythakurintel ajaythakurintel added this to the 3.1 milestone May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants