godaddy/kubernetes-client

Delete deployment and associated pods?

Open

#148 aperta il 28 set 2017

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (206 fork)batch import
help wantedrequest for example

Metriche repository

Star
 (954 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hi,

const Api = require('kubernetes-client');

const deploy = new Api.Extensions({
    url: 'https://SERVER:6443',
    version: 'v1beta1',  // Defaults to 'v1beta1'
    insecureSkipTlsVerify: true,
    auth: {
        user: 'root',
        pass: 'pass'
    }
});

function print(err, result) {
    console.log(JSON.stringify(err || result, null, 2));
}

// deploy.ns('fortesting').deploy('echoserver').get(print);
deploy.ns('fortesting').deploy({name: 'echoserver', qs: { PropagationPolicy: false }}).delete(print);

Output:

{
  "code": 404
}

I can delete the deploy with 'deploy.ns('fortesting').deploy('echoserver').delete(print);` but this command cannot delete the pods, which I've created through deploy.

I've found the issue #62 , the option orphanDependents is depricated ([https://kubernetes.io/docs/api-reference/v1.6/#deployment-v1beta1-extensions](doc api)) it's now PropagationPolicy.

Guida contributor