Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use subpath instead of initContianer copy shell script #12

Open
J1a-wei opened this issue Jun 1, 2022 · 1 comment
Open

Use subpath instead of initContianer copy shell script #12

J1a-wei opened this issue Jun 1, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@J1a-wei
Copy link

J1a-wei commented Jun 1, 2022

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.

@mFarghaly mFarghaly added enhancement New feature or request good first issue Good for newcomers labels Jun 3, 2022
@mFarghaly
Copy link
Member

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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants