Helm Sentry installation failed on deployment: initdb: could not change permissions of directory

11/6/2018

I have a local Openshift instance where I'm trying to install Sentry using helm as:

helm install --name sentry --wait stable/sentry.

All pods are deployed fine other than the PostgreSQL pod also deployed as a dependency for Sentry. This pod's initiliazation fails as a CrashLoopBackOff and the logs show the following:

The files belonging to this database system will be owned by user "postgres".
This 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 checksums are disabled.

initdb: could not change permissions of directory "/var/lib/postgresql/data/pgdata": Operation not permitted

Not sure where to start to fix this issue so I can get sentry deployed successfully with all its dependencies

-- shanwar
docker
kubernetes
kubernetes-helm
openshift
sentry

1 Answer

11/9/2018

The issue was resolved by adding permissions to the service account that was being used to run commands on the pod. In my case the default service account on OpenShift was being used. I added the appropriate permissions to this service account using the cli:

oc adm policy add-scc-to-user anyuid -z default --as system:admin

Also see: https://blog.openshift.com/understanding-service-accounts-sccs/

-- shanwar
Source: StackOverflow