mariadb-operator: Error writing Galera Config. Permission Denied[Bug]
Describe the bug I am attempting to follow the basic documentation for deploying a galera cluster using the operator.
From the main branch of the mariadb-operator
DOCKER-SHELL1:/tmp/mariadb-operator$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
I create the config manifests:
DOCKER-SHELL1:/tmp/mariadb-operator$ kubectl apply -f examples/manifests/config
configmap/mariadb created
configmap/mariadb-my-cnf created
secret/mariadb created
secret/user created
Followed by the galera cluster manifest:
DOCKER-SHELL1:/tmp/mariadb-operator$ kubectl apply -f examples/manifests/mariadb_v1alpha1_mariadb_galera.yaml
mariadb.mariadb.mmontes.io/mariadb-galera created
The cluster fails to initialize:
DOCKER-SHELL1:/tmp/mariadb-operator$ k get po
NAME READY STATUS RESTARTS AGE
mariadb-galera-0 0/2 Init:CrashLoopBackOff 6 (4m15s ago) 10m
mariadb-galera-1 0/2 Init:CrashLoopBackOff 6 (4m17s ago) 10m
mariadb-galera-2 0/2 Init:CrashLoopBackOff 6 (4m5s ago) 10m
mariadb-operator-7bcf6d44f-9nnks 1/1 Running 0 3h15m
mariadb-operator-webhook-6d7669464d-84hgm 1/1 Running 0
With the following init errors
DOCKER-SHELL1:/tmp/mariadb-operator$ k logs mariadb-galera-0 init
{"level":"info","ts":1690491722.3708434,"msg":"Starting init"}
{"level":"info","ts":1690491722.3937182,"msg":"Configuring Galera"}
{"level":"error","ts":1690491722.393788,"msg":"Error writing Galera config","error":"open /etc/mysql/mariadb.conf.d/0-galera.cnf: permission denied","stacktrace":"runtime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
DOCKER-SHELL1:/tmp/mariadb-operator$
DOCKER-SHELL1:/tmp/mariadb-operator$ k logs mariadb-galera-0 init --previous
{"level":"info","ts":1690491722.3708434,"msg":"Starting init"}
{"level":"info","ts":1690491722.3937182,"msg":"Configuring Galera"}
{"level":"error","ts":1690491722.393788,"msg":"Error writing Galera config","error":"open /etc/mysql/mariadb.conf.d/0-galera.cnf: permission denied","stacktrace":"runtime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
DOCKER-SHELL1:/tmp/mariadb-operator$
'''
**Environment details**:
- Kubernetes version: v1.25.5
- mariadb-operator version: mariadb-operator-0.19.0 v0.0.19
- Install method: helm
- Install flavour: minimal
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 27 (11 by maintainers)
It looks like bumping up pvc to 500Mi worked. I think you can close the issue. However you may want to change the default size, or update the documentation for galera clusters appropriately.
“Can’t initialize timers” -> https://github.com/MariaDB/mariadb-docker/issues/434
TLDR;
I am no expert on longhorn either 😊 but know this request, talking about this. https://github.com/longhorn/longhorn/issues/1165
The request is for the possibility of have specific permissions for init. At that time longhorn did not respect security on text by do now.
And this reference to update the docs.
“Currently, Longhorn uses Bidirectional mount propagation, therefore it is allowed only in privileged containers. Ref to https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation”
https://github.com/longhorn/longhorn/issues/3549
https://github.com/longhorn/longhorn/issues/3549#issuecomment-1046494049
Not sure this is to any help 😅
@grooverdan thanks for the information. I was able to get past that error by allowing the pod to run in an unconfined seccomp profile:
Next I encountered the following error:
I am working on debugging that issue now.
UPDATE:
Looks like there are issues with the data directory:
I can write to the galera volume mount:
which implies that it is not an issue with the rook-ceph rbd volume.
The volume is, in fact, full:
I am going to rebuild with a larger PVC. The 100Mi default may not be sufficient?
Did you recreate the galera cluster or just change the manifest and version for the init container? I had to recreate it, to make it work 😊
@anfechtunghttps://github.com/anfechtung interesting, I think your config file either got corrupted or is invalid, the init container seem to have worked. Could you provide the contents of /etc/mysql/mariadb.conf.d/0-galera.cnf?
@grooverdanhttps://github.com/grooverdan regarding the MariaDB container logs, does this logs ring a bell?