I updated readOnlyRootFilesystem: true in my cronjob yaml but started getting the error
OSError: [Errno 30] Read-only file system: '/absolute/path/to/your/folder'
I further added an empty directory volumeMounts: - name: tmp-volume mountPath: absolute/path/to/your/folder volumes:
- name: tmp-volume emptyDir: {}
After adding this I am starting to get
**python3.11: can't open file 'absolute/path/to/your/folder/text.py': [Errno 2] No such file or directory**
I have attached the cronjob yaml
containers:
- env:
- name: ENV_VAR
value: value
- name: MAINTAIN_HA_POOL
value: "true"
- name: PROCESS_SCHEDULER_REQUESTS
value: "true"
- name: MAINTAIN_NODE_POOL
value: "false"
- name: ENABLE_LSV3
value: "false"
image: us.icr.io/nz-cloud/nzsaas-common-pool-cronjob:master-2.1.2.0-20240329-111245
imagePullPolicy: Always
name: common-machine-pool-cronjob-container
resources: {}
securityContext:
privileged: true
readOnlyRootFilesystem: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/ibm/common-pool-cronjob/
name: tmp-volume
volumes:
- emptyDir: {}
name: tmp-volume
FYI I have given CHMOD 777 to the particular folder
Further to my comment, creating an
emptyDircreates an empty folder.You need to create
text.pyin the folder referenced byemptyDirbefore you can interact with it.By way of example:
app.yaml:And:
Yields:
and: