How would you change file/directory ownership on a Postgres container deployed to kubernetes?

3/17/2021

The error output when including the below command in the statefulset manifests to change the directory ownership.

“/bin/chown 26:26 -R”

The file belonging to the database system will be owned by user “postgres”

The user must also own the server process.

The database cluster will be initialized with locale “en_US.utf8”.

The default database encoding has accordingly been set to “UTF8”.

The default text search configuration will be set to “english”.

Data page checksum are disabled. initdb: error: directory “/var/lib/postgresql/data” exists but is not empty.

If you want to create a new database system, either remove or empty the directory “/var/lib/postgresql/data” or run initdb with an argument other than “/var/lib/postgresql/data”.

-- aseweje
kubernetes
postgresql

0 Answers