From ebaa4074441d8c266ce19bcd5d3fc6ca7ff48d6d Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Thu, 12 Aug 2021 15:50:42 -0400 Subject: [PATCH 1/2] Revert "Added fsGroup" This reverts commit 649f0cc3fb69d27e29553735295b749e866bc541. --- roles/installer/templates/postgres.yaml.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/installer/templates/postgres.yaml.j2 b/roles/installer/templates/postgres.yaml.j2 index f87c84204..bf2e018a3 100644 --- a/roles/installer/templates/postgres.yaml.j2 +++ b/roles/installer/templates/postgres.yaml.j2 @@ -56,8 +56,6 @@ spec: - image: '{{ postgres_image }}:{{ postgres_image_version }}' imagePullPolicy: '{{ image_pull_policy }}' name: postgres - securityContext: - fsGroup: 999 env: # For postgres_image based on rhel8/postgresql-12 - name: POSTGRESQL_DATABASE From 8952d8fd640988faa2b315301ab05d148d03396a Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Thu, 12 Aug 2021 15:51:15 -0400 Subject: [PATCH 2/2] Revert "pgsql uses initContainer to address FS permissions" This reverts commit 99d77dff990244e648d2c617101cc48807d1a1ef. --- roles/installer/tasks/database_configuration.yml | 3 +-- roles/installer/templates/postgres.yaml.j2 | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/roles/installer/tasks/database_configuration.yml b/roles/installer/tasks/database_configuration.yml index 470530ae0..2e99be552 100644 --- a/roles/installer/tasks/database_configuration.yml +++ b/roles/installer/tasks/database_configuration.yml @@ -80,9 +80,8 @@ - block: - name: Create Database if no database is specified k8s: - apply: yes + apply: true definition: "{{ lookup('template', 'postgres.yaml.j2') }}" - wait: yes register: create_statefulset_result rescue: diff --git a/roles/installer/templates/postgres.yaml.j2 b/roles/installer/templates/postgres.yaml.j2 index bf2e018a3..d17ee12ac 100644 --- a/roles/installer/templates/postgres.yaml.j2 +++ b/roles/installer/templates/postgres.yaml.j2 @@ -37,21 +37,6 @@ spec: imagePullSecrets: - name: {{ image_pull_secret }} {% endif %} - initContainers: - - name: init-chmod-data - image: '{{ postgres_image }}:{{ postgres_image_version }}' - imagePullPolicy: '{{ image_pull_policy }}' - command: - - /bin/sh - - -c - - | - if [ ! -f {{ postgres_data_path }}/PG_VERSION ]; then - chown postgres:root {{ postgres_data_path | dirname }} - fi - volumeMounts: - - name: postgres - mountPath: '{{ postgres_data_path | dirname }}' - subPath: '{{ postgres_data_path | dirname | basename }}' containers: - image: '{{ postgres_image }}:{{ postgres_image_version }}' imagePullPolicy: '{{ image_pull_policy }}'