[Bug] Pulsar's containers fail to start in k8s with readOnlyRootFilesystem pod/container security context
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
any, for example 3.0.2
### Minimal reproduce step
```
❯ docker run --user 10000:10001 -e advertisedAddress=foobar --rm --read-only apachepulsar/pulsar:3.0.2 sh \
-c "bin/apply-config-from-env.py \
conf/standalone.conf && \
bin/pulsar standalone"
[conf/standalone.conf] Applying config advertisedAddress = foobar
Traceback (most recent call last):
File "/pulsar/bin/apply-config-from-env.py", line 104, in
f = open(conf_filename, 'w')
OSError: [Errno 30] Read-only file system: 'conf/standalone.conf'
```
### What did you expect to see?
I should be possible to run Pulsar container with read only root filesystem.
### What did you see instead?
`OSError: [Errno 30] Read-only file system` error
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start with bin/apply-config-from-env.py and the conf/standalone.conf step in the reproduction, then trace how bin/pulsar starts in the apachepulsar/pulsar container. Reproduce with Docker's read-only root filesystem and the Kubernetes security context; done means the container starts without the read-only filesystem error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, kubernetes, python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100