<p>I am using AKS(Azure k8),need k8s node.js client for this options</p>

<p>Kill pod by name<br>
Change deployments pods count<br>
Restart all deployments pods</p>

<p>I need only for this functions, witch lib is best for this?</p>

<p>Please also provide examples using lib for some of this functions.</p>

<p>Thank you    </p>

<p>UPDATE</p>

<p>I liked this one <code>Node.js (TypeScript) github.com/Goyoo/node-k8s-client</code>,can you provide more information about service account and access ?</p>

Grigor
<p>Here is the full list of all the client libraries.</p>

<p><a href="https://kubernetes.io/docs/reference/using-api/client-libraries/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/using-api/client-libraries/</a></p>

<p>You will need to create a service account , and role binding to configure the proper permissions to do these operations from the client library.</p>

<p><strong><em>node.js specific libraries:</em></strong></p>

<blockquote>
  <p>Node.js (TypeScript)  github.com/Goyoo/node-k8s-client</p>
  
  <p>Node.js   github.com/tenxcloud/node-kubernetes-client</p>
  
  <p>Node.js   github.com/godaddy/kubernetes-client</p>
</blockquote>

<p><strong><em>Basic Example ( Using godaddy client)</em></strong></p>

<pre><code>/* eslint no-console:0 */
//
// Demonstrate some of the basics.
//
const Client = require('kubernetes-client').Client;
const config = require('kubernetes-client').config;

const deploymentManifest = require('./nginx-deployment.json');

async function main() {
  try {
    const client = new Client({ config: config.fromKubeconfig(), version: '1.9' });

    //
    // Get all the Namespaces.
    //
    const namespaces = await client.api.v1.namespaces.get();
    console.log('Namespaces: ', namespaces);

    //
    // Create a new Deployment.
    //
    const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest });
    console.log('Create: ', create);

    //
    // Fetch the Deployment we just created.
    //
    const deployment = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).get();
    console.log('Deployment: ', deployment);

    //
    // Change the Deployment Replica count to 10
    //

    const replica = {
      spec: {
        replicas: 10
      }
    };

    const replicaModify = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: replica });
    console.log('Replica Modification: ', replicaModify);

    //
    // Modify the image tag
    //
    const newImage = {
      spec: {
        template: {
          spec: {
            containers: [{
              name: 'nginx',
              image: 'nginx:1.8.1'
            }]
          }
        }
      }
    };
    const imageSet = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: newImage });
    console.log('New Image: ', imageSet);

    //
    // Remove the Deployment we created.
    //
    const removed = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).delete();
    console.log('Removed: ', removed);
  } catch (err) {
    console.error('Error: ', err);
  }
}

main();
</code></pre>
