kubernetes-client / javascript

Javascript client
Apache License 2.0
2.03k stars 519 forks source link

Top node and Top Pod missing reference to dist #1844

Open suriya786 opened 2 months ago

suriya786 commented 2 months ago

Hi, Sir/Madam I am trying to use the example top node pod. Instead of kubernetes-client its pointed to dist. I was unable to find any reference in the forked files. Please advice.

https://github.com/kubernetes-client/javascript/blob/master/examples/top.js

mstruebing commented 2 months ago

Hey @suriya786 it is pointed to dist in the examples to be able to use the code of the repository while working on it/to have the same exact version you've checked out.

In a real project you would use @kubernetes-client/node.

I was unable to find any reference in the forked files. Please advice.

What is your problem here? If you are missing the dist directory, you would need to install and build the package yourself. You can do this with a checked out repository: npm run install which also builds the package as part of it's npm scripts automatically. If you want to rebuild later with changes made you can run npm run build. That creates the dist folder and you can run the example node ./examples/top_pods.js.

Alternatively, if you want to use it in a different project, you can run npm install @kubernetes-client/node and use const k8s = require('@kubernetes-client/node'); instead.

Hope this helps, feel free to ask more questions or close this issue if this answers your question.