kotal
kotal copied to clipboard
Use subpath instead of initContianer copy shell script
Hi, I'm little curious about initContainer logic (e.g. lotus).
Can I use subPath mount config toml file Instead of initContainer?
apiVersion: apps/v1
kind: StatefulSet
spec:
template:
spec:
containers:
- args:
- lotus
- daemon
env:
- name: LOTUS_PATH
value: /home/filecoin/kotal-data
- name: GOLOG_LOG_LEVEL
value: info
imagePullPolicy: IfNotPresent
name: node
volumeMounts:
- mountPath: /home/filecoin/kotal-data
name: data
- mountPath: /home/filecoin/kotal-data/config.toml
name: config
subPath: config.toml
volumes:
- name: data
persistentVolumeClaim:
claimName: filecoin-mainnet-ckeil8ouci5s
- configMap:
defaultMode: 420
name: filecoin-mainnet-ckeil8ouci5s
name: config
I tested it , it works well.
hi @skrbug,
We're always using initContainers for any setup or config initialization, and using container(s) for the node itself.
One container one process, and we avoid &&
at all costs.
For debugging purposes, it will be easy to spot that it's initialization issue if you spot Init:Error
or Init:CrashLoopBackOff
.
Your enhancement is interesting, because lotus node reads config from data dir, can you raise a PR that we can review. Thank you 🙏
@mFarghaly #14 Sure.I would love to raise pr. Recently a little busy, I forgot to reply. IMO It's clearer and faster use volume subpath. PTAL