0

I have want to pipe the output of my nodejs file like node example.js|node_modules/bunyan/bin/bunyan for better readability. How can I specify this in the yaml?

I tried several things like:

      command:
        - node
      args:
        - index.js | node_modules/bunyan/bin/bunyan

or

command:
        - node
      args:
        - index.js 
        - node_modules/bunyan/bin/bunyan

or

command:
        - node index.js | node_modules/bunyan/bin/bunyan

but none of it worked.
Is it possible and if yes, whats the correct way to do it?

Calipee
  • 173
  • 1
  • 7
  • Could you elaborate? You have pod in kubernetes with nodejs and you want to output some date from this application to file? You want to read if from kubernetes level? Could you share some background? – PjoterS Dec 04 '20 at 14:19

2 Answers2

1

Thanks for your help but I already found a solution that worked for me. Instead of directly using the command I stored it in a shell script and use it for execution.

Calipee
  • 173
  • 1
  • 7
0

Try this (provided your container have /bin/sh available)

command: ["/bin/sh"]
args: ["-c", "node example.js|node_modules/bunyan/bin/bunyan"]
Syam Sankar
  • 361
  • 1
  • 6