Giter Site home page Giter Site logo

Comments (5)

kurokobo avatar kurokobo commented on July 22, 2024

@kuchynkap
Thanks for reporting, If your PV is based on K3s' Local Path Provisioner instead of hostPath as in my repository, a similar issue has been reported on ansible/awx-operator#483.
Try using the latest 0.13.0 of AWX Operator.

If it doesn't helps, we need more information to investigate. The following commands may help you find the cause of CrashLoopBackOff.

# You can get detailed information in "Events" section
kubectl -n awx describe pod awx-postgres-0

# You can get the logs from PostgreSQL
kubectl -n awx logs awx-postgres-0

from awx-on-k3s.

kuchynkap avatar kuchynkap commented on July 22, 2024

@kurokobo
Thank you for your reply! I am using hostpath, but I am hitting the issue mentioned.

$ kubectl -n awx logs awx-postgres-0
mkdir: cannot create directory β€˜/var/lib/postgresql/data’: Permission denied

from awx-on-k3s.

kurokobo avatar kurokobo commented on July 22, 2024

@kuchynkap
Okay, so you should focus on the permissions, as described in that error message.
Could you check the permission and owner/group of the actual directories you are using in hostPath?

# Replace `/data/postgres` with your directory path.
$ ls -ld /data/postgres /data/postgres/data
drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres
drwxr-xr-x. 3 root root 20 Aug 20 10:09 /data/postgres/data

If your hostPath is /data/postgres, Kubernetes will create /data/postgres/data as subPath for awx-postgres-0 pod. The problem is the permissions of this subPath directory.

In my environment, 755 and root:root (0:0) works correctly. So you can try;

# Replace `/data/postgres` with your directory path.
sudo chmod 755 /data/postgres /data/postgres/data
sudo chown 0:0 /data/postgres /data/postgres/data

Or, you can also try 999:999 as owner/group for the directory.

sudo chmod 755 /data/postgres /data/postgres/data
sudo chown 999:999 /data/postgres /data/postgres/data

999 is the UID/GID of the postgres user which used in the container.

from awx-on-k3s.

kuchynkap avatar kuchynkap commented on July 22, 2024

Hi @kurokobo,

thank you!

@kuchynkap
Okay, so you should focus on the permissions, as described in that error message.
Could you check the permission and owner/group of the actual directories you are using in hostPath?

# Replace `/data/postgres` with your directory path.
$ ls -ld /data/postgres /data/postgres/data
drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres
drwxr-xr-x. 3 root root 20 Aug 20 10:09 /data/postgres/data

If your hostPath is /data/postgres, Kubernetes will create /data/postgres/data as subPath for awx-postgres-0 pod. The problem is the permissions of this subPath directory.

In my environment, 755 and root:root (0:0) works correctly. So you can try;

# Replace `/data/postgres` with your directory path.
sudo chmod 755 /data/postgres /data/postgres/data
sudo chown 0:0 /data/postgres /data/postgres/data

Or, you can also try 999:999 as owner/group for the directory.

sudo chmod 755 /data/postgres /data/postgres/data
sudo chown 999:999 /data/postgres /data/postgres/data

999 is the UID/GID of the postgres user which used in the container.

Hi,

thank you! chmodding /data/postgres /data/postgres/data solved the issue!

from awx-on-k3s.

kurokobo avatar kurokobo commented on July 22, 2024

good to hear that, have fun πŸš€

from awx-on-k3s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.