Skip to content
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

chore(psql): add securityContext to run as nonRoot #32

Closed
wants to merge 2 commits into from

Conversation

fty4
Copy link
Member

@fty4 fty4 commented Jul 20, 2023

Description

Run the psql for consumer and provider with securityontext as nonRoot container.

Additional information


Marco Lecheler [email protected] Mercedes-Benz Tech Innovation GmbH (ProviderInformation)

Copy link
Member Author

@fty4 fty4 left a comment

Choose a reason for hiding this comment

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

Also use1001 also as group id - that was already the case.

Also currently the postgresql does not startup:

mkdir: cannot create directory ‘/bitnami/postgresql/data’: Permission denied

charts/umbrella/values.yaml Show resolved Hide resolved
charts/umbrella/values.yaml Show resolved Hide resolved
@fty4
Copy link
Member Author

fty4 commented Jul 20, 2023

Problem:

mkdir can not be executed because the directory /bitnami/postgresql is owned by root and user 1001 can not create data directory:

$ pwd
/bitnami/postgresql
$ ls -la .
total 16
drwxrwxr-x  4 root root 4096 Jul 20 16:04 .
drwxr-xr-x  3 root root 4096 Dec 16  2022 ..
drwxrwxr-x  3 root root 4096 Jul 20 16:04 conf
drwx------ 19 1001 root 4096 Jul 20 16:04 data

@fty4
Copy link
Member Author

fty4 commented Jul 27, 2023

We do not need this change - the problem is that in bitnami postgresql 12.1.6 chart the initContainers is not correctly templated:

...
      initContainers:
      containers:
        - name: postgresql
...

Because it is not templated as empty array (initContainers: []) or better not included the kyverno policy will not recognise any nonRoot securityContext and fail.

When updating to the latest (12.7.1) bitnami postgresql the problem will not occur.
Therefore the in the edc chart the psql dependency should be updated - no change in the e2e-testing value file will be required.

@fty4 fty4 closed this Jul 27, 2023
@fty4 fty4 deleted the chore/nonroot-psql branch July 27, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant