<p>how to list statefulsets in node js?</p>

<p>I am using @kubernetes/client-node and is it possible to apply a yaml via node app?</p>

<p><strong>node app:</strong></p>

<pre><code>var express = require('express')
var app = express();
const k8s = require('@kubernetes/client-node');

const kc = new k8s.KubeConfig();
kc.loadFromDefault();

const k8sApi = kc.makeApiClient(k8s.CoreV1Api);

app.set('port', (process.env.PORT || 5000))
app.use(express.static(__dirname + '/public'))

app.get('/', function(request, response) {
  response.send('Hello World!')
})

app.get('/pods', function(request, response) {
  k8sApi.listNamespacedPod('default').then(
    (result) =&gt; {
      response.send(result.body.items)
    }
  )
})

app.listen(app.get('port'), function() {
  console.log("Node app is running at localhost:" + app.get('port'))
})
</code></pre>

<p>referrences: 
<a href="https://github.com/kubernetes-client/javascript" rel="nofollow noreferrer">https://github.com/kubernetes-client/javascript</a>
<a href="https://cloud.google.com/kubernetes-engine/docs/concepts/statefulset" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/concepts/statefulset</a></p>

Imrahamed
<h1>List:</h1>
<p><a href="https://github.com/kubernetes-client/javascript/blob/master/src/gen/api/appsV1beta1Api.ts#L1513" rel="nofollow noreferrer">listStatefulSetForAllNamespaces</a></p>
<h1>Delete:</h1>
<p><a href="https://github.com/kubernetes-client/javascript/blob/master/src/gen/api/appsV1beta1Api.ts#L889" rel="nofollow noreferrer">deleteNamespacedStatefulSet</a></p>
<p>Note:
should use AppsV1Api instead of CoreV1Api.</p>
<pre><code>const k8sApi = kc.makeApiClient(k8s.AppsV1Api)
</code></pre>
