Fix Harbor PostgreSQL data directory permissions
Add securityContext configuration to the database StatefulSet to ensure PostgreSQL can access its data directory with correct permissions. The issue was that the PVC mount permissions did not match PostgreSQL's requirements (u=rwx/0700 or u=rwx,g=rx/0750). This fix sets: - runAsUser: 999 (postgres user) - fsGroup: 999 (postgres group) - fsGroupChangePolicy: OnRootMismatch (only change ownership when needed) This resolves the crash loop where harbor-database-0 failed with: 'data directory has invalid permissions' Fixes: DEV-364 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
38639f369e
commit
c6b14ff0bc
1 changed files with 14 additions and 0 deletions
|
|
@ -43,6 +43,20 @@ harbor:
|
||||||
type: internal
|
type: internal
|
||||||
internal:
|
internal:
|
||||||
existingSecret: harbor-secrets
|
existingSecret: harbor-secrets
|
||||||
|
# Fix PostgreSQL data directory permissions
|
||||||
|
# The init container needs to set correct ownership for PostgreSQL
|
||||||
|
initContainer:
|
||||||
|
migrator: {}
|
||||||
|
permissions:
|
||||||
|
image:
|
||||||
|
registry: docker.io
|
||||||
|
repository: library/busybox
|
||||||
|
tag: latest
|
||||||
|
# Set proper security context for PostgreSQL
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 999
|
||||||
|
fsGroup: 999
|
||||||
|
fsGroupChangePolicy: "OnRootMismatch"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
type: internal
|
type: internal
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue