Skip to content

Vaviloff/exp-k8s-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Execute commands in pods and get result output in node.js

  1. Have a cluster (microk8s is a nice super fast way to start locally)

  2. Launch a minimum pod and connect to its shell:

kubectl run -i --tty busybox --image=busybox --restart=Never -- sh
  1. Create a sample file inside of the pod:
mkdir /example && echo '{ "id": "junx8nvi8visygivlxvgilx" }' > /example/data.json
  1. Run:
yarn
node index.js
  1. Should get result:
Exited with status: Success
Retrieved instance ID from pod: junx8nvi8visygivlxvgilx

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published