Allow ability to set security context for postgres deployment (#1517)

- Added docs for securityContext 
- enabled web securityContext configuration

Co-authored-by: Christian M. Adams <chadams@redhat.com>
This commit is contained in:
rakesh561
2023-09-27 18:05:46 -04:00
committed by GitHub
parent 6bc101af3e
commit 8518e0d1c7
8 changed files with 47 additions and 1 deletions

View File

@@ -424,6 +424,7 @@ garbage_collect_secrets: false
development_mode: false
security_context_settings: {}
postgres_security_context_settings: {}
# Set no_log settings on certain tasks
no_log: true

View File

@@ -442,7 +442,7 @@ spec:
fsGroup: 1000
{% endif %}
{% if security_context_settings|length %}
{{ security_context_settings | to_nice_yaml | indent(8) }}
{{ security_context_settings | to_nice_yaml | indent(10) }}
{% endif %}
{% endif %}
{% if termination_grace_period_seconds is defined %}

View File

@@ -340,6 +340,10 @@ spec:
{% elif affinity %}
affinity:
{{ affinity | to_nice_yaml | indent(width=8) }}
{% endif %}
{% if security_context_settings|length %}
securityContext:
{{ security_context_settings | to_nice_yaml | indent(8) }}
{% endif %}
volumes:
- name: "{{ ansible_operator_meta.name }}-receptor-ca"

View File

@@ -51,6 +51,10 @@ spec:
- image: '{{ _postgres_image }}'
imagePullPolicy: '{{ image_pull_policy }}'
name: postgres
{% if postgres_security_context_settings|length %}
securityContext:
{{ postgres_security_context_settings | to_nice_yaml | indent(12) }}
{% endif %}
{% if postgres_extra_args %}
args: {{ postgres_extra_args }}
{% endif %}