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

add postgres securityContext at pod level #1947

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/crd/bases/awx.ansible.com_awxs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,10 @@ spec:
description: Set session cookie secure mode for web
type: string
postgres_security_context_settings:
description: Key/values that will be set under the container-level securityContext field
type: object
x-kubernetes-preserve-unknown-fields: true
postgres_pod_security_context_settings:
description: Key/values that will be set under the pod-level securityContext field
type: object
x-kubernetes-preserve-unknown-fields: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,16 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: PostgreSQL Security Context Settings
- displayName: PostgreSQL Container Security Context Settings
path: postgres_security_context_settings
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: PostgreSQL Pod Security Context Settings
path: postgres_pod_security_context_settings
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: PostgreSQL Image
path: postgres_image
x-descriptors:
Expand Down
9 changes: 5 additions & 4 deletions docs/user-guide/advanced-configuration/security-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

It is possible to modify some `SecurityContext` proprieties of the various deployments and stateful sets if needed.

| Name | Description | Default |
| ---------------------------------- | -------------------------------------------- | ------- |
| security_context_settings | SecurityContext for Task and Web deployments | {} |
| postgres_security_context_settings | SecurityContext for PostgreSQL container | {} |
| Name | Description | Default |
| -------------------------------------- | -------------------------------------------- | ------- |
| security_context_settings | SecurityContext for Task and Web deployments | {} |
| postgres_security_context_settings | SecurityContext for PostgreSQL container | {} |
| postgres_pod_security_context_settings | SecurityContext for PostgreSQL pod | {} |

Example configuration securityContext for the Task and Web deployments:

Expand Down
1 change: 1 addition & 0 deletions roles/installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ development_mode: false

security_context_settings: {}
postgres_security_context_settings: {}
postgres_pod_security_context_settings: {}

# Set no_log settings on certain tasks
no_log: true
Expand Down
4 changes: 4 additions & 0 deletions roles/installer/templates/statefulsets/postgres.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ spec:
tolerations:
{{ postgres_tolerations | indent(width=8) }}
{% endif %}
{% if postgres_pod_security_context_settings|length %}
securityContext:
{{ postgres_pod_security_context_settings | to_nice_yaml | indent(8) }}
{% endif %}
{% if postgres_extra_volumes %}
volumes:
{{ postgres_extra_volumes | indent(width=8, first=False) }}
Expand Down
Loading