<p>Installed PostgreSQL in AWS Eks through Helm <a href="https://bitnami.com/stack/postgresql-ha/helm" rel="nofollow noreferrer">https://bitnami.com/stack/postgresql-ha/helm</a></p>
<p>I need to fulfill some tasks in deployments with root rights, but when</p>
<pre><code>su -
</code></pre>
<p>requires a password that I don't know and where to take it, and to access the desired folders, such as /opt/bitnami/postgresql/</p>
<p>Error: Permission denied</p>
<p>How to get the necessary rights or what password?</p>
<p>Image attached: <a href="https://i.stack.imgur.com/MUxVQ.jpg" rel="nofollow noreferrer">bitnami root error</a></p>

<blockquote>
<p>I need [...] to place the .so libraries I need for postgresql in [...] <code>/opt/bitnami/postgresql/lib</code></p>
</blockquote>
<p>I'd consider this &quot;extending&quot; rather than &quot;configuring&quot; PostgreSQL; it's not a task you can do with a Helm chart alone.  On a standalone server it's not something you could configure with only a text editor, for example, and while <a href="https://github.com/bitnami/charts/tree/master/bitnami/postgresql-ha" rel="nofollow noreferrer">the Bitnami PostgreSQL-HA chart</a> has a pretty wide swath of configuration options, none of them allow providing extra binary libraries.</p>
<p>The first step to doing this is to create a custom Docker image that includes the shared library.  That can start <code>FROM</code> the Bitnami PostgreSQL image this chart uses:</p>
<pre class="lang-sh prettyprint-override"><code>ARG postgresql_tag=11.12.0-debian-10-r44
FROM bitnami/postgresql:${postgresql_tag}
# assumes the shared library is in the same directory as
# the Dockerfile
COPY whatever.so /opt/bitnami/postgresql/lib
# or RUN curl ..., or RUN apt-get, or ...
#
# You do not need EXPOSE, ENTRYPOINT, CMD, etc.
# These come from the base image
</code></pre>
<p>Build this image and push it to a Docker registry, the same way you do for your application code.  (In a purely local context you might be able to <code>docker build</code> the image in minikube's context.)</p>
<p>When you deploy the chart, it has options to override the image it runs, so you can point it at your own custom image.  Your Helm values could look like:</p>
<pre class="lang-yaml prettyprint-override"><code>postgresqlImage:
  registry: registry.example.com:5000
  repository: infra/postgresql
  tag: 11.12.0-debian-10-r44
  # `docker run registry.example.com:5000/infra/postgresql:11.12.0-debian-10-r44`
</code></pre>
<p>and then you can provide this file via the <code>helm install -f</code> option when you deploy the chart.</p>
<p>You should almost never try to manually configure a Kubernetes pod by logging into it with <code>kubectl exec</code>.  It is extremely routine to delete pods, and in many cases Kubernetes does this automatically (if the image tag in a Deployment or StatefulSet changes; if a HorizontalPodAutoscaler scales down; if a Node is taken offline); in these cases your manual changes will be lost.  If there are multiple replicas of a pod (with an HA database setup there almost certainly will be) you also need to make identical changes in every replica.</p>
